Class: ActiveMerchant::Billing::ArgusGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::ArgusGateway
- Includes:
- Empty
- Defined in:
- lib/active_merchant/billing/gateways/argus.rb
Overview
For more information visit Argus Payments
Written by Piers Chambers (Varyonic.com)
Constant Summary collapse
- STANDARD_ERROR_CODE_MAPPING =
{ '555' => STANDARD_ERROR_CODE[:call_issuer], '600' => STANDARD_ERROR_CODE[:card_declined], '620' => STANDARD_ERROR_CODE[:invalid_cvc], '621' => STANDARD_ERROR_CODE[:incorrect_cvc], '623' => STANDARD_ERROR_CODE[:incorrect_address], '624' => STANDARD_ERROR_CODE[:expired_card], '630' => STANDARD_ERROR_CODE[:invalid_number], '610' => STANDARD_ERROR_CODE[:pickup_card], }
Instance Method Summary collapse
- #authorize(money, payment, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ ArgusGateway
constructor
A new instance of ArgusGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #scrub(transcript) ⇒ Object
- #supports_scrubbing? ⇒ Boolean
- #verify(credit_card, options = {}) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ArgusGateway
Returns a new instance of ArgusGateway.
30 31 32 33 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 30 def initialize(={}) requires!(, :site_id, :req_username, :req_password) super end |
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 46 def (money, payment, ={}) post = PostData.new add_invoice(post, money, ) add_payment(post, payment) add_address(post, payment, ) add_customer_data(post, ) add_3ds_auth(post, ) commit('CCAUTHORIZE', post) end |
#capture(money, authorization, options = {}) ⇒ Object
57 58 59 60 61 62 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 57 def capture(money, , ={}) post = PostData.new post[:li_value_1] = amount(money) post[:request_ref_po_id] = commit('CCCAPTURE', post) end |
#purchase(money, payment, options = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 35 def purchase(money, payment, ={}) post = PostData.new add_invoice(post, money, ) add_payment(post, payment) add_address(post, payment, ) add_customer_data(post, ) add_3ds_auth(post, ) commit('CCAUTHCAP', post) end |
#refund(money, authorization, options = {}) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 64 def refund(money, , ={}) post = PostData.new post[:li_value_1] = amount(money) post[:request_ref_po_id] = commit('CCCREDIT', post) end |
#scrub(transcript) ⇒ Object
88 89 90 91 92 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 88 def scrub(transcript) transcript.gsub(%r((&?pmt_numb=)[^&]*)i, '\1[FILTERED]'). gsub(%r((&?pmt_key=)[^&]*)i, '\1[FILTERED]'). gsub(%r((&?req_password=)[^&]*)i, '\1[FILTERED]') end |
#supports_scrubbing? ⇒ Boolean
84 85 86 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 84 def supports_scrubbing? true end |
#verify(credit_card, options = {}) ⇒ Object
77 78 79 80 81 82 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 77 def verify(credit_card, ={}) MultiResponse.run(:use_first_response) do |r| r.process { (100, credit_card, ) } r.process(:ignore_result) { void(r., ) } end end |
#void(authorization, options = {}) ⇒ Object
71 72 73 74 75 |
# File 'lib/active_merchant/billing/gateways/argus.rb', line 71 def void(, ={}) post = PostData.new post[:request_ref_po_id] = commit('CCREVERSE', post) end |