Class: ActiveMerchant::Billing::CommercegateGateway
- Defined in:
- lib/active_merchant/billing/gateways/commercegate.rb
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ CommercegateGateway
constructor
A new instance of CommercegateGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, identification, options = {}) ⇒ Object
- #void(identification, options = {}) ⇒ Object
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
#expdate, #format, #strftime_yyyymm
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ CommercegateGateway
Returns a new instance of CommercegateGateway.
18 19 20 21 |
# File 'lib/active_merchant/billing/gateways/commercegate.rb', line 18 def initialize( = {}) requires!(, :login, :password, :site_id, :offer_id) super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/active_merchant/billing/gateways/commercegate.rb', line 23 def (money, creditcard, = {}) post = {} add_creditcard(post, creditcard) (post, money, ) commit('AUTH', post) end |
#capture(money, authorization, options = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/active_merchant/billing/gateways/commercegate.rb', line 30 def capture(money, , = {}) post = {} post[:currencyCode] = ([:currency] || currency(money)) post[:amount] = amount(money) post[:transID] = commit('CAPTURE', post) end |
#purchase(money, creditcard, options = {}) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/active_merchant/billing/gateways/commercegate.rb', line 38 def purchase(money, creditcard, = {}) post = {} add_creditcard(post, creditcard) (post, money, ) commit('SALE', post) end |
#refund(money, identification, options = {}) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/active_merchant/billing/gateways/commercegate.rb', line 45 def refund(money, identification, = {}) post = {} post[:currencyCode] = [:currency] || currency(money) post[:amount] = amount(money) post[:transID] = identification commit('REFUND', post) end |
#void(identification, options = {}) ⇒ Object
53 54 55 56 57 |
# File 'lib/active_merchant/billing/gateways/commercegate.rb', line 53 def void(identification, = {}) post = {} post[:transID] = identification commit('VOID_AUTH', post) end |