Class: ActiveMerchant::Billing::NetaxeptGateway

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

Defined Under Namespace

Classes: Response

Constant Summary

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?, #test?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ NetaxeptGateway

Returns a new instance of NetaxeptGateway.



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

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

Instance Method Details

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



41
42
43
44
45
46
47
48
49
50
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 41

def authorize(money, creditcard, options = {})
  requires!(options, :order_id)

  post = {}
  add_credentials(post, options)
  add_transaction(post, options)
  add_order(post, money, options)
  add_creditcard(post, creditcard)
  commit('Auth', post)
end

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



52
53
54
55
56
57
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 52

def capture(money, authorization, options = {})
  post = {}
  add_credentials(post, options)
  add_authorization(post, authorization, money)
  commit('Capture', post, false)
end

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



66
67
68
69
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 66

def credit(money, authorization, options = {})
  deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, authorization, options)
end

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



30
31
32
33
34
35
36
37
38
39
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 30

def purchase(money, creditcard, options = {})
  requires!(options, :order_id)

  post = {}
  add_credentials(post, options)
  add_transaction(post, options)
  add_order(post, money, options)
  add_creditcard(post, creditcard)
  commit('Sale', post)
end

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



59
60
61
62
63
64
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 59

def refund(money, authorization, options = {})
  post = {}
  add_credentials(post, options)
  add_authorization(post, authorization, money)
  commit('Credit', post, false)
end

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



71
72
73
74
75
76
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 71

def void(authorization, options = {})
  post = {}
  add_credentials(post, options)
  add_authorization(post, authorization)
  commit('Annul', post, false)
end