Class: ActiveMerchant::Billing::SecurePayAuGateway

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

Constant Summary collapse

API_VERSION =
'xml-4.2'
TEST_URL =
'https://www.securepay.com.au/test/payment'
LIVE_URL =
'https://www.securepay.com.au/xmlapi/payment'
TRANSACTIONS =

0 Standard Payment 4 Refund 6 Client Reversal (Void) 10 Preauthorise 11 Preauth Complete (Advice)

{
  :purchase => 0,
  :authorization => 10,
  :capture => 11,
  :void => 6,
  :refund => 4
}
SUCCESS_CODES =
[ '00', '08', '11', '16', '77' ]

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?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ SecurePayAuGateway

Returns a new instance of SecurePayAuGateway.



41
42
43
44
45
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 41

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

Instance Method Details

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



56
57
58
59
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 56

def authorize(money, credit_card, options = {})
  requires!(options, :order_id)
  commit :authorization, build_purchase_request(money, credit_card, options)
end

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



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

def capture(money, reference, options = {})
  commit :capture, build_reference_request(money, reference)
end

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



69
70
71
72
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 69

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

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



51
52
53
54
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 51

def purchase(money, credit_card, options = {})
  requires!(options, :order_id)
  commit :purchase, build_purchase_request(money, credit_card, options)
end

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



65
66
67
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 65

def refund(money, reference, options = {})
  commit :refund, build_reference_request(money, reference)
end

#test?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 47

def test?
  @options[:test] || super
end

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



74
75
76
# File 'lib/active_merchant/billing/gateways/secure_pay_au.rb', line 74

def void(reference, options = {})
  commit :void, build_reference_request(nil, reference)
end