Class: ActiveMerchant::Billing::PaymentExpressGateway
- Defined in:
- lib/active_merchant/billing/gateways/payment_express.rb
Overview
In NZ DPS supports ANZ, Westpac, National Bank, ASB and BNZ. In Australia DPS supports ANZ, NAB, Westpac, CBA, St George and Bank of South Australia. The Maybank in Malaysia is supported and the Citibank for Singapore.
Constant Summary collapse
- URL =
'https://www.paymentexpress.com/pxpost.aspx'
- APPROVED =
'1'
- TRANSACTIONS =
{ :purchase => 'Purchase', :credit => 'Refund', :authorization => 'Auth', :capture => 'Complete', :validate => 'Validate' }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#authorize(money, payment_source, options = {}) ⇒ Object
NOTE: Perhaps in options we allow a transaction note to be inserted Verifies that funds are available for the requested card and amount and reserves the specified amount.
-
#capture(money, identification, options = {}) ⇒ Object
Transfer pre-authorized funds immediately See: www.paymentexpress.com/technical_resources/ecommerce_nonhosted/pxpost.html#Authcomplete.
- #credit(money, identification, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ PaymentExpressGateway
constructor
We require the DPS gateway username and password when the object is created.
-
#purchase(money, payment_source, options = {}) ⇒ Object
Funds are transferred immediately.
-
#refund(money, identification, options = {}) ⇒ Object
Refund funds to the card holder.
-
#store(credit_card, options = {}) ⇒ Object
initiates a “Validate” transcation to store card data on payment express servers returns a “token” that can be used to rebill this card see: www.paymentexpress.com/technical_resources/ecommerce_nonhosted/pxpost.html#Tokenbilling PaymentExpress does not support unstoring a stored card.
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from Utils
#deprecated, generate_unique_id
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ PaymentExpressGateway
We require the DPS gateway username and password when the object is created.
37 38 39 40 41 42 43 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 37 def initialize( = {}) # A DPS username and password must exist requires!(, :login, :password) # Make the options an instance variable @options = super end |
Instance Method Details
#authorize(money, payment_source, options = {}) ⇒ Object
NOTE: Perhaps in options we allow a transaction note to be inserted Verifies that funds are available for the requested card and amount and reserves the specified amount. See: www.paymentexpress.com/technical_resources/ecommerce_nonhosted/pxpost.html#Authcomplete
54 55 56 57 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 54 def (money, payment_source, = {}) request = (money, payment_source, ) commit(:authorization, request) end |
#capture(money, identification, options = {}) ⇒ Object
Transfer pre-authorized funds immediately See: www.paymentexpress.com/technical_resources/ecommerce_nonhosted/pxpost.html#Authcomplete
61 62 63 64 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 61 def capture(money, identification, = {}) request = build_capture_or_credit_request(money, identification, ) commit(:capture, request) end |
#credit(money, identification, options = {}) ⇒ Object
74 75 76 77 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 74 def credit(money, identification, = {}) deprecated CREDIT_DEPRECATION_MESSAGE refund(money, identification, ) end |
#purchase(money, payment_source, options = {}) ⇒ Object
Funds are transferred immediately.
46 47 48 49 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 46 def purchase(money, payment_source, = {}) request = (money, payment_source, ) commit(:purchase, request) end |
#refund(money, identification, options = {}) ⇒ Object
Refund funds to the card holder
67 68 69 70 71 72 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 67 def refund(money, identification, = {}) requires!(, :description) request = build_capture_or_credit_request(money, identification, ) commit(:credit, request) end |
#store(credit_card, options = {}) ⇒ Object
initiates a “Validate” transcation to store card data on payment express servers returns a “token” that can be used to rebill this card see: www.paymentexpress.com/technical_resources/ecommerce_nonhosted/pxpost.html#Tokenbilling PaymentExpress does not support unstoring a stored card.
85 86 87 88 |
# File 'lib/active_merchant/billing/gateways/payment_express.rb', line 85 def store(credit_card, = {}) request = build_token_request(credit_card, ) commit(:validate, request) end |