activemerchant 1.113.0 → 1.119.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +114 -0
- data/README.md +1 -1
- 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 +3 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +72 -13
- data/lib/active_merchant/billing/gateways/adyen.rb +24 -14
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +44 -12
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -1
- data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
- data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
- data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
- 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 +37 -12
- data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
- data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
- 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 +13 -10
- 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 +7 -7
- 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 +10 -10
- 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 +26 -15
- data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
- data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
- data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -36
- 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 +31 -10
- data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
- data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
- data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
- data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
- data/lib/active_merchant/billing/gateways/elavon.rb +286 -225
- data/lib/active_merchant/billing/gateways/element.rb +8 -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 +19 -6
- data/lib/active_merchant/billing/gateways/exact.rb +8 -9
- data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- 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 +21 -10
- data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
- 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 +35 -16
- data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
- data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
- data/lib/active_merchant/billing/gateways/hps.rb +17 -8
- 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 +5 -5
- data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
- 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 +4 -5
- data/lib/active_merchant/billing/gateways/litle.rb +31 -15
- data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
- 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 +19 -8
- 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 +3 -4
- data/lib/active_merchant/billing/gateways/opp.rb +9 -9
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
- data/lib/active_merchant/billing/gateways/orbital.rb +196 -85
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
- data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
- 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 +2 -3
- 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 +32 -14
- data/lib/active_merchant/billing/gateways/payex.rb +6 -7
- data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +8 -4
- data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
- data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
- data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
- 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 +17 -10
- data/lib/active_merchant/billing/gateways/payway.rb +8 -9
- data/lib/active_merchant/billing/gateways/pin.rb +11 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
- data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
- 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 +8 -8
- data/lib/active_merchant/billing/gateways/realex.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +86 -5
- data/lib/active_merchant/billing/gateways/s5.rb +7 -7
- data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
- data/lib/active_merchant/billing/gateways/sage.rb +3 -5
- data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
- 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 +2 -3
- 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 +10 -10
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
- data/lib/active_merchant/billing/gateways/telr.rb +8 -8
- data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
- data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
- 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 +19 -11
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
- data/lib/active_merchant/billing/response.rb +3 -2
- 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 +2 -2
@@ -210,8 +210,8 @@ module ActiveMerchant #:nodoc:
|
|
210
210
|
xml.tag! 'TransactionID', transaction_id.nil? ? generate_unique_id.slice(0, 18) : transaction_id
|
211
211
|
xml.tag! 'Origin', options[:origin] || 'INTERNET'
|
212
212
|
xml.tag! 'IndustryInfo', 'Type' => options[:industry_info] || 'ECOMMERCE'
|
213
|
-
xml.tag! 'Application', (options[:application] || 'n/a'), {'Version' => options[:application_version] || '1.0'}
|
214
|
-
xml.tag! 'Device', (options[:device] || 'n/a'), {'Version' => options[:device_version] || '1.0'}
|
213
|
+
xml.tag! 'Application', (options[:application] || 'n/a'), { 'Version' => options[:application_version] || '1.0' }
|
214
|
+
xml.tag! 'Device', (options[:device] || 'n/a'), { 'Version' => options[:device_version] || '1.0' }
|
215
215
|
xml.tag! 'Library', 'VirtPOS SDK', 'Version' => '1.5'
|
216
216
|
xml.tag! 'Gateway', 'JetPay'
|
217
217
|
xml.tag! 'DeveloperID', options[:developer_id] || 'n/a'
|
@@ -302,8 +302,7 @@ module ActiveMerchant #:nodoc:
|
|
302
302
|
authorization: authorization_from(response, money, token),
|
303
303
|
avs_result: AVSResult.new(code: response[:avs]),
|
304
304
|
cvv_result: CVVResult.new(response[:cvv2]),
|
305
|
-
error_code: success ? nil : error_code_from(response)
|
306
|
-
)
|
305
|
+
error_code: success ? nil : error_code_from(response))
|
307
306
|
end
|
308
307
|
|
309
308
|
def url
|
@@ -406,7 +405,7 @@ module ActiveMerchant #:nodoc:
|
|
406
405
|
def add_invoice_data(xml, options)
|
407
406
|
xml.tag! 'OrderNumber', options[:order_id] if options[:order_id]
|
408
407
|
if tax_amount = options[:tax_amount]
|
409
|
-
xml.tag! 'TaxAmount', tax_amount, {'ExemptInd' => options[:tax_exempt] || 'false'}
|
408
|
+
xml.tag! 'TaxAmount', tax_amount, { 'ExemptInd' => options[:tax_exempt] || 'false' }
|
410
409
|
end
|
411
410
|
end
|
412
411
|
|
@@ -12,26 +12,26 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
self.money_format = :dollars
|
13
13
|
self.supported_cardtypes = %i[visa master american_express discover diners_club alia]
|
14
14
|
|
15
|
-
def initialize(options={})
|
15
|
+
def initialize(options = {})
|
16
16
|
requires!(options, :public_merchant_id, :private_merchant_id)
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
20
|
-
def purchase(amount, payment_method, options={})
|
20
|
+
def purchase(amount, payment_method, options = {})
|
21
21
|
MultiResponse.run() do |r|
|
22
22
|
r.process { tokenize(amount, payment_method, options) }
|
23
23
|
r.process { charge(amount, r.authorization, options) }
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def authorize(amount, payment_method, options={})
|
27
|
+
def authorize(amount, payment_method, options = {})
|
28
28
|
MultiResponse.run() do |r|
|
29
29
|
r.process { tokenize(amount, payment_method, options) }
|
30
30
|
r.process { preauthorize(amount, r.authorization, options) }
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def capture(amount, authorization, options={})
|
34
|
+
def capture(amount, authorization, options = {})
|
35
35
|
action = 'capture'
|
36
36
|
|
37
37
|
post = {}
|
@@ -41,7 +41,7 @@ module ActiveMerchant #:nodoc:
|
|
41
41
|
commit(action, post)
|
42
42
|
end
|
43
43
|
|
44
|
-
def refund(amount, authorization, options={})
|
44
|
+
def refund(amount, authorization, options = {})
|
45
45
|
action = 'refund'
|
46
46
|
|
47
47
|
post = {}
|
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
|
|
50
50
|
commit(action, post)
|
51
51
|
end
|
52
52
|
|
53
|
-
def void(authorization, options={})
|
53
|
+
def void(authorization, options = {})
|
54
54
|
action = 'void'
|
55
55
|
|
56
56
|
post = {}
|
@@ -51,12 +51,12 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
'jcb' => 'JC'
|
52
52
|
}
|
53
53
|
|
54
|
-
def initialize(options={})
|
54
|
+
def initialize(options = {})
|
55
55
|
requires!(options, :account_number, :configuration_id, :secret)
|
56
56
|
super
|
57
57
|
end
|
58
58
|
|
59
|
-
def purchase(amount, payment_method, options={})
|
59
|
+
def purchase(amount, payment_method, options = {})
|
60
60
|
if payment_method.is_a?(String)
|
61
61
|
auth_or_sale('sale', payment_method, amount, nil, options)
|
62
62
|
else
|
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def authorize(amount, payment_method, options={})
|
71
|
+
def authorize(amount, payment_method, options = {})
|
72
72
|
if payment_method.is_a?(String)
|
73
73
|
auth_or_sale('auth', payment_method, amount, nil, options)
|
74
74
|
else
|
@@ -80,7 +80,7 @@ module ActiveMerchant #:nodoc:
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
def capture(amount, authorization, options={})
|
83
|
+
def capture(amount, authorization, options = {})
|
84
84
|
post = {}
|
85
85
|
post[:method] = 'deposit'
|
86
86
|
add_request_id(post)
|
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
|
|
96
96
|
commit('v1/', post)
|
97
97
|
end
|
98
98
|
|
99
|
-
def void(authorization, options={})
|
99
|
+
def void(authorization, options = {})
|
100
100
|
method, pgwTID = split_authorization(authorization)
|
101
101
|
case method
|
102
102
|
when 'auth'
|
@@ -109,7 +109,7 @@ module ActiveMerchant #:nodoc:
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
def credit(amount, payment_method, options={})
|
112
|
+
def credit(amount, payment_method, options = {})
|
113
113
|
if payment_method.is_a?(String)
|
114
114
|
refundWithCard(payment_method, amount, nil, options)
|
115
115
|
else
|
@@ -121,7 +121,7 @@ module ActiveMerchant #:nodoc:
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
def verify(payment_method, options={}, action=nil)
|
124
|
+
def verify(payment_method, options = {}, action = nil)
|
125
125
|
if payment_method.is_a?(String)
|
126
126
|
verifyOnly(action, payment_method, nil, options)
|
127
127
|
else
|
@@ -133,7 +133,7 @@ module ActiveMerchant #:nodoc:
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
def store(payment_method, options={})
|
136
|
+
def store(payment_method, options = {})
|
137
137
|
verify(payment_method, options, 'store')
|
138
138
|
end
|
139
139
|
|
@@ -201,7 +201,7 @@ module ActiveMerchant #:nodoc:
|
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
|
-
def get_session(options={})
|
204
|
+
def get_session(options = {})
|
205
205
|
post = {}
|
206
206
|
post[:method] = 'getSession'
|
207
207
|
add_request_id(post)
|
@@ -213,7 +213,7 @@ module ActiveMerchant #:nodoc:
|
|
213
213
|
commit('session', post)
|
214
214
|
end
|
215
215
|
|
216
|
-
def get_token(authorization, payment_method, options={})
|
216
|
+
def get_token(authorization, payment_method, options = {})
|
217
217
|
post = {}
|
218
218
|
post[:method] = 'tokenize'
|
219
219
|
add_request_id(post)
|
@@ -226,7 +226,7 @@ module ActiveMerchant #:nodoc:
|
|
226
226
|
commit('token', post)
|
227
227
|
end
|
228
228
|
|
229
|
-
def auth_or_sale(method, authorization, amount, credit_card, options={})
|
229
|
+
def auth_or_sale(method, authorization, amount, credit_card, options = {})
|
230
230
|
post = {}
|
231
231
|
post[:method] = method
|
232
232
|
add_request_id(post)
|
@@ -246,7 +246,7 @@ module ActiveMerchant #:nodoc:
|
|
246
246
|
commit('v1/', post)
|
247
247
|
end
|
248
248
|
|
249
|
-
def verifyOnly(action, authorization, credit_card, options={})
|
249
|
+
def verifyOnly(action, authorization, credit_card, options = {})
|
250
250
|
post = {}
|
251
251
|
post[:method] = 'verifyOnly'
|
252
252
|
add_request_id(post)
|
@@ -267,7 +267,7 @@ module ActiveMerchant #:nodoc:
|
|
267
267
|
commit('v1/', post)
|
268
268
|
end
|
269
269
|
|
270
|
-
def refundWithCard(authorization, amount, credit_card, options={})
|
270
|
+
def refundWithCard(authorization, amount, credit_card, options = {})
|
271
271
|
post = {}
|
272
272
|
post[:method] = 'refundWithCard'
|
273
273
|
add_request_id(post)
|
@@ -286,7 +286,7 @@ module ActiveMerchant #:nodoc:
|
|
286
286
|
commit('v1/', post)
|
287
287
|
end
|
288
288
|
|
289
|
-
def reverse_or_void(method, pgwTID, options={})
|
289
|
+
def reverse_or_void(method, pgwTID, options = {})
|
290
290
|
post = {}
|
291
291
|
post[:method] = method
|
292
292
|
add_request_id(post)
|
@@ -166,7 +166,7 @@ module ActiveMerchant #:nodoc:
|
|
166
166
|
# :threshold Tells how many times to retry the transaction (if it fails) before contacting the merchant.
|
167
167
|
# :comments Uh... comments
|
168
168
|
#
|
169
|
-
def recurring(money, creditcard, options={})
|
169
|
+
def recurring(money, creditcard, options = {})
|
170
170
|
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
171
171
|
|
172
172
|
requires!(options, %i[periodicity bimonthly monthly biweekly weekly yearly daily], :installments, :order_id)
|
@@ -184,7 +184,7 @@ module ActiveMerchant #:nodoc:
|
|
184
184
|
end
|
185
185
|
|
186
186
|
# Buy the thing
|
187
|
-
def purchase(money, creditcard, options={})
|
187
|
+
def purchase(money, creditcard, options = {})
|
188
188
|
requires!(options, :order_id)
|
189
189
|
options.update(
|
190
190
|
ordertype: 'SALE'
|
@@ -267,8 +267,7 @@ module ActiveMerchant #:nodoc:
|
|
267
267
|
test: test?,
|
268
268
|
authorization: response[:ordernum],
|
269
269
|
avs_result: { code: response[:avs].to_s[2, 1] },
|
270
|
-
cvv_result: response[:avs].to_s[3, 1]
|
271
|
-
)
|
270
|
+
cvv_result: response[:avs].to_s[3, 1])
|
272
271
|
end
|
273
272
|
|
274
273
|
def successful?(response)
|
@@ -431,7 +430,7 @@ module ActiveMerchant #:nodoc:
|
|
431
430
|
# <r_approved>APPROVED</r_approved>
|
432
431
|
# <r_avs></r_avs>
|
433
432
|
|
434
|
-
response = {message: 'Global Error Receipt', complete: false}
|
433
|
+
response = { message: 'Global Error Receipt', complete: false }
|
435
434
|
|
436
435
|
xml = REXML::Document.new("<response>#{xml}</response>")
|
437
436
|
xml.root&.elements&.each do |node|
|
@@ -5,7 +5,10 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
class LitleGateway < Gateway
|
6
6
|
SCHEMA_VERSION = '9.14'
|
7
7
|
|
8
|
+
class_attribute :postlive_url
|
9
|
+
|
8
10
|
self.test_url = 'https://www.testvantivcnp.com/sandbox/communicator/online'
|
11
|
+
self.postlive_url = 'https://payments.vantivpostlive.com/vap/communicator/online'
|
9
12
|
self.live_url = 'https://payments.vantivcnp.com/vap/communicator/online'
|
10
13
|
|
11
14
|
self.supported_countries = ['US']
|
@@ -15,12 +18,12 @@ module ActiveMerchant #:nodoc:
|
|
15
18
|
self.homepage_url = 'http://www.vantiv.com/'
|
16
19
|
self.display_name = 'Vantiv eCommerce'
|
17
20
|
|
18
|
-
def initialize(options={})
|
21
|
+
def initialize(options = {})
|
19
22
|
requires!(options, :login, :password, :merchant_id)
|
20
23
|
super
|
21
24
|
end
|
22
25
|
|
23
|
-
def purchase(money, payment_method, options={})
|
26
|
+
def purchase(money, payment_method, options = {})
|
24
27
|
request = build_xml_request do |doc|
|
25
28
|
add_authentication(doc)
|
26
29
|
if check?(payment_method)
|
@@ -36,7 +39,7 @@ module ActiveMerchant #:nodoc:
|
|
36
39
|
check?(payment_method) ? commit(:echeckSales, request, money) : commit(:sale, request, money)
|
37
40
|
end
|
38
41
|
|
39
|
-
def authorize(money, payment_method, options={})
|
42
|
+
def authorize(money, payment_method, options = {})
|
40
43
|
request = build_xml_request do |doc|
|
41
44
|
add_authentication(doc)
|
42
45
|
if check?(payment_method)
|
@@ -52,7 +55,7 @@ module ActiveMerchant #:nodoc:
|
|
52
55
|
check?(payment_method) ? commit(:echeckVerification, request, money) : commit(:authorization, request, money)
|
53
56
|
end
|
54
57
|
|
55
|
-
def capture(money, authorization, options={})
|
58
|
+
def capture(money, authorization, options = {})
|
56
59
|
transaction_id, = split_authorization(authorization)
|
57
60
|
|
58
61
|
request = build_xml_request do |doc|
|
@@ -72,7 +75,7 @@ module ActiveMerchant #:nodoc:
|
|
72
75
|
refund(money, authorization, options)
|
73
76
|
end
|
74
77
|
|
75
|
-
def refund(money, payment, options={})
|
78
|
+
def refund(money, payment, options = {})
|
76
79
|
request = build_xml_request do |doc|
|
77
80
|
add_authentication(doc)
|
78
81
|
add_descriptor(doc, options)
|
@@ -84,7 +87,7 @@ module ActiveMerchant #:nodoc:
|
|
84
87
|
elsif check?(payment)
|
85
88
|
add_echeck_purchase_params(doc, money, payment, options)
|
86
89
|
else
|
87
|
-
|
90
|
+
add_credit_params(doc, money, payment, options)
|
88
91
|
end
|
89
92
|
end
|
90
93
|
end
|
@@ -99,7 +102,7 @@ module ActiveMerchant #:nodoc:
|
|
99
102
|
end
|
100
103
|
end
|
101
104
|
|
102
|
-
def void(authorization, options={})
|
105
|
+
def void(authorization, options = {})
|
103
106
|
transaction_id, kind, money = split_authorization(authorization)
|
104
107
|
|
105
108
|
request = build_xml_request do |doc|
|
@@ -227,7 +230,18 @@ module ActiveMerchant #:nodoc:
|
|
227
230
|
add_stored_credential_params(doc, options)
|
228
231
|
end
|
229
232
|
|
230
|
-
def
|
233
|
+
def add_credit_params(doc, money, payment_method, options)
|
234
|
+
doc.orderId(truncate(options[:order_id], 24))
|
235
|
+
doc.amount(money)
|
236
|
+
add_order_source(doc, payment_method, options)
|
237
|
+
add_billing_address(doc, payment_method, options)
|
238
|
+
add_payment_method(doc, payment_method, options)
|
239
|
+
add_pos(doc, payment_method)
|
240
|
+
add_descriptor(doc, options)
|
241
|
+
add_merchant_data(doc, options)
|
242
|
+
end
|
243
|
+
|
244
|
+
def add_merchant_data(doc, options = {})
|
231
245
|
if options[:affiliate] || options[:campaign] || options[:merchant_grouping_id]
|
232
246
|
doc.merchantData do
|
233
247
|
doc.affiliate(options[:affiliate]) if options[:affiliate]
|
@@ -296,7 +310,7 @@ module ActiveMerchant #:nodoc:
|
|
296
310
|
end
|
297
311
|
end
|
298
312
|
|
299
|
-
def add_stored_credential_params(doc, options={})
|
313
|
+
def add_stored_credential_params(doc, options = {})
|
300
314
|
return unless options[:stored_credential]
|
301
315
|
|
302
316
|
if options[:stored_credential][:initial_transaction]
|
@@ -357,9 +371,9 @@ module ActiveMerchant #:nodoc:
|
|
357
371
|
return unless address
|
358
372
|
|
359
373
|
doc.companyName(address[:company]) unless address[:company].blank?
|
360
|
-
doc.addressLine1(address[:address1]) unless address[:address1].blank?
|
361
|
-
doc.addressLine2(address[:address2]) unless address[:address2].blank?
|
362
|
-
doc.city(address[:city]) unless address[:city].blank?
|
374
|
+
doc.addressLine1(truncate(address[:address1], 35)) unless address[:address1].blank?
|
375
|
+
doc.addressLine2(truncate(address[:address2], 35)) unless address[:address2].blank?
|
376
|
+
doc.city(truncate(address[:city], 35)) unless address[:city].blank?
|
363
377
|
doc.state(address[:state]) unless address[:state].blank?
|
364
378
|
doc.zip(address[:zip]) unless address[:zip].blank?
|
365
379
|
doc.country(address[:country]) unless address[:country].blank?
|
@@ -381,7 +395,7 @@ module ActiveMerchant #:nodoc:
|
|
381
395
|
end
|
382
396
|
end
|
383
397
|
|
384
|
-
def order_source(options={})
|
398
|
+
def order_source(options = {})
|
385
399
|
return options[:order_source] unless options[:stored_credential]
|
386
400
|
|
387
401
|
order_source = nil
|
@@ -448,7 +462,7 @@ module ActiveMerchant #:nodoc:
|
|
448
462
|
parsed
|
449
463
|
end
|
450
464
|
|
451
|
-
def commit(kind, request, money=nil)
|
465
|
+
def commit(kind, request, money = nil)
|
452
466
|
parsed = parse(kind, ssl_post(url, request, headers))
|
453
467
|
|
454
468
|
options = {
|
@@ -481,7 +495,7 @@ module ActiveMerchant #:nodoc:
|
|
481
495
|
attributes[:id] = truncate(options[:id] || options[:order_id], 24)
|
482
496
|
attributes[:reportGroup] = options[:merchant] || 'Default Report Group'
|
483
497
|
attributes[:customerId] = options[:customer]
|
484
|
-
attributes.delete_if { |
|
498
|
+
attributes.delete_if { |_key, value| value == nil }
|
485
499
|
attributes
|
486
500
|
end
|
487
501
|
|
@@ -502,6 +516,8 @@ module ActiveMerchant #:nodoc:
|
|
502
516
|
end
|
503
517
|
|
504
518
|
def url
|
519
|
+
return postlive_url if @options[:url_override].to_s == 'postlive'
|
520
|
+
|
505
521
|
test? ? test_url : live_url
|
506
522
|
end
|
507
523
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module ActiveMerchant
|
2
2
|
module Billing
|
3
3
|
module MastercardGateway
|
4
|
-
def initialize(options={})
|
4
|
+
def initialize(options = {})
|
5
5
|
requires!(options, :userid, :password)
|
6
6
|
super
|
7
7
|
end
|
8
8
|
|
9
|
-
def purchase(amount, payment_method, options={})
|
9
|
+
def purchase(amount, payment_method, options = {})
|
10
10
|
if options[:pay_mode]
|
11
11
|
post = new_post
|
12
12
|
add_invoice(post, amount, options)
|
@@ -24,7 +24,7 @@ module ActiveMerchant
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def authorize(amount, payment_method, options={})
|
27
|
+
def authorize(amount, payment_method, options = {})
|
28
28
|
post = new_post
|
29
29
|
add_invoice(post, amount, options)
|
30
30
|
add_reference(post, *new_authorization)
|
@@ -35,7 +35,7 @@ module ActiveMerchant
|
|
35
35
|
commit('authorize', post)
|
36
36
|
end
|
37
37
|
|
38
|
-
def capture(amount, authorization, options={})
|
38
|
+
def capture(amount, authorization, options = {})
|
39
39
|
post = new_post
|
40
40
|
add_invoice(post, amount, options, :transaction)
|
41
41
|
add_reference(post, *next_authorization(authorization))
|
@@ -45,7 +45,7 @@ module ActiveMerchant
|
|
45
45
|
commit('capture', post)
|
46
46
|
end
|
47
47
|
|
48
|
-
def refund(amount, authorization, options={})
|
48
|
+
def refund(amount, authorization, options = {})
|
49
49
|
post = new_post
|
50
50
|
add_invoice(post, amount, options, :transaction)
|
51
51
|
add_reference(post, *next_authorization(authorization))
|
@@ -54,14 +54,14 @@ module ActiveMerchant
|
|
54
54
|
commit('refund', post)
|
55
55
|
end
|
56
56
|
|
57
|
-
def void(authorization, options={})
|
57
|
+
def void(authorization, options = {})
|
58
58
|
post = new_post
|
59
59
|
add_reference(post, *next_authorization(authorization), :targetTransactionId)
|
60
60
|
|
61
61
|
commit('void', post)
|
62
62
|
end
|
63
63
|
|
64
|
-
def verify(credit_card, options={})
|
64
|
+
def verify(credit_card, options = {})
|
65
65
|
MultiResponse.run(:use_first_response) do |r|
|
66
66
|
r.process { authorize(100, credit_card, options) }
|
67
67
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -109,12 +109,12 @@ module ActiveMerchant
|
|
109
109
|
}
|
110
110
|
end
|
111
111
|
|
112
|
-
def add_invoice(post, amount, options, node
|
112
|
+
def add_invoice(post, amount, options, node = :order)
|
113
113
|
post[node][:amount] = amount(amount)
|
114
114
|
post[node][:currency] = (options[:currency] || currency(amount))
|
115
115
|
end
|
116
116
|
|
117
|
-
def add_reference(post, orderid, transactionid, transaction_reference, reference_key
|
117
|
+
def add_reference(post, orderid, transactionid, transaction_reference, reference_key = :reference)
|
118
118
|
post[:orderid] = orderid
|
119
119
|
post[:transactionid] = transactionid
|
120
120
|
post[:transaction][reference_key] = transaction_reference if transaction_reference
|
@@ -176,7 +176,7 @@ module ActiveMerchant
|
|
176
176
|
def add_3dsecure_id(post, options)
|
177
177
|
return unless options[:threed_secure_id]
|
178
178
|
|
179
|
-
post.merge!({'3DSecureId' => options[:threed_secure_id]})
|
179
|
+
post.merge!({ '3DSecureId' => options[:threed_secure_id] })
|
180
180
|
end
|
181
181
|
|
182
182
|
def country_code(country)
|