Class: ActiveMerchant::Billing::PaywayGateway
- Defined in:
- lib/active_merchant/billing/gateways/payway.rb
Constant Summary collapse
- SUMMARY_CODES =
{ '0' => 'Approved', '1' => 'Declined', '2' => 'Erred', '3' => 'Rejected' }
- RESPONSE_CODES =
{ '00' => 'Completed Successfully', '01' => 'Refer to card issuer', '03' => 'Invalid merchant', '04' => 'Pick-up card', '05' => 'Do not honour', '08' => 'Honour only with identification', '12' => 'Invalid transaction', '13' => 'Invalid amount', '14' => 'Invalid card number (no such number)', '30' => 'Format error', '36' => 'Restricted card', '41' => 'Lost card', '42' => 'No universal card', '43' => 'Stolen card', '51' => 'Not sufficient funds', '54' => 'Expired card', '61' => 'Exceeds withdrawal amount limits', '62' => 'Restricted card', '65' => 'Exceeds withdrawal frequency limit', '91' => 'Issuer or switch is inoperative', '92' => 'Financial institution or intermediate network facility cannot be found for routing', '94' => 'Duplicate transmission', 'Q1' => 'Unknown Buyer', 'Q2' => 'Transaction Pending', 'Q3' => 'Payment Gateway Connection Error', 'Q4' => 'Payment Gateway Unavailable', 'Q5' => 'Invalid Transaction', 'Q6' => 'Duplicate Transaction - requery to determine status', 'QA' => 'Invalid parameters or Initialisation failed', 'QB' => 'Order type not currently supported', 'QC' => 'Invalid Order Type', 'QD' => 'Invalid Payment Amount - Payment amount less than minimum/exceeds maximum allowed limit', 'QE' => 'Internal Error', 'QF' => 'Transaction Failed', 'QG' => 'Unknown Customer Order Number', 'QH' => 'Unknown Customer Username or Password', 'QI' => 'Transaction incomplete - contact Westpac to confirm reconciliation', 'QJ' => 'Invalid Client Certificate', 'QK' => 'Unknown Customer Merchant', 'QL' => 'Business Group not configured for customer', 'QM' => 'Payment Instrument not configured for customer', 'QN' => 'Configuration Error', 'QO' => 'Missing Payment Instrument', 'QP' => 'Missing Supplier Account', 'QQ' => 'Invalid Credit Card Verification Number', 'QR' => 'Transaction Retry', 'QS' => 'Transaction Successful', 'QT' => 'Invalid currency', 'QU' => 'Unknown Customer IP Address', 'QV' => 'Invalid Original Order Number specified for Refund, Refund amount exceeds capture amount, or Previous capture was not approved', 'QW' => 'Invalid Reference Number', 'QX' => 'Network Error has occurred', 'QY' => 'Card Type Not Accepted', 'QZ' => 'Zero value transaction' }
- TRANSACTIONS =
{ :authorize => 'preauth', :purchase => 'capture', :capture => 'captureWithoutAuth', :status => 'query', :refund => 'refund', :store => 'registerAccount' }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(amount, payment_method, options = {}) ⇒ Object
- #capture(amount, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ PaywayGateway
constructor
A new instance of PaywayGateway.
- #purchase(amount, payment_method, options = {}) ⇒ Object
- #refund(amount, authorization, options = {}) ⇒ Object
- #status(options = {}) ⇒ Object
- #store(credit_card, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ PaywayGateway
Returns a new instance of PaywayGateway.
86 87 88 89 90 91 92 93 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 86 def initialize(={}) @options = @options[:merchant] ||= 'TEST' if test? requires!(, :username, :password, :merchant, :pem) @options[:eci] ||= 'SSL' end |
Instance Method Details
#authorize(amount, payment_method, options = {}) ⇒ Object
95 96 97 98 99 100 101 102 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 95 def (amount, payment_method, ={}) requires!(, :order_id) post = {} add_payment_method(post, payment_method) add_order(post, amount, ) commit(:authorize, post) end |
#capture(amount, authorization, options = {}) ⇒ Object
104 105 106 107 108 109 110 111 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 104 def capture(amount, , ={}) requires!(, :order_id) post = {} add_reference(post, ) add_order(post, amount, ) commit(:capture, post) end |
#purchase(amount, payment_method, options = {}) ⇒ Object
113 114 115 116 117 118 119 120 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 113 def purchase(amount, payment_method, ={}) requires!(, :order_id) post = {} add_payment_method(post, payment_method) add_order(post, amount, ) commit(:purchase, post) end |
#refund(amount, authorization, options = {}) ⇒ Object
122 123 124 125 126 127 128 129 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 122 def refund(amount, , ={}) requires!(, :order_id) post = {} add_reference(post, ) add_order(post, amount, ) commit(:refund, post) end |
#status(options = {}) ⇒ Object
140 141 142 143 144 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 140 def status(={}) requires!(, :order_id) commit(:status, 'customer.orderNumber' => [:order_id]) end |
#store(credit_card, options = {}) ⇒ Object
131 132 133 134 135 136 137 138 |
# File 'lib/active_merchant/billing/gateways/payway.rb', line 131 def store(credit_card, ={}) requires!(, :billing_id) post = {} add_payment_method(post, credit_card) add_payment_method(post, [:billing_id]) commit(:store, post) end |