Class: ActiveMerchant::Billing::UsaEpayTransactionGateway
- Defined in:
- lib/active_merchant/billing/gateways/usa_epay_transaction.rb
Constant Summary collapse
- TRANSACTIONS =
{ :authorization => 'cc:authonly', :purchase => 'cc:sale', :capture => 'cc:capture', :refund => 'cc:refund', :void => 'cc:void', :void_release => 'cc:void:release' }
- STANDARD_ERROR_CODE_MAPPING =
{ '00011' => STANDARD_ERROR_CODE[:incorrect_number], '00012' => STANDARD_ERROR_CODE[:incorrect_number], '00013' => STANDARD_ERROR_CODE[:incorrect_number], '00014' => STANDARD_ERROR_CODE[:invalid_number], '00015' => STANDARD_ERROR_CODE[:invalid_expiry_date], '00016' => STANDARD_ERROR_CODE[:invalid_expiry_date], '00017' => STANDARD_ERROR_CODE[:expired_card], '10116' => STANDARD_ERROR_CODE[:incorrect_cvc], '10107' => STANDARD_ERROR_CODE[:incorrect_zip], '10109' => STANDARD_ERROR_CODE[:incorrect_address], '10110' => STANDARD_ERROR_CODE[:incorrect_address], '10111' => STANDARD_ERROR_CODE[:incorrect_address], '10127' => STANDARD_ERROR_CODE[:card_declined], '10128' => STANDARD_ERROR_CODE[:processing_error], '10132' => STANDARD_ERROR_CODE[:processing_error], '00043' => STANDARD_ERROR_CODE[:call_issuer] }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, credit_card, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ UsaEpayTransactionGateway
constructor
A new instance of UsaEpayTransactionGateway.
- #purchase(money, credit_card, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #verify(creditcard, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
Pass ‘no_release: true` to keep the void from immediately settling.
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #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 = {}) ⇒ UsaEpayTransactionGateway
Returns a new instance of UsaEpayTransactionGateway.
41 42 43 44 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 41 def initialize( = {}) requires!(, :login) super end |
Instance Method Details
#authorize(money, credit_card, options = {}) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 46 def (money, credit_card, = {}) post = {} add_amount(post, money) add_invoice(post, ) add_credit_card(post, credit_card) unless credit_card.track_data.present? add_address(post, credit_card, ) add_customer_data(post, ) end add_split_payments(post, ) commit(:authorization, post) end |
#capture(money, authorization, options = {}) ⇒ Object
76 77 78 79 80 81 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 76 def capture(money, , = {}) post = { :refNum => } add_amount(post, money) commit(:capture, post) end |
#purchase(money, credit_card, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 61 def purchase(money, credit_card, = {}) post = {} add_amount(post, money) add_invoice(post, ) add_credit_card(post, credit_card) unless credit_card.track_data.present? add_address(post, credit_card, ) add_customer_data(post, ) end add_split_payments(post, ) commit(:purchase, post) end |
#refund(money, authorization, options = {}) ⇒ Object
83 84 85 86 87 88 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 83 def refund(money, , = {}) post = { :refNum => } add_amount(post, money) commit(:refund, post) end |
#verify(creditcard, options = {}) ⇒ Object
90 91 92 93 94 95 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 90 def verify(creditcard, = {}) MultiResponse.run(:use_first_response) do |r| r.process { (1, creditcard, ) } r.process(:ignore_result) { void(r., ) } end end |
#void(authorization, options = {}) ⇒ Object
Pass ‘no_release: true` to keep the void from immediately settling
98 99 100 101 |
# File 'lib/active_merchant/billing/gateways/usa_epay_transaction.rb', line 98 def void(, = {}) command = ([:no_release] ? :void : :void_release) commit(command, refNum: ) end |