Class: ActiveMerchant::Billing::NetworkMerchantsGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/network_merchants.rb

Direct Known Subclasses

TransnationalGateway

Defined Under Namespace

Classes: ResponseCodes

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

#options

Instance Method Summary collapse

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

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ NetworkMerchantsGateway

Returns a new instance of NetworkMerchantsGateway.



15
16
17
18
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 15

def initialize(options = {})
  requires!(options, :login, :password)
  super
end

Instance Method Details

#authorize(money, creditcard_or_vault_id, options = {}) ⇒ Object



20
21
22
23
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 20

def authorize(money, creditcard_or_vault_id, options = {})
  post = build_auth_post(money, creditcard_or_vault_id, options)
  commit('auth', post)
end

#capture(money, authorization, options = {}) ⇒ Object



30
31
32
33
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 30

def capture(money, authorization, options = {})
  post = build_capture_post(money, authorization, options)
  commit('capture', post)
end

#purchase(money, creditcard_or_vault_id, options = {}) ⇒ Object



25
26
27
28
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 25

def purchase(money, creditcard_or_vault_id, options = {})
  post = build_purchase_post(money, creditcard_or_vault_id, options)
  commit('sale', post)
end

#refund(money, authorization, options = {}) ⇒ Object



40
41
42
43
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 40

def refund(money, authorization, options = {})
  post = build_refund_post(money, authorization, options)
  commit('refund', post)
end

#store(creditcard, options = {}) ⇒ Object



45
46
47
48
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 45

def store(creditcard, options = {})
  post = build_store_post(creditcard, options)
  commit_vault('add_customer', post)
end

#unstore(customer_vault_id, options = {}) ⇒ Object



50
51
52
53
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 50

def unstore(customer_vault_id, options = {})
  post = build_unstore_post(customer_vault_id, options)
  commit_vault('delete_customer', post)
end

#void(authorization, options = {}) ⇒ Object



35
36
37
38
# File 'lib/active_merchant/billing/gateways/network_merchants.rb', line 35

def void(authorization, options = {})
  post = build_void_post(authorization, options)
  commit('void', post)
end