activemerchant 1.112.0 → 1.118.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +115 -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 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +58 -11
- data/lib/active_merchant/billing/gateway.rb +1 -1
- data/lib/active_merchant/billing/gateways/adyen.rb +26 -16
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -18
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -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 +85 -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 +20 -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 +18 -21
- 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 +32 -15
- 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 +61 -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 +24 -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 +279 -227
- 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 +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 +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 +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 +29 -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 +17 -14
- 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 +28 -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 +175 -81
- 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 +35 -17
- 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 +26 -6
- data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
- 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 +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 +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +87 -7
- 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 +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 +12 -12
- 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 +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 +18 -10
- 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 +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
@@ -45,7 +45,7 @@ module ActiveMerchant
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def authorize(amount, payment_method, options = {})
|
48
|
-
params = {transaction_type: 'authorize'}
|
48
|
+
params = { transaction_type: 'authorize' }
|
49
49
|
|
50
50
|
add_invoice(params, options)
|
51
51
|
add_reversal_id(params, options)
|
@@ -59,7 +59,7 @@ module ActiveMerchant
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def capture(amount, authorization, options = {})
|
62
|
-
params = {transaction_type: 'capture'}
|
62
|
+
params = { transaction_type: 'capture' }
|
63
63
|
|
64
64
|
add_authorization_info(params, authorization)
|
65
65
|
add_amount(params, amount, options)
|
@@ -69,7 +69,7 @@ module ActiveMerchant
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def refund(amount, authorization, options = {})
|
72
|
-
params = {transaction_type: 'refund'}
|
72
|
+
params = { transaction_type: 'refund' }
|
73
73
|
|
74
74
|
add_authorization_info(params, authorization)
|
75
75
|
add_amount(params, (amount || amount_from_authorization(authorization)), options)
|
@@ -78,7 +78,7 @@ module ActiveMerchant
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def store(payment_method, options = {})
|
81
|
-
params = {transaction_type: 'store'}
|
81
|
+
params = { transaction_type: 'store' }
|
82
82
|
|
83
83
|
add_creditcard_for_tokenization(params, payment_method, options)
|
84
84
|
|
@@ -86,7 +86,7 @@ module ActiveMerchant
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def void(authorization, options = {})
|
89
|
-
params = {transaction_type: 'void'}
|
89
|
+
params = { transaction_type: 'void' }
|
90
90
|
|
91
91
|
add_authorization_info(params, authorization, options)
|
92
92
|
add_amount(params, amount_from_authorization(authorization), options)
|
@@ -94,7 +94,7 @@ module ActiveMerchant
|
|
94
94
|
commit(params, options)
|
95
95
|
end
|
96
96
|
|
97
|
-
def verify(credit_card, options={})
|
97
|
+
def verify(credit_card, options = {})
|
98
98
|
MultiResponse.run(:use_first_response) do |r|
|
99
99
|
r.process { authorize(0, credit_card, options) }
|
100
100
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -155,7 +155,7 @@ module ActiveMerchant
|
|
155
155
|
params[:auth] = 'false'
|
156
156
|
end
|
157
157
|
|
158
|
-
def
|
158
|
+
def store_action?(params)
|
159
159
|
params[:transaction_type] == 'store'
|
160
160
|
end
|
161
161
|
|
@@ -247,16 +247,34 @@ module ActiveMerchant
|
|
247
247
|
end
|
248
248
|
|
249
249
|
def add_stored_credentials(params, options)
|
250
|
-
if options[:sequence]
|
250
|
+
if options[:sequence] || options[:stored_credential]
|
251
251
|
params[:stored_credentials] = {}
|
252
|
-
params[:stored_credentials][:cardbrand_original_transaction_id] = options
|
253
|
-
params[:stored_credentials][:
|
254
|
-
params[:stored_credentials][:
|
255
|
-
params[:stored_credentials][:is_scheduled] = options[:is_scheduled]
|
252
|
+
params[:stored_credentials][:cardbrand_original_transaction_id] = original_transaction_id(options) if original_transaction_id(options)
|
253
|
+
params[:stored_credentials][:initiator] = initiator(options) if initiator(options)
|
254
|
+
params[:stored_credentials][:sequence] = options[:sequence] || sequence(options[:stored_credential][:initial_transaction])
|
255
|
+
params[:stored_credentials][:is_scheduled] = options[:is_scheduled] || is_scheduled(options[:stored_credential][:reason_type])
|
256
256
|
params[:stored_credentials][:auth_type_override] = options[:auth_type_override] if options[:auth_type_override]
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
260
|
+
def original_transaction_id(options)
|
261
|
+
return options[:cardbrand_original_transaction_id] if options[:cardbrand_original_transaction_id]
|
262
|
+
return options[:stored_credential][:network_transaction_id] if options.dig(:stored_credential, :network_transaction_id)
|
263
|
+
end
|
264
|
+
|
265
|
+
def initiator(options)
|
266
|
+
return options[:initiator] if options[:initiator]
|
267
|
+
return options[:stored_credential][:initiator].upcase if options.dig(:stored_credential, :initiator)
|
268
|
+
end
|
269
|
+
|
270
|
+
def sequence(initial_transaction)
|
271
|
+
initial_transaction ? 'FIRST' : 'SUBSEQUENT'
|
272
|
+
end
|
273
|
+
|
274
|
+
def is_scheduled(reason_type)
|
275
|
+
reason_type == 'recurring' ? 'true' : 'false'
|
276
|
+
end
|
277
|
+
|
260
278
|
def commit(params, options)
|
261
279
|
url = base_url(options) + endpoint(params)
|
262
280
|
|
@@ -278,7 +296,7 @@ module ActiveMerchant
|
|
278
296
|
response,
|
279
297
|
test: test?,
|
280
298
|
authorization: authorization_from(params, response),
|
281
|
-
avs_result: {code: response['avs']},
|
299
|
+
avs_result: { code: response['avs'] },
|
282
300
|
cvv_result: response['cvv2'],
|
283
301
|
error_code: error_code(response, success_from(response))
|
284
302
|
)
|
@@ -295,7 +313,7 @@ module ActiveMerchant
|
|
295
313
|
end
|
296
314
|
|
297
315
|
def endpoint(params)
|
298
|
-
|
316
|
+
store_action?(params) ? '/transactions/tokens' : '/transactions'
|
299
317
|
end
|
300
318
|
|
301
319
|
def api_request(url, params)
|
@@ -306,7 +324,7 @@ module ActiveMerchant
|
|
306
324
|
def post_data(params)
|
307
325
|
return nil unless params
|
308
326
|
|
309
|
-
params.reject { |
|
327
|
+
params.reject { |_k, v| v.blank? }.collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
310
328
|
end
|
311
329
|
|
312
330
|
def generate_hmac(nonce, current_timestamp, payload)
|
@@ -373,7 +391,7 @@ module ActiveMerchant
|
|
373
391
|
end
|
374
392
|
|
375
393
|
def authorization_from(params, response)
|
376
|
-
if
|
394
|
+
if store_action?(params)
|
377
395
|
if success_from(response)
|
378
396
|
[
|
379
397
|
response['token']['type'],
|
@@ -405,7 +423,7 @@ module ActiveMerchant
|
|
405
423
|
end
|
406
424
|
|
407
425
|
def json_error(raw_response)
|
408
|
-
{'error' => "Unable to parse response: #{raw_response.inspect}"}
|
426
|
+
{ 'error' => "Unable to parse response: #{raw_response.inspect}" }
|
409
427
|
end
|
410
428
|
end
|
411
429
|
end
|
@@ -25,18 +25,18 @@ module ActiveMerchant #:nodoc:
|
|
25
25
|
authorize: '3',
|
26
26
|
cancel: '4',
|
27
27
|
failure: '5',
|
28
|
-
capture: '6'
|
28
|
+
capture: '6'
|
29
29
|
}
|
30
30
|
|
31
31
|
SOAP_ACTIONS = {
|
32
32
|
initialize: { name: 'Initialize8', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
|
33
|
-
purchasecc: { name: 'PurchaseCC', url: 'pxconfined/pxorder.asmx', xmlns: 'http://confined.payex.com/PxOrder/', confined: true},
|
33
|
+
purchasecc: { name: 'PurchaseCC', url: 'pxconfined/pxorder.asmx', xmlns: 'http://confined.payex.com/PxOrder/', confined: true },
|
34
34
|
cancel: { name: 'Cancel2', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
|
35
35
|
capture: { name: 'Capture5', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
|
36
36
|
credit: { name: 'Credit5', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
|
37
37
|
create_agreement: { name: 'CreateAgreement3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
|
38
38
|
delete_agreement: { name: 'DeleteAgreement', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
|
39
|
-
autopay: { name: 'AutoPay3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' }
|
39
|
+
autopay: { name: 'AutoPay3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' }
|
40
40
|
}
|
41
41
|
|
42
42
|
def initialize(options = {})
|
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
|
|
117
117
|
# options - A standard ActiveMerchant options hash
|
118
118
|
#
|
119
119
|
# Returns an ActiveMerchant::Billing::Response object
|
120
|
-
def void(authorization, options={})
|
120
|
+
def void(authorization, options = {})
|
121
121
|
send_cancel(authorization)
|
122
122
|
end
|
123
123
|
|
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
|
|
155
155
|
amount = amount(1) # 1 cent for authorization
|
156
156
|
MultiResponse.run(:first) do |r|
|
157
157
|
r.process { send_create_agreement(options) }
|
158
|
-
r.process { send_initialize(amount, true, options.merge({agreement_ref: r.authorization})) }
|
158
|
+
r.process { send_initialize(amount, true, options.merge({ agreement_ref: r.authorization })) }
|
159
159
|
order_ref = r.params['orderref']
|
160
160
|
r.process { send_purchasecc(creditcard, order_ref) }
|
161
161
|
end
|
@@ -231,7 +231,7 @@ module ActiveMerchant #:nodoc:
|
|
231
231
|
description: options[:description] || options[:order_id],
|
232
232
|
orderId: options[:order_id],
|
233
233
|
purchaseOperation: is_auth ? 'AUTHORIZATION' : 'SALE',
|
234
|
-
currency: (options[:currency] || default_currency)
|
234
|
+
currency: (options[:currency] || default_currency)
|
235
235
|
}
|
236
236
|
hash_fields = %i[accountNumber agreementRef price productNumber description orderId purchaseOperation currency]
|
237
237
|
add_request_hash(properties, hash_fields)
|
@@ -278,7 +278,7 @@ module ActiveMerchant #:nodoc:
|
|
278
278
|
def send_cancel(transaction_number)
|
279
279
|
properties = {
|
280
280
|
accountNumber: @options[:account],
|
281
|
-
transactionNumber: transaction_number
|
281
|
+
transactionNumber: transaction_number
|
282
282
|
}
|
283
283
|
hash_fields = %i[accountNumber transactionNumber]
|
284
284
|
add_request_hash(properties, hash_fields)
|
@@ -310,7 +310,7 @@ module ActiveMerchant #:nodoc:
|
|
310
310
|
def send_delete_agreement(authorization)
|
311
311
|
properties = {
|
312
312
|
accountNumber: @options[:account],
|
313
|
-
agreementRef: authorization
|
313
|
+
agreementRef: authorization
|
314
314
|
}
|
315
315
|
hash_fields = %i[accountNumber agreementRef]
|
316
316
|
add_request_hash(properties, hash_fields)
|
@@ -341,9 +341,9 @@ module ActiveMerchant #:nodoc:
|
|
341
341
|
|
342
342
|
def build_xml_request(soap_action, properties)
|
343
343
|
builder = Nokogiri::XML::Builder.new
|
344
|
-
builder.__send__('soap12:Envelope', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
344
|
+
builder.__send__('soap12:Envelope', { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
345
345
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
346
|
-
'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'}) do |root|
|
346
|
+
'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope' }) do |root|
|
347
347
|
root.__send__('soap12:Body') do |body|
|
348
348
|
body.__send__(soap_action[:name], xmlns: soap_action[:xmlns]) do |doc|
|
349
349
|
properties.each do |key, val|
|
@@ -389,8 +389,7 @@ module ActiveMerchant #:nodoc:
|
|
389
389
|
message_from(response),
|
390
390
|
response,
|
391
391
|
test: test?,
|
392
|
-
authorization: build_authorization(response)
|
393
|
-
)
|
392
|
+
authorization: build_authorization(response))
|
394
393
|
end
|
395
394
|
|
396
395
|
def build_authorization(response)
|
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
|
|
45
45
|
commit(build_reference_request(:credit, money, reference, options), options)
|
46
46
|
end
|
47
47
|
|
48
|
-
def verify(payment, options={})
|
48
|
+
def verify(payment, options = {})
|
49
49
|
if credit_card_type(payment) == 'Amex'
|
50
50
|
MultiResponse.run(:use_first_response) do |r|
|
51
51
|
r.process { authorize(100, payment, options) }
|
@@ -154,6 +154,7 @@ module ActiveMerchant #:nodoc:
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
end
|
157
|
+
xml.tag! 'ExtData', 'Name' => 'BUTTONSOURCE', 'Value' => application_id unless application_id.blank?
|
157
158
|
end
|
158
159
|
xml.target!
|
159
160
|
end
|
@@ -187,6 +188,7 @@ module ActiveMerchant #:nodoc:
|
|
187
188
|
add_credit_card(xml, credit_card, options)
|
188
189
|
end
|
189
190
|
end
|
191
|
+
xml.tag! 'ExtData', 'Name' => 'BUTTONSOURCE', 'Value' => application_id unless application_id.blank?
|
190
192
|
end
|
191
193
|
add_level_two_three_fields(xml.target!, options)
|
192
194
|
end
|
@@ -250,6 +252,7 @@ module ActiveMerchant #:nodoc:
|
|
250
252
|
end
|
251
253
|
end
|
252
254
|
end
|
255
|
+
xml.tag! 'ExtData', 'Name' => 'BUTTONSOURCE', 'Value' => application_id unless application_id.blank?
|
253
256
|
end
|
254
257
|
add_level_two_three_fields(xml.target!, options)
|
255
258
|
end
|
@@ -303,8 +303,7 @@ module ActiveMerchant #:nodoc:
|
|
303
303
|
# Return a response
|
304
304
|
PaymentExpressResponse.new(response[:success] == APPROVED, message_from(response), response,
|
305
305
|
test: response[:test_mode] == '1',
|
306
|
-
authorization: authorization_from(action, response)
|
307
|
-
)
|
306
|
+
authorization: authorization_from(action, response))
|
308
307
|
end
|
309
308
|
|
310
309
|
# Response XML documentation: http://www.paymentexpress.com/technical_resources/ecommerce_nonhosted/pxpost.html#XMLTxnOutput
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
self.supported_countries = %w[MX EC CO BR CL PE]
|
11
11
|
self.default_currency = 'USD'
|
12
|
-
self.supported_cardtypes = %i[visa master american_express diners_club elo alia]
|
12
|
+
self.supported_cardtypes = %i[visa master american_express diners_club elo alia olimpica]
|
13
13
|
|
14
14
|
self.homepage_url = 'https://secure.paymentez.com/'
|
15
15
|
self.display_name = 'Paymentez'
|
@@ -74,14 +74,14 @@ module ActiveMerchant #:nodoc:
|
|
74
74
|
post = {
|
75
75
|
transaction: { id: authorization }
|
76
76
|
}
|
77
|
-
post[:order] = {amount: amount(money).to_f} if money
|
77
|
+
post[:order] = { amount: amount(money).to_f } if money
|
78
78
|
|
79
79
|
commit_transaction('capture', post)
|
80
80
|
end
|
81
81
|
|
82
82
|
def refund(money, authorization, options = {})
|
83
|
-
post = {transaction: {id: authorization}}
|
84
|
-
post[:order] = {amount: amount(money).to_f} if money
|
83
|
+
post = { transaction: { id: authorization } }
|
84
|
+
post[:order] = { amount: amount(money).to_f } if money
|
85
85
|
|
86
86
|
commit_transaction('refund', post)
|
87
87
|
end
|
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def unstore(identification, options = {})
|
116
|
-
post = { card: { token: identification }, user: { id: options[:user_id] }}
|
116
|
+
post = { card: { token: identification }, user: { id: options[:user_id] } }
|
117
117
|
commit_card('delete', post)
|
118
118
|
end
|
119
119
|
|
@@ -175,9 +175,29 @@ module ActiveMerchant #:nodoc:
|
|
175
175
|
extra_params = {}
|
176
176
|
extra_params.merge!(options[:extra_params]) if options[:extra_params]
|
177
177
|
|
178
|
+
add_external_mpi_fields(extra_params, options)
|
179
|
+
|
178
180
|
post['extra_params'] = extra_params unless extra_params.empty?
|
179
181
|
end
|
180
182
|
|
183
|
+
def add_external_mpi_fields(extra_params, options)
|
184
|
+
three_d_secure_options = options[:three_d_secure]
|
185
|
+
return unless three_d_secure_options
|
186
|
+
|
187
|
+
auth_data = {
|
188
|
+
cavv: three_d_secure_options[:cavv],
|
189
|
+
xid: three_d_secure_options[:xid],
|
190
|
+
eci: three_d_secure_options[:eci],
|
191
|
+
version: three_d_secure_options[:version],
|
192
|
+
reference_id: three_d_secure_options[:three_ds_server_trans_id],
|
193
|
+
status: three_d_secure_options[:authentication_response_status] || three_d_secure_options[:directory_response_status]
|
194
|
+
}.compact
|
195
|
+
|
196
|
+
return if auth_data.empty?
|
197
|
+
|
198
|
+
extra_params[:auth_data] = auth_data
|
199
|
+
end
|
200
|
+
|
181
201
|
def parse(body)
|
182
202
|
JSON.parse(body)
|
183
203
|
end
|
@@ -194,7 +214,7 @@ module ActiveMerchant #:nodoc:
|
|
194
214
|
begin
|
195
215
|
parse(raw_response)
|
196
216
|
rescue JSON::ParserError
|
197
|
-
{'status' => 'Internal server error'}
|
217
|
+
{ 'status' => 'Internal server error' }
|
198
218
|
end
|
199
219
|
end
|
200
220
|
|
@@ -17,7 +17,7 @@ module ActiveMerchant #:nodoc:
|
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
20
|
-
def purchase(money, payment_method, options={})
|
20
|
+
def purchase(money, payment_method, options = {})
|
21
21
|
action_with_token(:purchase, money, payment_method, options)
|
22
22
|
end
|
23
23
|
|
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
|
|
35
35
|
commit(:post, 'transactions', post)
|
36
36
|
end
|
37
37
|
|
38
|
-
def refund(money, authorization, options={})
|
38
|
+
def refund(money, authorization, options = {})
|
39
39
|
post = {}
|
40
40
|
|
41
41
|
post[:amount] = amount(money)
|
@@ -43,11 +43,11 @@ module ActiveMerchant #:nodoc:
|
|
43
43
|
commit(:post, "refunds/#{transaction_id(authorization)}", post)
|
44
44
|
end
|
45
45
|
|
46
|
-
def void(authorization, options={})
|
46
|
+
def void(authorization, options = {})
|
47
47
|
commit(:delete, "preauthorizations/#{preauth(authorization)}")
|
48
48
|
end
|
49
49
|
|
50
|
-
def store(credit_card, options={})
|
50
|
+
def store(credit_card, options = {})
|
51
51
|
# The store request requires a currency and amount of at least $1 USD.
|
52
52
|
# This is used for an authorization that is handled internally by Paymill.
|
53
53
|
options[:currency] = 'USD'
|
@@ -94,7 +94,7 @@ module ActiveMerchant #:nodoc:
|
|
94
94
|
{ 'Authorization' => ('Basic ' + Base64.strict_encode64("#{@options[:private_key]}:X").chomp) }
|
95
95
|
end
|
96
96
|
|
97
|
-
def commit(method, action, parameters=nil)
|
97
|
+
def commit(method, action, parameters = nil)
|
98
98
|
begin
|
99
99
|
raw_response = ssl_request(method, live_url + action, post_data(parameters), headers)
|
100
100
|
rescue ResponseError => e
|
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
|
|
113
113
|
parsed = JSON.parse(raw_response)
|
114
114
|
options = {
|
115
115
|
authorization: authorization_from(parsed),
|
116
|
-
test: (parsed['mode'] == 'test')
|
116
|
+
test: (parsed['mode'] == 'test')
|
117
117
|
}
|
118
118
|
|
119
119
|
succeeded = (parsed['data'] == []) || (parsed['data']['response_code'].to_i == 20000)
|
@@ -198,7 +198,7 @@ module ActiveMerchant #:nodoc:
|
|
198
198
|
def post_data(params)
|
199
199
|
return nil unless params
|
200
200
|
|
201
|
-
no_blanks = params.reject { |
|
201
|
+
no_blanks = params.reject { |_key, value| value.blank? }
|
202
202
|
no_blanks.map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
203
203
|
end
|
204
204
|
|
@@ -328,7 +328,7 @@ module ActiveMerchant #:nodoc:
|
|
328
328
|
class ResponseParser
|
329
329
|
attr_reader :raw_response, :parsed, :succeeded, :message, :options
|
330
330
|
|
331
|
-
def initialize(raw_response='', options={})
|
331
|
+
def initialize(raw_response = '', options = {})
|
332
332
|
@raw_response = raw_response
|
333
333
|
@options = options
|
334
334
|
end
|
@@ -357,10 +357,10 @@ module ActiveMerchant #:nodoc:
|
|
357
357
|
|
358
358
|
def handle_response_correct_parsing
|
359
359
|
@message = parsed['transaction']['processing']['return']['message']
|
360
|
-
@options[:authorization] = parsed['transaction']['identification']['uniqueId'] if @succeeded =
|
360
|
+
@options[:authorization] = parsed['transaction']['identification']['uniqueId'] if @succeeded = ack?
|
361
361
|
end
|
362
362
|
|
363
|
-
def
|
363
|
+
def ack?
|
364
364
|
parsed['transaction']['processing']['result'] == 'ACK'
|
365
365
|
end
|
366
366
|
end
|
@@ -58,7 +58,7 @@ module ActiveMerchant #:nodoc:
|
|
58
58
|
xml = Builder::XmlMarkup.new indent: 2
|
59
59
|
xml.tag! transaction_type + 'Req', 'xmlns' => PAYPAL_NAMESPACE do
|
60
60
|
xml.tag! transaction_type + 'Request', 'xmlns:n2' => EBAY_NAMESPACE do
|
61
|
-
xml.tag! 'n2:Version',
|
61
|
+
xml.tag! 'n2:Version', api_version(options)
|
62
62
|
xml.tag! 'n2:' + transaction_type + 'RequestDetails' do
|
63
63
|
xml.tag! 'n2:ReferenceID', reference_id if transaction_type == 'DoReferenceTransaction'
|
64
64
|
xml.tag! 'n2:PaymentAction', action
|
@@ -73,6 +73,12 @@ module ActiveMerchant #:nodoc:
|
|
73
73
|
xml.target!
|
74
74
|
end
|
75
75
|
|
76
|
+
def api_version(options)
|
77
|
+
return API_VERSION_3DS2 if options.dig(:three_d_secure, :version) =~ /^2/
|
78
|
+
|
79
|
+
API_VERSION
|
80
|
+
end
|
81
|
+
|
76
82
|
def add_credit_card(xml, credit_card, address, options)
|
77
83
|
xml.tag! 'n2:CreditCard' do
|
78
84
|
xml.tag! 'n2:CreditCardType', credit_card_type(card_brand(credit_card))
|
@@ -104,10 +110,12 @@ module ActiveMerchant #:nodoc:
|
|
104
110
|
three_d_secure = options[:three_d_secure]
|
105
111
|
xml.tag! 'ThreeDSecureRequest' do
|
106
112
|
xml.tag! 'MpiVendor3ds', 'Y'
|
107
|
-
xml.tag! 'AuthStatus3ds', three_d_secure[:trans_status]
|
113
|
+
xml.tag! 'AuthStatus3ds', three_d_secure[:authentication_response_status] || three_d_secure[:trans_status] if three_d_secure[:authentication_response_status] || three_d_secure[:trans_status]
|
108
114
|
xml.tag! 'Cavv', three_d_secure[:cavv] unless three_d_secure[:cavv].blank?
|
109
115
|
xml.tag! 'Eci3ds', three_d_secure[:eci] unless three_d_secure[:eci].blank?
|
110
116
|
xml.tag! 'Xid', three_d_secure[:xid] unless three_d_secure[:xid].blank?
|
117
|
+
xml.tag! 'ThreeDSVersion', three_d_secure[:version] unless three_d_secure[:version].blank?
|
118
|
+
xml.tag! 'DSTransactionId', three_d_secure[:ds_transaction_id] unless three_d_secure[:ds_transaction_id].blank?
|
111
119
|
end
|
112
120
|
end
|
113
121
|
|