Class: ActiveMerchant::Billing::IatsPaymentsGateway

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

Constant Summary

Constants inherited from Gateway

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

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, supported_countries, #supported_countries, supported_countries=, supports?, #test?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ IatsPaymentsGateway

Returns a new instance of IatsPaymentsGateway.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 16

def initialize(options={})
  if(options[:login])
    ActiveMerchant.deprecated("The 'login' option is deprecated in favor of 'agent_code' and will be removed in a future version.")
    options[:agent_code] = options[:login]
  end

  options[:region] = 'na' unless options[:region]

  requires!(options, :agent_code, :password, :region)
  super
end

Instance Method Details

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



38
39
40
41
42
43
44
45
46
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 38

def authorize(money, payment, options={})
  post = {}
  add_invoice(post, money, options)
  add_payment(post, payment)
  add_address(post, options)
  add_customer_data(post, options)

  commit('authonly', post)
end

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



48
49
50
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 48

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

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



28
29
30
31
32
33
34
35
36
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 28

def purchase(money, payment, options={})
  post = {}
  add_invoice(post, money, options)
  add_payment(post, payment)
  add_address(post, options)
  add_customer_data(post, options)

  commit('ProcessCreditCardV1', post)
end

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



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

def refund(money, authorization, options={})
  post = {}
  post[:transaction_id] = authorization
  add_customer_data(post, options)
  add_invoice(post, -money, options)

  commit('ProcessCreditCardRefundWithTransactionIdV1', post)
end

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



61
62
63
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 61

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