Class: ActiveMerchant::Billing::ArgusGateway

Inherits:
Gateway
  • Object
show all
Includes:
Empty
Defined in:
lib/active_merchant/billing/gateways/argus.rb

Overview

Argus Payments is now Inovio Payments. For more information visit Inovio

Written by Piers Chambers (Varyonic.com)

Constant Summary collapse

STANDARD_ERROR_CODE_MAPPING =
{
  '500' => STANDARD_ERROR_CODE[:processing_error],   # Merchant account could not be validated
  '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

Constructor Details

#initialize(options = {}) ⇒ ArgusGateway

Returns a new instance of ArgusGateway.



32
33
34
35
# File 'lib/active_merchant/billing/gateways/argus.rb', line 32

def initialize(options={})
  requires!(options, :site_id, :req_username, :req_password)
  super
end

Instance Method Details

#authorize(money, payment, options = {}) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/active_merchant/billing/gateways/argus.rb', line 49

def authorize(money, payment, options={})
  post = PostData.new
  add_invoice(post, money, options)
  add_payment(post, payment)
  add_address(post, payment, options)
  add_customer_data(post, options)
  add_3ds_auth(post, options)
  add_stored_credential_options(post, options)

  commit('CCAUTHORIZE', post)
end

#capture(money, authorization, options = {}) ⇒ Object



61
62
63
64
65
66
# File 'lib/active_merchant/billing/gateways/argus.rb', line 61

def capture(money, authorization, options={})
  post = PostData.new
  post[:li_value_1] = amount(money)
  post[:request_ref_po_id] = authorization
  commit('CCCAPTURE', post)
end

#purchase(money, payment, options = {}) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/active_merchant/billing/gateways/argus.rb', line 37

def purchase(money, payment, options={})
  post = PostData.new
  add_invoice(post, money, options)
  add_payment(post, payment)
  add_address(post, payment, options)
  add_customer_data(post, options)
  add_3ds_auth(post, options)
  add_stored_credential_options(post, options)

  commit('CCAUTHCAP', post)
end

#refund(money, authorization, options = {}) ⇒ Object



68
69
70
71
72
73
# File 'lib/active_merchant/billing/gateways/argus.rb', line 68

def refund(money, authorization, options={})
  post = PostData.new
  post[:li_value_1] = amount(money)
  post[:request_ref_po_id] = authorization
  commit('CCCREDIT', post)
end

#scrub(transcript) ⇒ Object



92
93
94
95
96
# File 'lib/active_merchant/billing/gateways/argus.rb', line 92

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

Returns:

  • (Boolean)


88
89
90
# File 'lib/active_merchant/billing/gateways/argus.rb', line 88

def supports_scrubbing?
  true
end

#verify(credit_card, options = {}) ⇒ Object



81
82
83
84
85
86
# File 'lib/active_merchant/billing/gateways/argus.rb', line 81

def verify(credit_card, options={})
  MultiResponse.run(:use_first_response) do |r|
    r.process { authorize(100, credit_card, options) }
    r.process(:ignore_result) { void(r.authorization, options) }
  end
end

#void(authorization, options = {}) ⇒ Object



75
76
77
78
79
# File 'lib/active_merchant/billing/gateways/argus.rb', line 75

def void(authorization, options={})
  post = PostData.new
  post[:request_ref_po_id] = authorization
  commit('CCREVERSE', post)
end