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
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
self.homepage_url = 'http://1stpaygateway.net/'
|
14
14
|
self.display_name = '1stPayGateway.Net'
|
15
15
|
|
16
|
-
def initialize(options={})
|
16
|
+
def initialize(options = {})
|
17
17
|
requires!(options, :transaction_center_id, :gateway_id)
|
18
18
|
super
|
19
19
|
end
|
20
20
|
|
21
|
-
def purchase(money, payment, options={})
|
21
|
+
def purchase(money, payment, options = {})
|
22
22
|
post = {}
|
23
23
|
add_invoice(post, money, options)
|
24
24
|
add_payment(post, payment, options)
|
@@ -28,7 +28,7 @@ module ActiveMerchant #:nodoc:
|
|
28
28
|
commit('sale', post)
|
29
29
|
end
|
30
30
|
|
31
|
-
def authorize(money, payment, options={})
|
31
|
+
def authorize(money, payment, options = {})
|
32
32
|
post = {}
|
33
33
|
add_invoice(post, money, options)
|
34
34
|
add_payment(post, payment, options)
|
@@ -38,19 +38,19 @@ module ActiveMerchant #:nodoc:
|
|
38
38
|
commit('auth', post)
|
39
39
|
end
|
40
40
|
|
41
|
-
def capture(money, authorization, options={})
|
41
|
+
def capture(money, authorization, options = {})
|
42
42
|
post = {}
|
43
43
|
add_reference(post, 'settle', money, authorization)
|
44
44
|
commit('settle', post)
|
45
45
|
end
|
46
46
|
|
47
|
-
def refund(money, authorization, options={})
|
47
|
+
def refund(money, authorization, options = {})
|
48
48
|
post = {}
|
49
49
|
add_reference(post, 'credit', money, authorization)
|
50
50
|
commit('credit', post)
|
51
51
|
end
|
52
52
|
|
53
|
-
def void(authorization, options={})
|
53
|
+
def void(authorization, options = {})
|
54
54
|
post = {}
|
55
55
|
add_reference(post, 'void', nil, authorization)
|
56
56
|
commit('void', post)
|
@@ -32,7 +32,7 @@ module ActiveMerchant #:nodoc:
|
|
32
32
|
discover: 'Discover'
|
33
33
|
}
|
34
34
|
|
35
|
-
E4_BRANDS = BRANDS.merge({mastercard: 'Mastercard'})
|
35
|
+
E4_BRANDS = BRANDS.merge({ mastercard: 'Mastercard' })
|
36
36
|
|
37
37
|
DEFAULT_ECI = '07'
|
38
38
|
|
@@ -302,7 +302,8 @@ module ActiveMerchant #:nodoc:
|
|
302
302
|
first_name: params[2],
|
303
303
|
last_name: params[3],
|
304
304
|
month: params[4],
|
305
|
-
year: params[5]
|
305
|
+
year: params[5]
|
306
|
+
)
|
306
307
|
|
307
308
|
xml.tag! 'TransarmorToken', params[0]
|
308
309
|
xml.tag! 'Expiry_Date', expdate(credit_card)
|
@@ -356,10 +357,9 @@ module ActiveMerchant #:nodoc:
|
|
356
357
|
Response.new(successful?(response), message_from(response), response,
|
357
358
|
test: test?,
|
358
359
|
authorization: successful?(response) ? response_authorization(action, response, credit_card) : '',
|
359
|
-
avs_result: {code: response[:avs]},
|
360
|
+
avs_result: { code: response[:avs] },
|
360
361
|
cvv_result: response[:cvv2],
|
361
|
-
error_code: standard_error_code(response)
|
362
|
-
)
|
362
|
+
error_code: standard_error_code(response))
|
363
363
|
end
|
364
364
|
|
365
365
|
def successful?(response)
|
@@ -395,7 +395,7 @@ module ActiveMerchant #:nodoc:
|
|
395
395
|
credit_card.last_name,
|
396
396
|
credit_card.month,
|
397
397
|
credit_card.year
|
398
|
-
].map { |value| value.to_s.
|
398
|
+
].map { |value| value.to_s.delete(';') }.join(';')
|
399
399
|
else
|
400
400
|
raise StandardError, "TransArmor support is not enabled on your #{display_name} account"
|
401
401
|
end
|
@@ -439,7 +439,7 @@ module ActiveMerchant #:nodoc:
|
|
439
439
|
parse_elements(response, root)
|
440
440
|
end
|
441
441
|
|
442
|
-
response.delete_if { |k,
|
442
|
+
response.delete_if { |k, _v| SENSITIVE_FIELDS.include?(k) }
|
443
443
|
end
|
444
444
|
|
445
445
|
def parse_elements(response, root)
|
@@ -269,7 +269,8 @@ module ActiveMerchant #:nodoc:
|
|
269
269
|
first_name: params[2],
|
270
270
|
last_name: params[3],
|
271
271
|
month: params[4],
|
272
|
-
year: params[5]
|
272
|
+
year: params[5]
|
273
|
+
)
|
273
274
|
|
274
275
|
xml.tag! 'TransarmorToken', params[0]
|
275
276
|
xml.tag! 'Expiry_Date', expdate(credit_card)
|
@@ -371,10 +372,9 @@ module ActiveMerchant #:nodoc:
|
|
371
372
|
Response.new(successful?(response), message_from(response), response,
|
372
373
|
test: test?,
|
373
374
|
authorization: successful?(response) ? response_authorization(action, response, credit_card) : '',
|
374
|
-
avs_result: {code: response[:avs]},
|
375
|
+
avs_result: { code: response[:avs] },
|
375
376
|
cvv_result: response[:cvv2],
|
376
|
-
error_code: standard_error_code(response)
|
377
|
-
)
|
377
|
+
error_code: standard_error_code(response))
|
378
378
|
end
|
379
379
|
|
380
380
|
def headers(method, url, request)
|
@@ -19,19 +19,19 @@ module ActiveMerchant #:nodoc:
|
|
19
19
|
'diners_club' => 'DINERS'
|
20
20
|
}
|
21
21
|
|
22
|
-
def initialize(options={})
|
22
|
+
def initialize(options = {})
|
23
23
|
requires!(options, :username, :password, :account_id)
|
24
24
|
super
|
25
25
|
end
|
26
26
|
|
27
|
-
def purchase(amount, payment_method, options={})
|
27
|
+
def purchase(amount, payment_method, options = {})
|
28
28
|
MultiResponse.run do |r|
|
29
29
|
r.process { authorize(amount, payment_method, options) }
|
30
30
|
r.process { capture(amount, r.authorization, options) }
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def authorize(amount, payment_method, options={})
|
34
|
+
def authorize(amount, payment_method, options = {})
|
35
35
|
post = {}
|
36
36
|
add_invoice(post, amount, options)
|
37
37
|
add_payment_method(post, payment_method)
|
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
|
|
40
40
|
commit('ProcessAuthorise', post)
|
41
41
|
end
|
42
42
|
|
43
|
-
def capture(amount, authorization, options={})
|
43
|
+
def capture(amount, authorization, options = {})
|
44
44
|
post = {}
|
45
45
|
add_invoice(post, amount, options)
|
46
46
|
add_reference(post, authorization)
|
@@ -49,7 +49,7 @@ module ActiveMerchant #:nodoc:
|
|
49
49
|
commit('ProcessCapture', post)
|
50
50
|
end
|
51
51
|
|
52
|
-
def refund(amount, authorization, options={})
|
52
|
+
def refund(amount, authorization, options = {})
|
53
53
|
post = {}
|
54
54
|
add_invoice(post, amount, options)
|
55
55
|
add_reference(post, authorization)
|
@@ -71,7 +71,7 @@ module ActiveMerchant #:nodoc:
|
|
71
71
|
|
72
72
|
private
|
73
73
|
|
74
|
-
CURRENCY_CODES = Hash.new { |
|
74
|
+
CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
|
75
75
|
CURRENCY_CODES['NZD'] = '554'
|
76
76
|
|
77
77
|
def add_invoice(post, money, options)
|
@@ -142,7 +142,7 @@ module ActiveMerchant #:nodoc:
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def envelope_wrap(action, body)
|
145
|
-
<<~
|
145
|
+
<<~XML
|
146
146
|
<?xml version="1.0" encoding="utf-8"?>
|
147
147
|
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
|
148
148
|
<soap12:Body>
|
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
|
|
151
151
|
</#{action}>
|
152
152
|
</soap12:Body>
|
153
153
|
</soap12:Envelope>
|
154
|
-
|
154
|
+
XML
|
155
155
|
end
|
156
156
|
|
157
157
|
def url
|
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
|
|
204
204
|
'Bank Declined Transaction' => STANDARD_ERROR_CODE[:card_declined],
|
205
205
|
'Insufficient Funds' => STANDARD_ERROR_CODE[:card_declined],
|
206
206
|
'Transaction Declined - Bank Error' => STANDARD_ERROR_CODE[:processing_error],
|
207
|
-
'No Reply from Bank' => STANDARD_ERROR_CODE[:processing_error]
|
207
|
+
'No Reply from Bank' => STANDARD_ERROR_CODE[:processing_error]
|
208
208
|
}
|
209
209
|
|
210
210
|
def error_code_from(succeeded, response)
|
@@ -3,7 +3,7 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
class Flo2cashSimpleGateway < Flo2cashGateway
|
4
4
|
self.display_name = 'Flo2Cash Simple'
|
5
5
|
|
6
|
-
def purchase(amount, payment_method, options={})
|
6
|
+
def purchase(amount, payment_method, options = {})
|
7
7
|
post = {}
|
8
8
|
add_invoice(post, amount, options)
|
9
9
|
add_payment_method(post, payment_method)
|
@@ -15,14 +15,15 @@ module ActiveMerchant #:nodoc:
|
|
15
15
|
self.homepage_url = 'https://www.forte.net'
|
16
16
|
self.display_name = 'Forte'
|
17
17
|
|
18
|
-
def initialize(options={})
|
18
|
+
def initialize(options = {})
|
19
19
|
requires!(options, :api_key, :secret, :location_id, :account_id)
|
20
20
|
super
|
21
21
|
end
|
22
22
|
|
23
|
-
def purchase(money, payment_method, options={})
|
23
|
+
def purchase(money, payment_method, options = {})
|
24
24
|
post = {}
|
25
25
|
add_amount(post, money, options)
|
26
|
+
add_service_fee(post, options)
|
26
27
|
add_invoice(post, options)
|
27
28
|
add_payment_method(post, payment_method, options)
|
28
29
|
add_billing_address(post, payment_method, options)
|
@@ -32,9 +33,10 @@ module ActiveMerchant #:nodoc:
|
|
32
33
|
commit(:post, post)
|
33
34
|
end
|
34
35
|
|
35
|
-
def authorize(money, payment_method, options={})
|
36
|
+
def authorize(money, payment_method, options = {})
|
36
37
|
post = {}
|
37
38
|
add_amount(post, money, options)
|
39
|
+
add_service_fee(post, options)
|
38
40
|
add_invoice(post, options)
|
39
41
|
add_payment_method(post, payment_method, options)
|
40
42
|
add_billing_address(post, payment_method, options)
|
@@ -44,7 +46,7 @@ module ActiveMerchant #:nodoc:
|
|
44
46
|
commit(:post, post)
|
45
47
|
end
|
46
48
|
|
47
|
-
def capture(money, authorization, options={})
|
49
|
+
def capture(money, authorization, options = {})
|
48
50
|
post = {}
|
49
51
|
post[:transaction_id] = transaction_id_from(authorization)
|
50
52
|
post[:authorization_code] = authorization_code_from(authorization) || ''
|
@@ -53,7 +55,7 @@ module ActiveMerchant #:nodoc:
|
|
53
55
|
commit(:put, post)
|
54
56
|
end
|
55
57
|
|
56
|
-
def credit(money, payment_method, options={})
|
58
|
+
def credit(money, payment_method, options = {})
|
57
59
|
post = {}
|
58
60
|
add_amount(post, money, options)
|
59
61
|
add_invoice(post, options)
|
@@ -64,7 +66,7 @@ module ActiveMerchant #:nodoc:
|
|
64
66
|
commit(:post, post)
|
65
67
|
end
|
66
68
|
|
67
|
-
def refund(money, authorization, options={})
|
69
|
+
def refund(money, authorization, options = {})
|
68
70
|
post = {}
|
69
71
|
add_amount(post, money, options)
|
70
72
|
post[:original_transaction_id] = transaction_id_from(authorization)
|
@@ -74,7 +76,7 @@ module ActiveMerchant #:nodoc:
|
|
74
76
|
commit(:post, post)
|
75
77
|
end
|
76
78
|
|
77
|
-
def void(authorization, options={})
|
79
|
+
def void(authorization, options = {})
|
78
80
|
post = {}
|
79
81
|
post[:transaction_id] = transaction_id_from(authorization)
|
80
82
|
post[:authorization_code] = authorization_code_from(authorization)
|
@@ -83,7 +85,7 @@ module ActiveMerchant #:nodoc:
|
|
83
85
|
commit(:put, post)
|
84
86
|
end
|
85
87
|
|
86
|
-
def verify(credit_card, options={})
|
88
|
+
def verify(credit_card, options = {})
|
87
89
|
MultiResponse.run(:use_first_response) do |r|
|
88
90
|
r.process { authorize(100, credit_card, options) }
|
89
91
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -116,6 +118,10 @@ module ActiveMerchant #:nodoc:
|
|
116
118
|
post[:authorization_amount] = amount(money)
|
117
119
|
end
|
118
120
|
|
121
|
+
def add_service_fee(post, options)
|
122
|
+
post[:service_fee_amount] = options[:service_fee_amount] if options[:service_fee_amount]
|
123
|
+
end
|
124
|
+
|
119
125
|
def add_billing_address(post, payment, options)
|
120
126
|
post[:billing_address] = {}
|
121
127
|
if address = options[:billing_address] || options[:address]
|
@@ -12,19 +12,19 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
self.money_format = :cents
|
13
13
|
self.supported_cardtypes = %i[visa master american_express discover naranja cabal]
|
14
14
|
|
15
|
-
def initialize(options={})
|
15
|
+
def initialize(options = {})
|
16
16
|
requires!(options, :merchant_id, :api_key_id, :secret_api_key)
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
20
|
-
def purchase(money, payment, options={})
|
20
|
+
def purchase(money, payment, options = {})
|
21
21
|
MultiResponse.run do |r|
|
22
22
|
r.process { authorize(money, payment, options) }
|
23
23
|
r.process { capture(money, r.authorization, options) } if should_request_capture?(r, options[:requires_approval])
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def authorize(money, payment, options={})
|
27
|
+
def authorize(money, payment, options = {})
|
28
28
|
post = nestable_hash
|
29
29
|
add_order(post, money, options)
|
30
30
|
add_payment(post, payment, options)
|
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
|
|
35
35
|
commit(:authorize, post)
|
36
36
|
end
|
37
37
|
|
38
|
-
def capture(money, authorization, options={})
|
38
|
+
def capture(money, authorization, options = {})
|
39
39
|
post = nestable_hash
|
40
40
|
add_order(post, money, options, capture: true)
|
41
41
|
add_customer_data(post, options)
|
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
|
|
43
43
|
commit(:capture, post, authorization)
|
44
44
|
end
|
45
45
|
|
46
|
-
def refund(money, authorization, options={})
|
46
|
+
def refund(money, authorization, options = {})
|
47
47
|
post = nestable_hash
|
48
48
|
add_amount(post, money, options)
|
49
49
|
add_refund_customer_data(post, options)
|
@@ -51,13 +51,13 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
commit(:refund, post, authorization)
|
52
52
|
end
|
53
53
|
|
54
|
-
def void(authorization, options={})
|
54
|
+
def void(authorization, options = {})
|
55
55
|
post = nestable_hash
|
56
56
|
add_creator_info(post, options)
|
57
57
|
commit(:void, post, authorization)
|
58
58
|
end
|
59
59
|
|
60
|
-
def verify(payment, options={})
|
60
|
+
def verify(payment, options = {})
|
61
61
|
MultiResponse.run(:use_first_response) do |r|
|
62
62
|
r.process { authorize(100, payment, options) }
|
63
63
|
r.process { void(r.authorization, options) }
|
@@ -100,6 +100,7 @@ module ActiveMerchant #:nodoc:
|
|
100
100
|
'invoiceNumber' => options[:invoice]
|
101
101
|
}
|
102
102
|
add_airline_data(post, options) if options[:airline_data]
|
103
|
+
add_number_of_installments(post, options) if options[:number_of_installments]
|
103
104
|
end
|
104
105
|
|
105
106
|
def add_airline_data(post, options)
|
@@ -141,7 +142,7 @@ module ActiveMerchant #:nodoc:
|
|
141
142
|
post['shoppingCartExtension']['extensionID'] = options[:extension_ID] if options[:extension_ID]
|
142
143
|
end
|
143
144
|
|
144
|
-
def add_amount(post, money, options={})
|
145
|
+
def add_amount(post, money, options = {})
|
145
146
|
post['amountOfMoney'] = {
|
146
147
|
'amount' => amount(money),
|
147
148
|
'currencyCode' => options[:currency] || currency(money)
|
@@ -231,6 +232,10 @@ module ActiveMerchant #:nodoc:
|
|
231
232
|
post['fraudFields'] = fraud_fields unless fraud_fields.empty?
|
232
233
|
end
|
233
234
|
|
235
|
+
def add_number_of_installments(post, options)
|
236
|
+
post['order']['additionalInput']['numberOfInstallments'] = options[:number_of_installments] if options[:number_of_installments]
|
237
|
+
end
|
238
|
+
|
234
239
|
def parse(body)
|
235
240
|
JSON.parse(body)
|
236
241
|
end
|
@@ -291,12 +296,12 @@ module ActiveMerchant #:nodoc:
|
|
291
296
|
end
|
292
297
|
|
293
298
|
def auth_digest(action, post, authorization = nil)
|
294
|
-
data = <<~
|
299
|
+
data = <<~REQUEST
|
295
300
|
POST
|
296
301
|
#{content_type}
|
297
302
|
#{date}
|
298
303
|
#{uri(action, authorization)}
|
299
|
-
|
304
|
+
REQUEST
|
300
305
|
digest = OpenSSL::Digest.new('sha256')
|
301
306
|
key = @options[:secret_api_key]
|
302
307
|
"GCS v1HMAC:#{@options[:api_key_id]}:#{Base64.strict_encode64(OpenSSL::HMAC.digest(digest, key, data))}"
|
@@ -20,12 +20,12 @@ module ActiveMerchant #:nodoc:
|
|
20
20
|
# :global_password - Your Global password
|
21
21
|
# :term_type - 3 character field assigned by Global Transport after
|
22
22
|
# - your application is certified.
|
23
|
-
def initialize(options={})
|
23
|
+
def initialize(options = {})
|
24
24
|
requires!(options, :global_user_name, :global_password, :term_type)
|
25
25
|
super
|
26
26
|
end
|
27
27
|
|
28
|
-
def purchase(money, payment_method, options={})
|
28
|
+
def purchase(money, payment_method, options = {})
|
29
29
|
post = {}
|
30
30
|
add_invoice(post, money, options)
|
31
31
|
add_payment_method(post, payment_method)
|
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
|
|
34
34
|
commit('Sale', post, options)
|
35
35
|
end
|
36
36
|
|
37
|
-
def authorize(money, payment_method, options={})
|
37
|
+
def authorize(money, payment_method, options = {})
|
38
38
|
post = {}
|
39
39
|
add_invoice(post, money, options)
|
40
40
|
add_payment_method(post, payment_method)
|
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
|
|
43
43
|
commit('Auth', post, options)
|
44
44
|
end
|
45
45
|
|
46
|
-
def capture(money, authorization, options={})
|
46
|
+
def capture(money, authorization, options = {})
|
47
47
|
post = {}
|
48
48
|
add_invoice(post, money, options)
|
49
49
|
add_auth(post, authorization)
|
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
commit('Force', post, options)
|
52
52
|
end
|
53
53
|
|
54
|
-
def refund(money, authorization, options={})
|
54
|
+
def refund(money, authorization, options = {})
|
55
55
|
post = {}
|
56
56
|
add_invoice(post, money, options)
|
57
57
|
add_auth(post, authorization)
|
@@ -59,14 +59,14 @@ module ActiveMerchant #:nodoc:
|
|
59
59
|
commit('Return', post, options)
|
60
60
|
end
|
61
61
|
|
62
|
-
def void(authorization, options={})
|
62
|
+
def void(authorization, options = {})
|
63
63
|
post = {}
|
64
64
|
add_auth(post, authorization)
|
65
65
|
|
66
66
|
commit('Void', post, options)
|
67
67
|
end
|
68
68
|
|
69
|
-
def verify(payment_method, options={})
|
69
|
+
def verify(payment_method, options = {})
|
70
70
|
post = {}
|
71
71
|
add_payment_method(post, payment_method)
|
72
72
|
add_address(post, options)
|
@@ -14,12 +14,12 @@ module ActiveMerchant #:nodoc:
|
|
14
14
|
self.money_format = :dollars
|
15
15
|
self.supported_cardtypes = %i[visa master discover diners_club]
|
16
16
|
|
17
|
-
def initialize(options={})
|
17
|
+
def initialize(options = {})
|
18
18
|
requires!(options, :login, :password)
|
19
19
|
super
|
20
20
|
end
|
21
21
|
|
22
|
-
def purchase(amount, payment_method, options={})
|
22
|
+
def purchase(amount, payment_method, options = {})
|
23
23
|
post = {}
|
24
24
|
add_invoice(post, amount, options)
|
25
25
|
add_payment_method(post, payment_method)
|
@@ -28,7 +28,7 @@ module ActiveMerchant #:nodoc:
|
|
28
28
|
commit('purchase', post)
|
29
29
|
end
|
30
30
|
|
31
|
-
def authorize(amount, payment_method, options={})
|
31
|
+
def authorize(amount, payment_method, options = {})
|
32
32
|
post = {}
|
33
33
|
add_invoice(post, amount, options)
|
34
34
|
add_payment_method(post, payment_method)
|
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
|
|
37
37
|
commit('authorize', post)
|
38
38
|
end
|
39
39
|
|
40
|
-
def capture(amount, authorization, options={})
|
40
|
+
def capture(amount, authorization, options = {})
|
41
41
|
post = {}
|
42
42
|
add_invoice(post, amount, options)
|
43
43
|
add_reference(post, authorization)
|
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
|
|
46
46
|
commit('capture', post)
|
47
47
|
end
|
48
48
|
|
49
|
-
def refund(amount, authorization, options={})
|
49
|
+
def refund(amount, authorization, options = {})
|
50
50
|
post = {}
|
51
51
|
add_invoice(post, amount, options)
|
52
52
|
add_reference(post, authorization)
|
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
|
|
57
57
|
|
58
58
|
private
|
59
59
|
|
60
|
-
CURRENCY_CODES = Hash.new { |
|
60
|
+
CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
|
61
61
|
CURRENCY_CODES['AED'] = '784'
|
62
62
|
CURRENCY_CODES['AUD'] = '036'
|
63
63
|
CURRENCY_CODES['CAD'] = '124'
|
@@ -81,14 +81,14 @@ module ActiveMerchant #:nodoc:
|
|
81
81
|
post[:udf2] = escape(options[:email]) if options[:email]
|
82
82
|
if address = (options[:billing_address] || options[:address])
|
83
83
|
post[:udf3] = escape(address[:phone]) if address[:phone]
|
84
|
-
post[:udf4] = escape(<<~
|
84
|
+
post[:udf4] = escape(<<~ADDRESS)
|
85
85
|
#{address[:name]}
|
86
86
|
#{address[:company]}
|
87
87
|
#{address[:address1]}
|
88
88
|
#{address[:address2]}
|
89
89
|
#{address[:city]} #{address[:state]} #{address[:zip]}
|
90
90
|
#{address[:country]}
|
91
|
-
|
91
|
+
ADDRESS
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
|
|
134
134
|
'purchase' => '1',
|
135
135
|
'refund' => '2',
|
136
136
|
'authorize' => '4',
|
137
|
-
'capture' => '5'
|
137
|
+
'capture' => '5'
|
138
138
|
}
|
139
139
|
|
140
140
|
def commit(action, post)
|
@@ -194,7 +194,7 @@ module ActiveMerchant #:nodoc:
|
|
194
194
|
[tranid, member]
|
195
195
|
end
|
196
196
|
|
197
|
-
def escape(string, max_length=250)
|
197
|
+
def escape(string, max_length = 250)
|
198
198
|
return '' unless string
|
199
199
|
|
200
200
|
string = string[0...max_length] if max_length
|