Class: ActiveMerchant::Billing::AnzGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::AnzGateway
- Defined in:
- lib/active_merchant/billing/gateways/anz.rb
Constant Summary collapse
- GATEWAY_URL =
"https://migs.mastercard.com.au/vpcdps"
- VIRTUAL_PAYMENT_CLIENT_API_VERION =
1
Instance Method Summary collapse
-
#credit(money, authorization_number, options = {}) ⇒ Object
refunds to the customer’s card.
-
#initialize(options = {}) ⇒ AnzGateway
constructor
A new instance of AnzGateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
actual payment.
-
#query(merchant_transaction_id) ⇒ Object
query a past payment, unique merchant transaction ref.
Constructor Details
#initialize(options = {}) ⇒ AnzGateway
Returns a new instance of AnzGateway.
19 20 21 22 23 24 25 26 |
# File 'lib/active_merchant/billing/gateways/anz.rb', line 19 def initialize(={}) requires!(, :merchant_id, :access_code) if [:mode] && ([:mode].to_sym == :production || [:mode].to_sym == :test) self.mode = [:mode] end @options = super end |
Instance Method Details
#credit(money, authorization_number, options = {}) ⇒ Object
refunds to the customer’s card. autorization id is required
47 48 49 50 51 52 53 54 55 |
# File 'lib/active_merchant/billing/gateways/anz.rb', line 47 def credit(money, , = {}) requires!(, :username, :password, :order_id) params = {} add_merchant_transaction_id(params, [:order_id]) (params, ) add_username_password(params, [:username], [:password]) add_amount(params, money) process_action('refund', params) end |
#purchase(money, creditcard, options = {}) ⇒ Object
actual payment
33 34 35 36 37 38 39 40 41 |
# File 'lib/active_merchant/billing/gateways/anz.rb', line 33 def purchase(money, creditcard, = {}) requires!(, :invoice, :order_id) params = {} add_credit_card(params, creditcard) add_merchant_transaction_id(params, [:order_id]) add_invoice_number(params, [:invoice]) add_amount(params, money) process_action('pay', params) end |
#query(merchant_transaction_id) ⇒ Object
query a past payment, unique merchant transaction ref. is required
58 59 60 61 62 |
# File 'lib/active_merchant/billing/gateways/anz.rb', line 58 def query(merchant_transaction_id) params = {} add_merchant_transaction_id(params, merchant_transaction_id) process_action('QueryDR', params) end |