activemerchant 1.114.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 +45 -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_methods.rb +5 -5
- data/lib/active_merchant/billing/gateways/adyen.rb +23 -13
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +13 -11
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -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 +19 -17
- 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 +7 -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 +16 -19
- 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 +9 -9
- 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 +30 -31
- 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 +9 -8
- 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 +251 -232
- 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 +6 -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 +4 -4
- 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 +10 -10
- 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 +7 -7
- 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 +11 -11
- 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 +8 -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 +61 -66
- 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 +9 -9
- 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 +1 -2
- data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
- data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
- 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/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 +4 -4
- 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 +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 +9 -9
- 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 +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 +12 -8
- 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 +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 +2 -2
@@ -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|
|
@@ -15,12 +15,12 @@ module ActiveMerchant #:nodoc:
|
|
15
15
|
self.homepage_url = 'http://www.vantiv.com/'
|
16
16
|
self.display_name = 'Vantiv eCommerce'
|
17
17
|
|
18
|
-
def initialize(options={})
|
18
|
+
def initialize(options = {})
|
19
19
|
requires!(options, :login, :password, :merchant_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
|
request = build_xml_request do |doc|
|
25
25
|
add_authentication(doc)
|
26
26
|
if check?(payment_method)
|
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
|
|
36
36
|
check?(payment_method) ? commit(:echeckSales, request, money) : commit(:sale, request, money)
|
37
37
|
end
|
38
38
|
|
39
|
-
def authorize(money, payment_method, options={})
|
39
|
+
def authorize(money, payment_method, options = {})
|
40
40
|
request = build_xml_request do |doc|
|
41
41
|
add_authentication(doc)
|
42
42
|
if check?(payment_method)
|
@@ -52,7 +52,7 @@ module ActiveMerchant #:nodoc:
|
|
52
52
|
check?(payment_method) ? commit(:echeckVerification, request, money) : commit(:authorization, request, money)
|
53
53
|
end
|
54
54
|
|
55
|
-
def capture(money, authorization, options={})
|
55
|
+
def capture(money, authorization, options = {})
|
56
56
|
transaction_id, = split_authorization(authorization)
|
57
57
|
|
58
58
|
request = build_xml_request do |doc|
|
@@ -72,7 +72,7 @@ module ActiveMerchant #:nodoc:
|
|
72
72
|
refund(money, authorization, options)
|
73
73
|
end
|
74
74
|
|
75
|
-
def refund(money, payment, options={})
|
75
|
+
def refund(money, payment, options = {})
|
76
76
|
request = build_xml_request do |doc|
|
77
77
|
add_authentication(doc)
|
78
78
|
add_descriptor(doc, options)
|
@@ -99,7 +99,7 @@ module ActiveMerchant #:nodoc:
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
def void(authorization, options={})
|
102
|
+
def void(authorization, options = {})
|
103
103
|
transaction_id, kind, money = split_authorization(authorization)
|
104
104
|
|
105
105
|
request = build_xml_request do |doc|
|
@@ -227,7 +227,7 @@ module ActiveMerchant #:nodoc:
|
|
227
227
|
add_stored_credential_params(doc, options)
|
228
228
|
end
|
229
229
|
|
230
|
-
def add_merchant_data(doc, options={})
|
230
|
+
def add_merchant_data(doc, options = {})
|
231
231
|
if options[:affiliate] || options[:campaign] || options[:merchant_grouping_id]
|
232
232
|
doc.merchantData do
|
233
233
|
doc.affiliate(options[:affiliate]) if options[:affiliate]
|
@@ -296,7 +296,7 @@ module ActiveMerchant #:nodoc:
|
|
296
296
|
end
|
297
297
|
end
|
298
298
|
|
299
|
-
def add_stored_credential_params(doc, options={})
|
299
|
+
def add_stored_credential_params(doc, options = {})
|
300
300
|
return unless options[:stored_credential]
|
301
301
|
|
302
302
|
if options[:stored_credential][:initial_transaction]
|
@@ -381,7 +381,7 @@ module ActiveMerchant #:nodoc:
|
|
381
381
|
end
|
382
382
|
end
|
383
383
|
|
384
|
-
def order_source(options={})
|
384
|
+
def order_source(options = {})
|
385
385
|
return options[:order_source] unless options[:stored_credential]
|
386
386
|
|
387
387
|
order_source = nil
|
@@ -448,7 +448,7 @@ module ActiveMerchant #:nodoc:
|
|
448
448
|
parsed
|
449
449
|
end
|
450
450
|
|
451
|
-
def commit(kind, request, money=nil)
|
451
|
+
def commit(kind, request, money = nil)
|
452
452
|
parsed = parse(kind, ssl_post(url, request, headers))
|
453
453
|
|
454
454
|
options = {
|
@@ -481,7 +481,7 @@ module ActiveMerchant #:nodoc:
|
|
481
481
|
attributes[:id] = truncate(options[:id] || options[:order_id], 24)
|
482
482
|
attributes[:reportGroup] = options[:merchant] || 'Default Report Group'
|
483
483
|
attributes[:customerId] = options[:customer]
|
484
|
-
attributes.delete_if { |
|
484
|
+
attributes.delete_if { |_key, value| value == nil }
|
485
485
|
attributes
|
486
486
|
end
|
487
487
|
|
@@ -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)
|
@@ -10,12 +10,12 @@ module ActiveMerchant #:nodoc:
|
|
10
10
|
self.display_name = 'Mercado Pago'
|
11
11
|
self.money_format = :dollars
|
12
12
|
|
13
|
-
def initialize(options={})
|
13
|
+
def initialize(options = {})
|
14
14
|
requires!(options, :access_token)
|
15
15
|
super
|
16
16
|
end
|
17
17
|
|
18
|
-
def purchase(money, payment, options={})
|
18
|
+
def purchase(money, payment, options = {})
|
19
19
|
MultiResponse.run do |r|
|
20
20
|
r.process { commit('tokenize', 'card_tokens', card_token_request(money, payment, options)) }
|
21
21
|
options[:card_token] = r.authorization.split('|').first
|
@@ -23,7 +23,7 @@ module ActiveMerchant #:nodoc:
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def authorize(money, payment, options={})
|
26
|
+
def authorize(money, payment, options = {})
|
27
27
|
MultiResponse.run do |r|
|
28
28
|
r.process { commit('tokenize', 'card_tokens', card_token_request(money, payment, options)) }
|
29
29
|
options[:card_token] = r.authorization.split('|').first
|
@@ -31,7 +31,7 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def capture(money, authorization, options={})
|
34
|
+
def capture(money, authorization, options = {})
|
35
35
|
post = {}
|
36
36
|
authorization, = authorization.split('|')
|
37
37
|
post[:capture] = true
|
@@ -39,20 +39,20 @@ module ActiveMerchant #:nodoc:
|
|
39
39
|
commit('capture', "payments/#{authorization}", post)
|
40
40
|
end
|
41
41
|
|
42
|
-
def refund(money, authorization, options={})
|
42
|
+
def refund(money, authorization, options = {})
|
43
43
|
post = {}
|
44
44
|
authorization, original_amount = authorization.split('|')
|
45
45
|
post[:amount] = amount(money).to_f if original_amount && original_amount.to_f > amount(money).to_f
|
46
46
|
commit('refund', "payments/#{authorization}/refunds", post)
|
47
47
|
end
|
48
48
|
|
49
|
-
def void(authorization, options={})
|
49
|
+
def void(authorization, options = {})
|
50
50
|
authorization, = authorization.split('|')
|
51
51
|
post = { status: 'cancelled' }
|
52
52
|
commit('void', "payments/#{authorization}", post)
|
53
53
|
end
|
54
54
|
|
55
|
-
def verify(credit_card, options={})
|
55
|
+
def verify(credit_card, options = {})
|
56
56
|
MultiResponse.run(:use_first_response) do |r|
|
57
57
|
r.process { authorize(100, credit_card, options) }
|
58
58
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -169,8 +169,7 @@ module ActiveMerchant #:nodoc:
|
|
169
169
|
authorization: response['transaction_id'],
|
170
170
|
test: test?,
|
171
171
|
cvv_result: response['cvv2_result'],
|
172
|
-
avs_result: { code: response['avs_result'] }
|
173
|
-
)
|
172
|
+
avs_result: { code: response['avs_result'] })
|
174
173
|
end
|
175
174
|
|
176
175
|
def message_from(response)
|
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
|
|
79
79
|
post['ccexp'] = "#{sprintf('%02d', creditcard.month)}#{creditcard.year.to_s[-2, 2]}"
|
80
80
|
end
|
81
81
|
|
82
|
-
def commit(action, money, parameters={})
|
82
|
+
def commit(action, money, parameters = {})
|
83
83
|
parameters['username'] = @options[:username]
|
84
84
|
parameters['password'] = @options[:password]
|
85
85
|
parse(ssl_post(BASE_URL, post_data(action, parameters)))
|
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
self.money_format = :dollars
|
14
14
|
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
15
15
|
|
16
|
-
def initialize(options={})
|
16
|
+
def initialize(options = {})
|
17
17
|
requires!(options, :account_id, :merchant_pin)
|
18
18
|
super
|
19
19
|
end
|
20
20
|
|
21
|
-
def purchase(amount, payment_method, options={})
|
21
|
+
def purchase(amount, payment_method, options = {})
|
22
22
|
post = {}
|
23
23
|
add_invoice(post, amount, options)
|
24
24
|
add_payment_method(post, payment_method)
|
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
|
|
27
27
|
commit(payment_method.is_a?(String) ? :stored_purchase : :purchase, post)
|
28
28
|
end
|
29
29
|
|
30
|
-
def authorize(amount, payment_method, options={})
|
30
|
+
def authorize(amount, payment_method, options = {})
|
31
31
|
post = {}
|
32
32
|
add_invoice(post, amount, options)
|
33
33
|
add_payment_method(post, payment_method)
|
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
|
|
36
36
|
commit(:authorize, post)
|
37
37
|
end
|
38
38
|
|
39
|
-
def capture(amount, authorization, options={})
|
39
|
+
def capture(amount, authorization, options = {})
|
40
40
|
post = {}
|
41
41
|
add_invoice(post, amount, options)
|
42
42
|
add_reference(post, authorization)
|
@@ -45,14 +45,14 @@ module ActiveMerchant #:nodoc:
|
|
45
45
|
commit(:capture, post)
|
46
46
|
end
|
47
47
|
|
48
|
-
def void(authorization, options={})
|
48
|
+
def void(authorization, options = {})
|
49
49
|
post = {}
|
50
50
|
add_reference(post, authorization)
|
51
51
|
|
52
52
|
commit(:void, post)
|
53
53
|
end
|
54
54
|
|
55
|
-
def refund(amount, authorization, options={})
|
55
|
+
def refund(amount, authorization, options = {})
|
56
56
|
post = {}
|
57
57
|
add_invoice(post, amount, options)
|
58
58
|
add_reference(post, authorization)
|
@@ -61,7 +61,7 @@ module ActiveMerchant #:nodoc:
|
|
61
61
|
commit(:refund, post)
|
62
62
|
end
|
63
63
|
|
64
|
-
def credit(amount, payment_method, options={})
|
64
|
+
def credit(amount, payment_method, options = {})
|
65
65
|
post = {}
|
66
66
|
add_invoice(post, amount, options)
|
67
67
|
add_payment_method(post, payment_method)
|
@@ -69,7 +69,7 @@ module ActiveMerchant #:nodoc:
|
|
69
69
|
commit(payment_method.is_a?(String) ? :stored_credit : :credit, post)
|
70
70
|
end
|
71
71
|
|
72
|
-
def verify(credit_card, options={})
|
72
|
+
def verify(credit_card, options = {})
|
73
73
|
MultiResponse.run(:use_first_response) do |r|
|
74
74
|
r.process { authorize(100, credit_card, options) }
|
75
75
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -111,9 +111,9 @@ module ActiveMerchant #:nodoc:
|
|
111
111
|
|
112
112
|
def add_payment_method(post, payment_method)
|
113
113
|
if payment_method.is_a?(String)
|
114
|
-
user_profile_id,
|
114
|
+
user_profile_id, last4 = split_authorization(payment_method)
|
115
115
|
post[:userprofileid] = user_profile_id
|
116
|
-
post[:last4digits] =
|
116
|
+
post[:last4digits] = last4
|
117
117
|
else
|
118
118
|
post[:ccname] = payment_method.name
|
119
119
|
post[:ccnum] = payment_method.number
|
@@ -13,10 +13,10 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
|
14
14
|
ENV_NAMESPACES = { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
15
15
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
16
|
-
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/'}
|
16
|
+
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/' }
|
17
17
|
ENV_NAMESPACES_V4 = { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
18
18
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
19
|
-
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'}
|
19
|
+
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' }
|
20
20
|
|
21
21
|
TX_NAMESPACE = 'http://merchantwarehouse.com/MerchantWARE/Client/TransactionRetail'
|
22
22
|
TX_NAMESPACE_V4 = 'http://schemas.merchantwarehouse.com/merchantware/40/Credit/'
|
@@ -272,7 +272,7 @@ module ActiveMerchant #:nodoc:
|
|
272
272
|
response[element.name] = element.text
|
273
273
|
end
|
274
274
|
|
275
|
-
response[:message] = response['faultstring'].to_s.
|
275
|
+
response[:message] = response['faultstring'].to_s.tr("\n", ' ')
|
276
276
|
response
|
277
277
|
rescue REXML::ParseException
|
278
278
|
response[:http_body] = http_response.body
|
@@ -292,8 +292,7 @@ module ActiveMerchant #:nodoc:
|
|
292
292
|
begin
|
293
293
|
data = ssl_post(url(v4), request,
|
294
294
|
'Content-Type' => 'text/xml; charset=utf-8',
|
295
|
-
'SOAPAction' => soap_action(action, v4)
|
296
|
-
)
|
295
|
+
'SOAPAction' => soap_action(action, v4))
|
297
296
|
response = parse(action, data)
|
298
297
|
rescue ActiveMerchant::ResponseError => e
|
299
298
|
response = parse_error(e.response)
|
@@ -303,8 +302,7 @@ module ActiveMerchant #:nodoc:
|
|
303
302
|
test: test?,
|
304
303
|
authorization: authorization_from(response),
|
305
304
|
avs_result: { code: response['AVSResponse'] },
|
306
|
-
cvv_result: response['CVResponse']
|
307
|
-
)
|
305
|
+
cvv_result: response['CVResponse'])
|
308
306
|
end
|
309
307
|
|
310
308
|
def authorization_from(response)
|
@@ -108,7 +108,7 @@ module ActiveMerchant #:nodoc:
|
|
108
108
|
commit(:refund, request)
|
109
109
|
end
|
110
110
|
|
111
|
-
def verify(credit_card, options={})
|
111
|
+
def verify(credit_card, options = {})
|
112
112
|
MultiResponse.run(:use_first_response) do |r|
|
113
113
|
r.process { authorize(100, credit_card, options) }
|
114
114
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -243,7 +243,7 @@ module ActiveMerchant #:nodoc:
|
|
243
243
|
response[element.name] = element.text
|
244
244
|
end
|
245
245
|
|
246
|
-
response[:message] = response['ErrorMessage'].to_s.
|
246
|
+
response[:message] = response['ErrorMessage'].to_s.tr("\n", ' ')
|
247
247
|
response
|
248
248
|
rescue REXML::ParseException
|
249
249
|
response[:http_body] = http_response.body
|
@@ -263,8 +263,7 @@ module ActiveMerchant #:nodoc:
|
|
263
263
|
begin
|
264
264
|
data = ssl_post(url, request,
|
265
265
|
'Content-Type' => 'text/xml; charset=utf-8',
|
266
|
-
'SOAPAction' => soap_action(action)
|
267
|
-
)
|
266
|
+
'SOAPAction' => soap_action(action))
|
268
267
|
response = parse(action, data)
|
269
268
|
rescue ActiveMerchant::ResponseError => e
|
270
269
|
response = parse_error(e.response, action)
|
@@ -274,8 +273,7 @@ module ActiveMerchant #:nodoc:
|
|
274
273
|
test: test?,
|
275
274
|
authorization: authorization_from(response),
|
276
275
|
avs_result: { code: response['AvsResponse'] },
|
277
|
-
cvv_result: response['CvResponse']
|
278
|
-
)
|
276
|
+
cvv_result: response['CvResponse'])
|
279
277
|
end
|
280
278
|
|
281
279
|
def authorization_from(response)
|
@@ -69,14 +69,14 @@ module ActiveMerchant #:nodoc:
|
|
69
69
|
commit('Return', request)
|
70
70
|
end
|
71
71
|
|
72
|
-
def void(authorization, options={})
|
72
|
+
def void(authorization, options = {})
|
73
73
|
requires!(options, :credit_card) unless @use_tokenization
|
74
74
|
|
75
75
|
request = build_authorized_request('VoidSale', nil, authorization, options[:credit_card], options)
|
76
76
|
commit('VoidSale', request)
|
77
77
|
end
|
78
78
|
|
79
|
-
def store(credit_card, options={})
|
79
|
+
def store(credit_card, options = {})
|
80
80
|
request = build_card_lookup_request(credit_card, options)
|
81
81
|
commit('CardLookup', request)
|
82
82
|
end
|
@@ -211,11 +211,11 @@ module ActiveMerchant #:nodoc:
|
|
211
211
|
# handle with the validation error as it sees fit.
|
212
212
|
# Track 2 requires having the STX and ETX stripped. Track 1 does not.
|
213
213
|
# Max-length track 1s require having the STX and ETX stripped. Max is 79 bytes including LRC.
|
214
|
-
|
214
|
+
is_track2 = credit_card.track_data[0] == ';'
|
215
215
|
etx_index = credit_card.track_data.rindex('?') || credit_card.track_data.length
|
216
216
|
is_max_track1 = etx_index >= 77
|
217
217
|
|
218
|
-
if
|
218
|
+
if is_track2
|
219
219
|
xml.tag! 'Track2', credit_card.track_data[1...etx_index]
|
220
220
|
elsif is_max_track1
|
221
221
|
xml.tag! 'Track1', credit_card.track_data[1...etx_index]
|