activemerchant 1.110.0 → 1.116.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +82 -0
- data/lib/active_merchant.rb +1 -1
- data/lib/active_merchant/billing/avs_result.rb +1 -1
- data/lib/active_merchant/billing/compatibility.rb +3 -3
- data/lib/active_merchant/billing/credit_card.rb +1 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +6 -6
- data/lib/active_merchant/billing/gateway.rb +1 -1
- data/lib/active_merchant/billing/gateways/adyen.rb +30 -15
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -17
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -2
- data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
- data/lib/active_merchant/billing/gateways/balanced.rb +5 -4
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +8 -8
- data/lib/active_merchant/billing/gateways/bank_frick.rb +8 -8
- data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
- data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
- data/lib/active_merchant/billing/gateways/blue_snap.rb +83 -23
- data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
- data/lib/active_merchant/billing/gateways/borgun.rb +12 -12
- data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
- data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +14 -17
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/cams.rb +8 -8
- data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
- data/lib/active_merchant/billing/gateways/cardknox.rb +8 -8
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
- data/lib/active_merchant/billing/gateways/cenpos.rb +11 -11
- data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +17 -20
- data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
- data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
- data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
- data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
- data/lib/active_merchant/billing/gateways/credorax.rb +15 -9
- data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
- data/lib/active_merchant/billing/gateways/culqi.rb +10 -10
- data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -37
- data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
- data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
- data/lib/active_merchant/billing/gateways/decidir.rb +10 -9
- data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
- data/lib/active_merchant/billing/gateways/digitzs.rb +6 -6
- data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -4
- data/lib/active_merchant/billing/gateways/elavon.rb +251 -232
- data/lib/active_merchant/billing/gateways/element.rb +12 -8
- data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
- data/lib/active_merchant/billing/gateways/eway.rb +3 -4
- data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +8 -8
- data/lib/active_merchant/billing/gateways/exact.rb +8 -9
- data/lib/active_merchant/billing/gateways/ezic.rb +8 -8
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -7
- data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +4 -4
- data/lib/active_merchant/billing/gateways/flo2cash.rb +9 -9
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +14 -8
- data/lib/active_merchant/billing/gateways/global_collect.rb +15 -10
- data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
- data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
- data/lib/active_merchant/billing/gateways/hps.rb +16 -13
- data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
- data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
- data/lib/active_merchant/billing/gateways/ipp.rb +7 -7
- data/lib/active_merchant/billing/gateways/iridium.rb +16 -17
- data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
- data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
- data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
- data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
- data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
- data/lib/active_merchant/billing/gateways/linkpoint.rb +5 -6
- data/lib/active_merchant/billing/gateways/litle.rb +12 -12
- data/lib/active_merchant/billing/gateways/mastercard.rb +12 -12
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +8 -8
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
- data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
- data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
- data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
- data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
- data/lib/active_merchant/billing/gateways/migs.rb +3 -4
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
- data/lib/active_merchant/billing/gateways/monei.rb +7 -7
- data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
- data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
- data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
- data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
- data/lib/active_merchant/billing/gateways/netbanx.rb +12 -10
- data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
- data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
- data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
- data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
- data/lib/active_merchant/billing/gateways/omise.rb +13 -13
- data/lib/active_merchant/billing/gateways/openpay.rb +4 -5
- data/lib/active_merchant/billing/gateways/opp.rb +12 -12
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -4
- data/lib/active_merchant/billing/gateways/orbital.rb +66 -64
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
- data/lib/active_merchant/billing/gateways/pagarme.rb +9 -9
- data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
- data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
- data/lib/active_merchant/billing/gateways/pay_junction.rb +4 -5
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
- data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
- data/lib/active_merchant/billing/gateways/payeezy.rb +12 -12
- data/lib/active_merchant/billing/gateways/payex.rb +11 -12
- data/lib/active_merchant/billing/gateways/payflow.rb +4 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
- data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
- data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
- data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
- data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
- data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
- data/lib/active_merchant/billing/gateways/payu_latam.rb +21 -11
- data/lib/active_merchant/billing/gateways/payway.rb +8 -9
- data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -3
- data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/psigate.rb +3 -4
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +4 -5
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +4 -3
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +9 -9
- data/lib/active_merchant/billing/gateways/realex.rb +2 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +7 -7
- data/lib/active_merchant/billing/gateways/s5.rb +7 -7
- data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -12
- data/lib/active_merchant/billing/gateways/sage.rb +3 -5
- data/lib/active_merchant/billing/gateways/sage_pay.rb +6 -7
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
- data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
- data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
- data/lib/active_merchant/billing/gateways/skip_jack.rb +3 -4
- data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
- data/lib/active_merchant/billing/gateways/stripe.rb +11 -11
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +9 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
- data/lib/active_merchant/billing/gateways/telr.rb +9 -9
- data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +14 -14
- data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +8 -9
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +36 -36
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -5
- data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
- data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
- data/lib/active_merchant/billing/gateways/worldpay.rb +12 -8
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +9 -9
- data/lib/active_merchant/billing/response.rb +1 -1
- data/lib/active_merchant/country.rb +1 -1
- data/lib/active_merchant/network_connection_retries.rb +2 -2
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/ssl_verify.rb +2 -2
- data/lib/support/ssl_version.rb +2 -2
- metadata +16 -2
@@ -22,12 +22,12 @@ module ActiveMerchant #:nodoc:
|
|
22
22
|
'store' => 'CC.RG'
|
23
23
|
}
|
24
24
|
|
25
|
-
def initialize(options={})
|
25
|
+
def initialize(options = {})
|
26
26
|
requires!(options, :sender, :channel, :login, :password)
|
27
27
|
super
|
28
28
|
end
|
29
29
|
|
30
|
-
def purchase(money, payment, options={})
|
30
|
+
def purchase(money, payment, options = {})
|
31
31
|
request = build_xml_request do |xml|
|
32
32
|
add_identification(xml, options)
|
33
33
|
add_payment(xml, money, 'sale', options)
|
@@ -39,7 +39,7 @@ module ActiveMerchant #:nodoc:
|
|
39
39
|
commit(request)
|
40
40
|
end
|
41
41
|
|
42
|
-
def refund(money, authorization, options={})
|
42
|
+
def refund(money, authorization, options = {})
|
43
43
|
request = build_xml_request do |xml|
|
44
44
|
add_identification(xml, options, authorization)
|
45
45
|
add_payment(xml, money, 'refund', options)
|
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
commit(request)
|
49
49
|
end
|
50
50
|
|
51
|
-
def authorize(money, payment, options={})
|
51
|
+
def authorize(money, payment, options = {})
|
52
52
|
request = build_xml_request do |xml|
|
53
53
|
add_identification(xml, options)
|
54
54
|
add_payment(xml, money, 'authonly', options)
|
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
|
|
60
60
|
commit(request)
|
61
61
|
end
|
62
62
|
|
63
|
-
def capture(money, authorization, options={})
|
63
|
+
def capture(money, authorization, options = {})
|
64
64
|
request = build_xml_request do |xml|
|
65
65
|
add_identification(xml, options, authorization)
|
66
66
|
add_payment(xml, money, 'capture', options)
|
@@ -69,7 +69,7 @@ module ActiveMerchant #:nodoc:
|
|
69
69
|
commit(request)
|
70
70
|
end
|
71
71
|
|
72
|
-
def void(authorization, options={})
|
72
|
+
def void(authorization, options = {})
|
73
73
|
request = build_xml_request do |xml|
|
74
74
|
add_identification(xml, options, authorization)
|
75
75
|
add_payment(xml, nil, 'void', options)
|
@@ -89,7 +89,7 @@ module ActiveMerchant #:nodoc:
|
|
89
89
|
commit(request)
|
90
90
|
end
|
91
91
|
|
92
|
-
def verify(credit_card, options={})
|
92
|
+
def verify(credit_card, options = {})
|
93
93
|
MultiResponse.run(:use_first_response) do |r|
|
94
94
|
r.process { authorize(100, credit_card, options) }
|
95
95
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -15,12 +15,12 @@ module ActiveMerchant #:nodoc:
|
|
15
15
|
|
16
16
|
VERSION = '4.1.0'
|
17
17
|
|
18
|
-
def initialize(options={})
|
18
|
+
def initialize(options = {})
|
19
19
|
requires!(options, :client_login_id, :client_password)
|
20
20
|
super
|
21
21
|
end
|
22
22
|
|
23
|
-
def purchase(money, payment, options={})
|
23
|
+
def purchase(money, payment, options = {})
|
24
24
|
post = {}
|
25
25
|
post[:sg_APIType] = 1 if options[:three_d_secure]
|
26
26
|
trans_type = options[:three_d_secure] ? 'Sale3D' : 'Sale'
|
@@ -31,7 +31,7 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
commit(post)
|
32
32
|
end
|
33
33
|
|
34
|
-
def authorize(money, payment, options={})
|
34
|
+
def authorize(money, payment, options = {})
|
35
35
|
post = {}
|
36
36
|
add_transaction_data('Auth', post, money, options)
|
37
37
|
add_payment(post, payment, options)
|
@@ -40,10 +40,10 @@ module ActiveMerchant #:nodoc:
|
|
40
40
|
commit(post)
|
41
41
|
end
|
42
42
|
|
43
|
-
def capture(money, authorization, options={})
|
43
|
+
def capture(money, authorization, options = {})
|
44
44
|
post = {}
|
45
45
|
auth, transaction_id, token, exp_month, exp_year, _, original_currency = authorization.split('|')
|
46
|
-
add_transaction_data('Settle', post, money, options.merge!({currency: original_currency}))
|
46
|
+
add_transaction_data('Settle', post, money, options.merge!({ currency: original_currency }))
|
47
47
|
post[:sg_AuthCode] = auth
|
48
48
|
post[:sg_TransactionID] = transaction_id
|
49
49
|
post[:sg_CCToken] = token
|
@@ -53,10 +53,10 @@ module ActiveMerchant #:nodoc:
|
|
53
53
|
commit(post)
|
54
54
|
end
|
55
55
|
|
56
|
-
def refund(money, authorization, options={})
|
56
|
+
def refund(money, authorization, options = {})
|
57
57
|
post = {}
|
58
58
|
auth, transaction_id, token, exp_month, exp_year, _, original_currency = authorization.split('|')
|
59
|
-
add_transaction_data('Credit', post, money, options.merge!({currency: original_currency}))
|
59
|
+
add_transaction_data('Credit', post, money, options.merge!({ currency: original_currency }))
|
60
60
|
post[:sg_CreditType] = 2
|
61
61
|
post[:sg_AuthCode] = auth
|
62
62
|
post[:sg_TransactionID] = transaction_id
|
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
|
|
67
67
|
commit(post)
|
68
68
|
end
|
69
69
|
|
70
|
-
def credit(money, payment, options={})
|
70
|
+
def credit(money, payment, options = {})
|
71
71
|
post = {}
|
72
72
|
add_payment(post, payment, options)
|
73
73
|
add_transaction_data('Credit', post, money, options)
|
@@ -76,10 +76,10 @@ module ActiveMerchant #:nodoc:
|
|
76
76
|
commit(post)
|
77
77
|
end
|
78
78
|
|
79
|
-
def void(authorization, options={})
|
79
|
+
def void(authorization, options = {})
|
80
80
|
post = {}
|
81
81
|
auth, transaction_id, token, exp_month, exp_year, original_amount, original_currency = authorization.split('|')
|
82
|
-
add_transaction_data('Void', post, (original_amount.to_f * 100), options.merge!({currency: original_currency}))
|
82
|
+
add_transaction_data('Void', post, (original_amount.to_f * 100), options.merge!({ currency: original_currency }))
|
83
83
|
post[:sg_CreditType] = 2
|
84
84
|
post[:sg_AuthCode] = auth
|
85
85
|
post[:sg_TransactionID] = transaction_id
|
@@ -90,7 +90,7 @@ module ActiveMerchant #:nodoc:
|
|
90
90
|
commit(post)
|
91
91
|
end
|
92
92
|
|
93
|
-
def verify(credit_card, options={})
|
93
|
+
def verify(credit_card, options = {})
|
94
94
|
MultiResponse.run(:use_first_response) do |r|
|
95
95
|
r.process { authorize(100, credit_card, options) }
|
96
96
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -130,7 +130,7 @@ module ActiveMerchant #:nodoc:
|
|
130
130
|
post[:sg_MerchantName] = options[:merchant_name] if options[:merchant_name]
|
131
131
|
end
|
132
132
|
|
133
|
-
def add_payment(post, payment, options={})
|
133
|
+
def add_payment(post, payment, options = {})
|
134
134
|
post[:sg_NameOnCard] = payment.name
|
135
135
|
post[:sg_CardNumber] = payment.number
|
136
136
|
post[:sg_ExpMonth] = format(payment.month, :two_digits)
|
@@ -77,7 +77,7 @@ module ActiveMerchant #:nodoc:
|
|
77
77
|
commit(:credit, post, source)
|
78
78
|
end
|
79
79
|
|
80
|
-
def refund(money, reference, options={})
|
80
|
+
def refund(money, reference, options = {})
|
81
81
|
post = {}
|
82
82
|
add_reference(post, reference)
|
83
83
|
add_transaction_data(post, money, options)
|
@@ -264,8 +264,7 @@ module ActiveMerchant #:nodoc:
|
|
264
264
|
test: test?,
|
265
265
|
authorization: authorization_from(response, source),
|
266
266
|
avs_result: { code: response[:avs_result] },
|
267
|
-
cvv_result: response[:cvv_result]
|
268
|
-
)
|
267
|
+
cvv_result: response[:cvv_result])
|
269
268
|
end
|
270
269
|
|
271
270
|
def url(params, source)
|
@@ -382,8 +381,7 @@ module ActiveMerchant #:nodoc:
|
|
382
381
|
end
|
383
382
|
|
384
383
|
Response.new(success, message, response,
|
385
|
-
authorization: response[:guid]
|
386
|
-
)
|
384
|
+
authorization: response[:guid])
|
387
385
|
end
|
388
386
|
|
389
387
|
ENVELOPE_NAMESPACES = {
|
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
|
|
162
162
|
commit(:unstore, post)
|
163
163
|
end
|
164
164
|
|
165
|
-
def verify(credit_card, options={})
|
165
|
+
def verify(credit_card, options = {})
|
166
166
|
MultiResponse.run(:use_first_response) do |r|
|
167
167
|
r.process { authorize(100, credit_card, options) }
|
168
168
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -248,7 +248,7 @@ module ActiveMerchant #:nodoc:
|
|
248
248
|
add_pair(post, :BillingAddress1, truncate(billing_address[:address1], 100))
|
249
249
|
add_pair(post, :BillingAddress2, truncate(billing_address[:address2], 100))
|
250
250
|
add_pair(post, :BillingCity, truncate(billing_address[:city], 40))
|
251
|
-
add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if
|
251
|
+
add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if usa?(billing_address[:country])
|
252
252
|
add_pair(post, :BillingCountry, truncate(billing_address[:country], 2))
|
253
253
|
add_pair(post, :BillingPhone, sanitize_phone(billing_address[:phone]))
|
254
254
|
add_pair(post, :BillingPostCode, truncate(billing_address[:zip], 10))
|
@@ -261,7 +261,7 @@ module ActiveMerchant #:nodoc:
|
|
261
261
|
add_pair(post, :DeliveryAddress1, truncate(shipping_address[:address1], 100))
|
262
262
|
add_pair(post, :DeliveryAddress2, truncate(shipping_address[:address2], 100))
|
263
263
|
add_pair(post, :DeliveryCity, truncate(shipping_address[:city], 40))
|
264
|
-
add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if
|
264
|
+
add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if usa?(shipping_address[:country])
|
265
265
|
add_pair(post, :DeliveryCountry, truncate(shipping_address[:country], 2))
|
266
266
|
add_pair(post, :DeliveryPhone, sanitize_phone(shipping_address[:phone]))
|
267
267
|
add_pair(post, :DeliveryPostCode, truncate(shipping_address[:zip], 10))
|
@@ -317,7 +317,7 @@ module ActiveMerchant #:nodoc:
|
|
317
317
|
truncate(cleansed, 20)
|
318
318
|
end
|
319
319
|
|
320
|
-
def
|
320
|
+
def usa?(country)
|
321
321
|
truncate(country, 2) == 'US'
|
322
322
|
end
|
323
323
|
|
@@ -351,10 +351,9 @@ module ActiveMerchant #:nodoc:
|
|
351
351
|
authorization: authorization_from(response, parameters, action),
|
352
352
|
avs_result: {
|
353
353
|
street_match: AVS_CODE[response['AddressResult']],
|
354
|
-
postal_match: AVS_CODE[response['PostCodeResult']]
|
354
|
+
postal_match: AVS_CODE[response['PostCodeResult']]
|
355
355
|
},
|
356
|
-
cvv_result: CVV_CODE[response['CV2Result']]
|
357
|
-
)
|
356
|
+
cvv_result: CVV_CODE[response['CV2Result']])
|
358
357
|
end
|
359
358
|
|
360
359
|
def authorization_from(response, params, action)
|
@@ -122,8 +122,7 @@ module ActiveMerchant #:nodoc:
|
|
122
122
|
response = parse(ssl_post(self.live_url, parameters.to_post_data) || '')
|
123
123
|
Response.new(successful?(response), message_from(response), response,
|
124
124
|
test: test?,
|
125
|
-
authorization: response['refcode']
|
126
|
-
)
|
125
|
+
authorization: response['refcode'])
|
127
126
|
end
|
128
127
|
|
129
128
|
def successful?(response)
|
@@ -83,8 +83,7 @@ module ActiveMerchant #:nodoc:
|
|
83
83
|
test: test?,
|
84
84
|
authorization: build_authorization(response),
|
85
85
|
avs_result: { code: response[:avs_result_code] },
|
86
|
-
cvv_result: response[:card_code_response_code]
|
87
|
-
)
|
86
|
+
cvv_result: response[:card_code_response_code])
|
88
87
|
end
|
89
88
|
|
90
89
|
def build_request(request)
|
@@ -61,8 +61,7 @@ module ActiveMerchant #:nodoc:
|
|
61
61
|
authorization: response[:transaction_id],
|
62
62
|
fraud_review: fraud_review?(response),
|
63
63
|
avs_result: { code: response[:avs_result_code] },
|
64
|
-
cvv_result: response[:card_code]
|
65
|
-
)
|
64
|
+
cvv_result: response[:card_code])
|
66
65
|
end
|
67
66
|
|
68
67
|
def success?(response)
|
@@ -115,7 +114,7 @@ module ActiveMerchant #:nodoc:
|
|
115
114
|
post[:description] = options[:description]
|
116
115
|
end
|
117
116
|
|
118
|
-
def add_creditcard(post, creditcard, options={})
|
117
|
+
def add_creditcard(post, creditcard, options = {})
|
119
118
|
post[:card_num] = creditcard.number
|
120
119
|
post[:card_code] = creditcard.verification_value if creditcard.verification_value?
|
121
120
|
post[:exp_date] = expdate(creditcard)
|
@@ -123,7 +122,7 @@ module ActiveMerchant #:nodoc:
|
|
123
122
|
post[:last_name] = creditcard.last_name
|
124
123
|
end
|
125
124
|
|
126
|
-
def add_payment_source(params, source, options={})
|
125
|
+
def add_payment_source(params, source, options = {})
|
127
126
|
add_creditcard(params, source, options)
|
128
127
|
end
|
129
128
|
|
@@ -185,8 +185,7 @@ module ActiveMerchant #:nodoc:
|
|
185
185
|
|
186
186
|
Response.new(success?(response), message_from(response), response,
|
187
187
|
test: test?,
|
188
|
-
authorization: authorization_from(response)
|
189
|
-
)
|
188
|
+
authorization: authorization_from(response))
|
190
189
|
end
|
191
190
|
|
192
191
|
def build_periodic_item(action, money, credit_card, options)
|
@@ -242,8 +241,7 @@ module ActiveMerchant #:nodoc:
|
|
242
241
|
|
243
242
|
Response.new(success?(response), message_from(response), response,
|
244
243
|
test: test?,
|
245
|
-
authorization: authorization_from(response)
|
246
|
-
)
|
244
|
+
authorization: authorization_from(response))
|
247
245
|
end
|
248
246
|
|
249
247
|
def success?(response)
|
@@ -86,8 +86,7 @@ module ActiveMerchant #:nodoc:
|
|
86
86
|
|
87
87
|
Response.new(response[:result_code] == 1, message_from(response), response,
|
88
88
|
test: test?,
|
89
|
-
authorization: response[:merchant_transaction_reference]
|
90
|
-
)
|
89
|
+
authorization: response[:merchant_transaction_reference])
|
91
90
|
end
|
92
91
|
|
93
92
|
def message_from(result)
|
@@ -31,17 +31,17 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
'expired_token' => STANDARD_ERROR_CODE[:card_declined]
|
32
32
|
}
|
33
33
|
|
34
|
-
def initialize(options={})
|
34
|
+
def initialize(options = {})
|
35
35
|
requires!(options, :secret_key)
|
36
36
|
super
|
37
37
|
end
|
38
38
|
|
39
|
-
def purchase(money, payment, options={})
|
39
|
+
def purchase(money, payment, options = {})
|
40
40
|
post = create_post_for_auth_or_purchase(money, payment, options)
|
41
41
|
commit('charges', post, options)
|
42
42
|
end
|
43
43
|
|
44
|
-
def authorize(money, payment, options={})
|
44
|
+
def authorize(money, payment, options = {})
|
45
45
|
post = create_post_for_auth_or_purchase(money, payment, options)
|
46
46
|
post[:captured] = 'false'
|
47
47
|
commit('charges', post, options)
|
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
|
|
63
63
|
commit("charges/#{CGI.escape(authorization)}/refund", {}, options)
|
64
64
|
end
|
65
65
|
|
66
|
-
def verify(credit_card, options={})
|
66
|
+
def verify(credit_card, options = {})
|
67
67
|
MultiResponse.run(:use_first_response) do |r|
|
68
68
|
r.process { authorize(100, credit_card, options) }
|
69
69
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -190,8 +190,7 @@ module ActiveMerchant #:nodoc:
|
|
190
190
|
response,
|
191
191
|
test: test?,
|
192
192
|
authorization: (success ? response['id'] : response['error']['charge']),
|
193
|
-
error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['error']['code']])
|
194
|
-
)
|
193
|
+
error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['error']['code']]))
|
195
194
|
end
|
196
195
|
|
197
196
|
def headers(options = {})
|
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
'W' => '9-digit zip/postal code matches billing information, street address does not',
|
52
52
|
'X' => 'Street address and 9-digit zip/postal code matches billing information',
|
53
53
|
'Y' => 'Street address and 5-digit zip/postal code matches billing information',
|
54
|
-
'Z' => '5-digit zip/postal code matches billing information, street address does not'
|
54
|
+
'Z' => '5-digit zip/postal code matches billing information, street address does not'
|
55
55
|
}
|
56
56
|
|
57
57
|
CHANGE_STATUS_ERROR_MESSAGES = {
|
@@ -213,7 +213,7 @@ module ActiveMerchant #:nodoc:
|
|
213
213
|
#
|
214
214
|
# * <tt>:force_settlement</tt> -- Force the settlement to occur as soon as possible. This option is not supported by other gateways. See the SkipJack API reference for more details
|
215
215
|
def capture(money, authorization, options = {})
|
216
|
-
post = {
|
216
|
+
post = {}
|
217
217
|
add_status_action(post, 'SETTLE')
|
218
218
|
add_forced_settlement(post, options)
|
219
219
|
add_transaction_id(post, authorization)
|
@@ -267,8 +267,7 @@ module ActiveMerchant #:nodoc:
|
|
267
267
|
test: test?,
|
268
268
|
authorization: response[:szTransactionFileName] || parameters[:szTransactionId],
|
269
269
|
avs_result: { code: response[:szAVSResponseCode] },
|
270
|
-
cvv_result: response[:szCVV2ResponseCode]
|
271
|
-
)
|
270
|
+
cvv_result: response[:szCVV2ResponseCode])
|
272
271
|
end
|
273
272
|
|
274
273
|
def url_for(action)
|
@@ -123,7 +123,7 @@ module ActiveMerchant #:nodoc:
|
|
123
123
|
commit(nil, nil, post)
|
124
124
|
end
|
125
125
|
|
126
|
-
|
126
|
+
alias unstore delete
|
127
127
|
|
128
128
|
private
|
129
129
|
|
@@ -133,9 +133,9 @@ module ActiveMerchant #:nodoc:
|
|
133
133
|
post[:ipaddress] = options[:ip] if options.has_key? :ip
|
134
134
|
end
|
135
135
|
|
136
|
-
def add_address(post, address, prefix='')
|
136
|
+
def add_address(post, address, prefix = '')
|
137
137
|
prefix += '_' unless prefix.blank?
|
138
|
-
unless address.blank?
|
138
|
+
unless address.blank? || address.values.blank?
|
139
139
|
post[prefix + 'address1'] = address[:address1].to_s
|
140
140
|
post[prefix + 'address2'] = address[:address2].to_s unless address[:address2].blank?
|
141
141
|
post[prefix + 'company'] = address[:company].to_s
|
@@ -163,7 +163,7 @@ module ActiveMerchant #:nodoc:
|
|
163
163
|
post[:orderid] = options[:order_id].to_s.gsub(/[^\w.]/, '')
|
164
164
|
end
|
165
165
|
|
166
|
-
def add_payment_source(params, source, options={})
|
166
|
+
def add_payment_source(params, source, options = {})
|
167
167
|
case determine_funding_source(source)
|
168
168
|
when :vault then add_customer_vault_id(params, source)
|
169
169
|
when :credit_card then add_creditcard(params, source, options)
|
@@ -230,8 +230,7 @@ module ActiveMerchant #:nodoc:
|
|
230
230
|
authorization: (response['transactionid'] || response['customer_vault_id']),
|
231
231
|
test: test?,
|
232
232
|
cvv_result: response['cvvresponse'],
|
233
|
-
avs_result: { code: response['avsresponse'] }
|
234
|
-
)
|
233
|
+
avs_result: { code: response['avsresponse'] })
|
235
234
|
end
|
236
235
|
|
237
236
|
def expdate(creditcard)
|
@@ -39,11 +39,11 @@ module ActiveMerchant #:nodoc:
|
|
39
39
|
commit('CaptureTransaction', do_capture(money, authorization, options), options)
|
40
40
|
end
|
41
41
|
|
42
|
-
def refund(money, authorization, options={})
|
42
|
+
def refund(money, authorization, options = {})
|
43
43
|
commit('RefundTransaction', do_refund(money, authorization, options), options)
|
44
44
|
end
|
45
45
|
|
46
|
-
def void(authorization, options={})
|
46
|
+
def void(authorization, options = {})
|
47
47
|
commit('CancelTransaction', do_void(authorization, options), options)
|
48
48
|
end
|
49
49
|
|
@@ -139,7 +139,7 @@ module ActiveMerchant #:nodoc:
|
|
139
139
|
soap.tag!('cardExpireYear', card.year.to_s)
|
140
140
|
end
|
141
141
|
|
142
|
-
def fill_order_info(soap, money, options, skip_currency=false)
|
142
|
+
def fill_order_info(soap, money, options, skip_currency = false)
|
143
143
|
soap.tag!('orderID', options[:order_id].to_s)
|
144
144
|
soap.tag!('orderDescription', "Order #{options[:order_id]}")
|
145
145
|
soap.tag!('amount', amount(money).to_s)
|
@@ -157,8 +157,8 @@ module ActiveMerchant #:nodoc:
|
|
157
157
|
end
|
158
158
|
|
159
159
|
def commit(soap_action, soap, options)
|
160
|
-
headers = {'SOAPAction' => "\"urn:Interface##{soap_action}\"",
|
161
|
-
'Content-Type' => 'text/xml; charset=utf-8'}
|
160
|
+
headers = { 'SOAPAction' => "\"urn:Interface##{soap_action}\"",
|
161
|
+
'Content-Type' => 'text/xml; charset=utf-8' }
|
162
162
|
response_string = ssl_post(test? ? self.test_url : self.live_url, soap, headers)
|
163
163
|
response = parse(response_string, soap_action)
|
164
164
|
return Response.new(response['errorcode'] == '000',
|
@@ -179,9 +179,9 @@ module ActiveMerchant #:nodoc:
|
|
179
179
|
'xmlns:types' => 'urn:Interface/encodedTypes',
|
180
180
|
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'
|
181
181
|
}) do
|
182
|
-
retval.tag!('soap:Body', {'soap:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'}) do
|
182
|
+
retval.tag!('soap:Body', { 'soap:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' }) do
|
183
183
|
retval.tag!("tns:#{request}") do
|
184
|
-
retval.tag!("#{request}Request", {'xsi:type' => "tns:#{request}Request"}) do
|
184
|
+
retval.tag!("#{request}Request", { 'xsi:type' => "tns:#{request}Request" }) do
|
185
185
|
yield retval
|
186
186
|
end
|
187
187
|
end
|