activemerchant 1.114.0 → 1.120.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +183 -0
- data/README.md +4 -2
- data/lib/active_merchant.rb +1 -1
- data/lib/active_merchant/billing/avs_result.rb +1 -1
- data/lib/active_merchant/billing/check.rb +10 -0
- data/lib/active_merchant/billing/compatibility.rb +3 -3
- data/lib/active_merchant/billing/credit_card.rb +3 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +80 -15
- data/lib/active_merchant/billing/gateways/adyen.rb +44 -20
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -12
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +5 -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 +22 -18
- 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 +60 -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 +7 -7
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +7 -2
- 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 +38 -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 +39 -23
- 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 +81 -39
- data/lib/active_merchant/billing/gateways/d_local.rb +12 -12
- data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
- data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
- data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
- data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
- data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
- data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
- data/lib/active_merchant/billing/gateways/elavon.rb +296 -225
- data/lib/active_merchant/billing/gateways/element.rb +8 -8
- data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
- data/lib/active_merchant/billing/gateways/eway.rb +3 -4
- data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
- data/lib/active_merchant/billing/gateways/exact.rb +8 -9
- data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
- data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +26 -8
- data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
- data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
- data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
- data/lib/active_merchant/billing/gateways/hps.rb +72 -9
- 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 +32 -16
- data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +9 -9
- 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 +45 -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 +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 +225 -105
- 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 +62 -20
- 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 +11 -7
- data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
- data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
- data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
- data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
- data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
- data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
- data/lib/active_merchant/billing/gateways/payway.rb +8 -9
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +11 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
- data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +31 -17
- data/lib/active_merchant/billing/gateways/realex.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +105 -9
- data/lib/active_merchant/billing/gateways/s5.rb +7 -7
- data/lib/active_merchant/billing/gateways/safe_charge.rb +51 -18
- 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 +18 -18
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +91 -25
- 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/vpos.rb +172 -0
- 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 +43 -22
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
- data/lib/active_merchant/billing/response.rb +3 -2
- data/lib/active_merchant/country.rb +1 -1
- data/lib/active_merchant/network_connection_retries.rb +2 -2
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/certs/cacert.pem +1582 -2431
- data/lib/support/ssl_verify.rb +2 -2
- data/lib/support/ssl_version.rb +2 -2
- metadata +5 -3
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
|
|
11
11
|
self.homepage_url = 'http://www.cardsave.net/'
|
12
12
|
self.display_name = 'CardSave'
|
13
13
|
|
14
|
-
def initialize(options={})
|
14
|
+
def initialize(options = {})
|
15
15
|
super
|
16
16
|
@test_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
|
17
17
|
@live_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
|
@@ -203,7 +203,7 @@ module ActiveMerchant #:nodoc:
|
|
203
203
|
commit('CANCEL', post)
|
204
204
|
end
|
205
205
|
|
206
|
-
def verify(creditcard, options={})
|
206
|
+
def verify(creditcard, options = {})
|
207
207
|
MultiResponse.run(:use_first_response) do |r|
|
208
208
|
r.process { authorize(100, creditcard, options) }
|
209
209
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -282,7 +282,7 @@ module ActiveMerchant #:nodoc:
|
|
282
282
|
add_pair(post, :threeDSRequired, options[:threeds_required] || @threeds_required ? 'Y' : 'N')
|
283
283
|
end
|
284
284
|
|
285
|
-
def add_remote_address(post, options={})
|
285
|
+
def add_remote_address(post, options = {})
|
286
286
|
add_pair(post, :remoteAddress, options[:ip] || '1.1.1.1')
|
287
287
|
end
|
288
288
|
|
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
|
30
|
-
def initialize(options={})
|
30
|
+
def initialize(options = {})
|
31
31
|
requires!(options, :api_key)
|
32
32
|
super
|
33
33
|
end
|
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
|
|
37
37
|
# - check
|
38
38
|
# - cardknox token, which is returned in the the authorization string "ref_num;token;command"
|
39
39
|
|
40
|
-
def purchase(amount, source, options={})
|
40
|
+
def purchase(amount, source, options = {})
|
41
41
|
post = {}
|
42
42
|
add_amount(post, amount, options)
|
43
43
|
add_invoice(post, options)
|
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
commit(:purchase, source_type(source), post)
|
49
49
|
end
|
50
50
|
|
51
|
-
def authorize(amount, source, options={})
|
51
|
+
def authorize(amount, source, options = {})
|
52
52
|
post = {}
|
53
53
|
add_amount(post, amount)
|
54
54
|
add_invoice(post, options)
|
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
|
|
66
66
|
commit(:capture, source_type(authorization), post)
|
67
67
|
end
|
68
68
|
|
69
|
-
def refund(amount, authorization, options={})
|
69
|
+
def refund(amount, authorization, options = {})
|
70
70
|
post = {}
|
71
71
|
add_reference(post, authorization)
|
72
72
|
add_amount(post, amount)
|
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
|
|
79
79
|
commit(:void, source_type(authorization), post)
|
80
80
|
end
|
81
81
|
|
82
|
-
def verify(credit_card, options={})
|
82
|
+
def verify(credit_card, options = {})
|
83
83
|
MultiResponse.run(:use_first_response) do |r|
|
84
84
|
r.process { authorize(100, credit_card, options) }
|
85
85
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -276,7 +276,7 @@ module ActiveMerchant #:nodoc:
|
|
276
276
|
amount: fields['xAuthAmount'],
|
277
277
|
masked_card_num: fields['xMaskedCardNumber'],
|
278
278
|
masked_account_number: fields['MaskedAccountNumber']
|
279
|
-
}.delete_if { |
|
279
|
+
}.delete_if { |_k, v| v.nil? }
|
280
280
|
end
|
281
281
|
|
282
282
|
def commit(action, source_type, parameters)
|
@@ -320,7 +320,7 @@ module ActiveMerchant #:nodoc:
|
|
320
320
|
initial_parameters[:Hash] = "s/#{seed}/#{hash}/n" unless @options[:pin].blank?
|
321
321
|
parameters = initial_parameters.merge(parameters)
|
322
322
|
|
323
|
-
parameters.reject { |
|
323
|
+
parameters.reject { |_k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
324
324
|
end
|
325
325
|
end
|
326
326
|
end
|
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
|
|
26
26
|
# * <tt>:user_id</tt> -- The CardProcess user ID
|
27
27
|
# * <tt>:password</tt> -- The CardProcess password
|
28
28
|
# * <tt>:entity_id</tt> -- The CardProcess channel or entity ID for any transactions
|
29
|
-
def initialize(options={})
|
29
|
+
def initialize(options = {})
|
30
30
|
requires!(options, :user_id, :password, :entity_id)
|
31
31
|
super
|
32
32
|
# This variable exists purely to allow remote tests to force error codes;
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
self.supported_countries = ['US']
|
10
10
|
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
11
|
-
self.homepage_url = '
|
11
|
+
self.homepage_url = 'https://transactcampus.com'
|
12
12
|
self.display_name = 'Cashnet'
|
13
13
|
self.money_format = :dollars
|
14
14
|
self.max_retries = 0
|
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
|
|
76
76
|
|
77
77
|
return unparsable_response(raw_response) unless parsed_response
|
78
78
|
|
79
|
-
success = (parsed_response
|
79
|
+
success = success?(parsed_response)
|
80
80
|
Response.new(
|
81
81
|
success,
|
82
82
|
CASHNET_CODES[parsed_response[:result]],
|
@@ -86,6 +86,10 @@ module ActiveMerchant #:nodoc:
|
|
86
86
|
)
|
87
87
|
end
|
88
88
|
|
89
|
+
def success?(response)
|
90
|
+
response[:result] == '0'
|
91
|
+
end
|
92
|
+
|
89
93
|
def post_data(action, parameters = {})
|
90
94
|
post = {}
|
91
95
|
post[:command] = action
|
@@ -191,6 +195,7 @@ module ActiveMerchant #:nodoc:
|
|
191
195
|
'215' => 'Old PIN does not validate ',
|
192
196
|
'221' => 'Invalid credit card processor type specified in location or payment code',
|
193
197
|
'222' => 'Credit card processor error',
|
198
|
+
'230' => 'Host Error (USE VOID OR REVERSAL TO REFUND UNSETTLED TRANSACTIONS)',
|
194
199
|
'280' => 'SmartPay transaction not posted',
|
195
200
|
'301' => 'Original transaction not found for this customer',
|
196
201
|
'302' => 'Amount to refund exceeds original payment amount or is missing',
|
@@ -21,7 +21,7 @@ module ActiveMerchant #:nodoc:
|
|
21
21
|
CECA_UI_LESS_REFUND_PAGE = 'anulacion_xml'
|
22
22
|
CECA_ACTION_REFUND = 'anulaciones/anularParcial' # use partial refund's URL to avoid time frame limitations and decision logic on client side
|
23
23
|
CECA_ACTION_PURCHASE = 'tpv/compra'
|
24
|
-
CECA_CURRENCIES_DICTIONARY = {'EUR' => 978, 'USD' => 840, 'GBP' => 826}
|
24
|
+
CECA_CURRENCIES_DICTIONARY = { 'EUR' => 978, 'USD' => 840, 'GBP' => 826 }
|
25
25
|
|
26
26
|
# Creates a new CecabankGateway
|
27
27
|
#
|
@@ -57,14 +57,14 @@ module ActiveMerchant #:nodoc:
|
|
57
57
|
def purchase(money, creditcard, options = {})
|
58
58
|
requires!(options, :order_id)
|
59
59
|
|
60
|
-
post = {'Descripcion' => options[:description],
|
60
|
+
post = { 'Descripcion' => options[:description],
|
61
61
|
'Num_operacion' => options[:order_id],
|
62
62
|
'Idioma' => CECA_UI_LESS_LANGUAGE,
|
63
63
|
'Pago_soportado' => CECA_MODE,
|
64
64
|
'URL_OK' => CECA_NOTIFICATIONS_URL,
|
65
65
|
'URL_NOK' => CECA_NOTIFICATIONS_URL,
|
66
66
|
'Importe' => amount(money),
|
67
|
-
'TipoMoneda' => CECA_CURRENCIES_DICTIONARY[options[:currency] || currency(money)]}
|
67
|
+
'TipoMoneda' => CECA_CURRENCIES_DICTIONARY[options[:currency] || currency(money)] }
|
68
68
|
|
69
69
|
add_creditcard(post, creditcard)
|
70
70
|
|
@@ -84,12 +84,12 @@ module ActiveMerchant #:nodoc:
|
|
84
84
|
def refund(money, identification, options = {})
|
85
85
|
reference, order_id = split_authorization(identification)
|
86
86
|
|
87
|
-
post = {'Referencia' => reference,
|
87
|
+
post = { 'Referencia' => reference,
|
88
88
|
'Num_operacion' => order_id,
|
89
89
|
'Idioma' => CECA_UI_LESS_LANGUAGE_REFUND,
|
90
90
|
'Pagina' => CECA_UI_LESS_REFUND_PAGE,
|
91
91
|
'Importe' => amount(money),
|
92
|
-
'TipoMoneda' => CECA_CURRENCIES_DICTIONARY[options[:currency] || currency(money)]}
|
92
|
+
'TipoMoneda' => CECA_CURRENCIES_DICTIONARY[options[:currency] || currency(money)] }
|
93
93
|
|
94
94
|
commit(CECA_ACTION_REFUND, post)
|
95
95
|
end
|
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
self.money_format = :dollars
|
14
14
|
self.supported_cardtypes = %i[visa master american_express discover]
|
15
15
|
|
16
|
-
def initialize(options={})
|
16
|
+
def initialize(options = {})
|
17
17
|
requires!(options, :merchant_id, :password, :user_id)
|
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('Sale', 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('Auth', 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,7 +45,7 @@ module ActiveMerchant #:nodoc:
|
|
45
45
|
commit('SpecialForce', post)
|
46
46
|
end
|
47
47
|
|
48
|
-
def void(authorization, options={})
|
48
|
+
def void(authorization, options = {})
|
49
49
|
post = {}
|
50
50
|
add_void_required_elements(post)
|
51
51
|
add_reference(post, authorization)
|
@@ -56,7 +56,7 @@ module ActiveMerchant #:nodoc:
|
|
56
56
|
commit('Void', post)
|
57
57
|
end
|
58
58
|
|
59
|
-
def refund(amount, authorization, options={})
|
59
|
+
def refund(amount, authorization, options = {})
|
60
60
|
post = {}
|
61
61
|
add_invoice(post, amount, options)
|
62
62
|
add_reference(post, authorization)
|
@@ -65,7 +65,7 @@ module ActiveMerchant #:nodoc:
|
|
65
65
|
commit('SpecialReturn', post)
|
66
66
|
end
|
67
67
|
|
68
|
-
def credit(amount, payment_method, options={})
|
68
|
+
def credit(amount, payment_method, options = {})
|
69
69
|
post = {}
|
70
70
|
add_invoice(post, amount, options)
|
71
71
|
add_payment_method(post, payment_method)
|
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
|
|
73
73
|
commit('Credit', post)
|
74
74
|
end
|
75
75
|
|
76
|
-
def verify(credit_card, options={})
|
76
|
+
def verify(credit_card, options = {})
|
77
77
|
MultiResponse.run(:use_first_response) do |r|
|
78
78
|
r.process { authorize(100, credit_card, options) }
|
79
79
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -198,7 +198,7 @@ module ActiveMerchant #:nodoc:
|
|
198
198
|
end
|
199
199
|
|
200
200
|
def envelope(body)
|
201
|
-
<<~
|
201
|
+
<<~XML
|
202
202
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:acr="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.Common" xmlns:acr1="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.v6.Common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
203
203
|
<soapenv:Header/>
|
204
204
|
<soapenv:Body>
|
@@ -209,7 +209,7 @@ module ActiveMerchant #:nodoc:
|
|
209
209
|
</tem:ProcessCreditCard>
|
210
210
|
</soapenv:Body>
|
211
211
|
</soapenv:Envelope>
|
212
|
-
|
212
|
+
XML
|
213
213
|
end
|
214
214
|
|
215
215
|
def parse(xml)
|
@@ -83,7 +83,7 @@ module ActiveMerchant #:nodoc:
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
def verify(credit_card, options={})
|
86
|
+
def verify(credit_card, options = {})
|
87
87
|
MultiResponse.run(:use_first_response) do |r|
|
88
88
|
r.process { authorize(100, credit_card, options) }
|
89
89
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -159,7 +159,7 @@ module ActiveMerchant #:nodoc:
|
|
159
159
|
xml.trackid(trackid) if trackid
|
160
160
|
end
|
161
161
|
|
162
|
-
def commit(action, amount=nil, options={}, &builder)
|
162
|
+
def commit(action, amount = nil, options = {}, &builder)
|
163
163
|
response = parse_xml(ssl_post(live_url, build_xml(action, &builder)))
|
164
164
|
Response.new(
|
165
165
|
(response[:responsecode] == '0'),
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.supported_countries = %w[AD AE AR AT AU BE BG BH BR CH CL CN CO CY CZ DE DK EE EG ES FI FR GB GR HK HR HU IE IS IT JO JP KW LI LT LU LV MC MT MX MY NL NO NZ OM PE PL PT QA RO SA SE SG SI SK SM TR US]
|
10
10
|
self.default_currency = 'USD'
|
11
11
|
self.money_format = :cents
|
12
|
-
self.supported_cardtypes = %i[visa master american_express diners_club maestro discover]
|
12
|
+
self.supported_cardtypes = %i[visa master american_express diners_club maestro discover jcb]
|
13
13
|
self.currencies_without_fractions = %w(BIF DJF GNF ISK KMF XAF CLF XPF JPY PYG RWF KRW VUV VND XOF)
|
14
14
|
self.currencies_with_three_decimal_places = %w(BHD LYD JOD KWD OMR TND)
|
15
15
|
|
@@ -19,25 +19,16 @@ module ActiveMerchant #:nodoc:
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def purchase(amount, payment_method, options = {})
|
22
|
-
|
23
|
-
|
24
|
-
r.process { capture(amount, r.authorization, options) }
|
25
|
-
end
|
26
|
-
|
27
|
-
merged_params = multi.responses.map(&:params).reduce({}, :merge)
|
28
|
-
succeeded = success_from(merged_params)
|
22
|
+
post = {}
|
23
|
+
build_auth_or_purchase(post, amount, payment_method, options)
|
29
24
|
|
30
|
-
|
25
|
+
commit(:purchase, post)
|
31
26
|
end
|
32
27
|
|
33
28
|
def authorize(amount, payment_method, options = {})
|
34
29
|
post = {}
|
35
30
|
post[:capture] = false
|
36
|
-
|
37
|
-
add_payment_method(post, payment_method, options)
|
38
|
-
add_customer_data(post, options)
|
39
|
-
add_transaction_data(post, options)
|
40
|
-
add_3ds(post, options)
|
31
|
+
build_auth_or_purchase(post, amount, payment_method, options)
|
41
32
|
|
42
33
|
commit(:authorize, post)
|
43
34
|
end
|
@@ -64,13 +55,10 @@ module ActiveMerchant #:nodoc:
|
|
64
55
|
end
|
65
56
|
|
66
57
|
def verify(credit_card, options = {})
|
67
|
-
|
68
|
-
r.process { authorize(100, credit_card, options) }
|
69
|
-
r.process(:ignore_result) { void(r.authorization, options) }
|
70
|
-
end
|
58
|
+
authorize(0, credit_card, options)
|
71
59
|
end
|
72
60
|
|
73
|
-
def verify_payment(authorization, option={})
|
61
|
+
def verify_payment(authorization, option = {})
|
74
62
|
commit(:verify_payment, authorization)
|
75
63
|
end
|
76
64
|
|
@@ -87,6 +75,15 @@ module ActiveMerchant #:nodoc:
|
|
87
75
|
|
88
76
|
private
|
89
77
|
|
78
|
+
def build_auth_or_purchase(post, amount, payment_method, options)
|
79
|
+
add_invoice(post, amount, options)
|
80
|
+
add_payment_method(post, payment_method, options)
|
81
|
+
add_customer_data(post, options)
|
82
|
+
add_stored_credential_options(post, options)
|
83
|
+
add_transaction_data(post, options)
|
84
|
+
add_3ds(post, options)
|
85
|
+
end
|
86
|
+
|
90
87
|
def add_invoice(post, money, options)
|
91
88
|
post[:amount] = localized_amount(money, options[:currency])
|
92
89
|
post[:reference] = options[:order_id]
|
@@ -142,12 +139,33 @@ module ActiveMerchant #:nodoc:
|
|
142
139
|
post[:previous_payment_id] = options[:previous_charge_id] if options[:previous_charge_id]
|
143
140
|
end
|
144
141
|
|
142
|
+
def add_stored_credential_options(post, options = {})
|
143
|
+
return unless options[:stored_credential]
|
144
|
+
|
145
|
+
case options[:stored_credential][:initial_transaction]
|
146
|
+
when true
|
147
|
+
post[:merchant_initiated] = false
|
148
|
+
when false
|
149
|
+
post[:'source.stored'] = true
|
150
|
+
post[:previous_payment_id] = options[:stored_credential][:network_transaction_id] if options[:stored_credential][:network_transaction_id]
|
151
|
+
post[:merchant_initiated] = true
|
152
|
+
end
|
153
|
+
|
154
|
+
case options[:stored_credential][:reason_type]
|
155
|
+
when 'recurring' || 'installment'
|
156
|
+
post[:payment_type] = 'Recurring'
|
157
|
+
when 'unscheduled'
|
158
|
+
return
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
145
162
|
def add_3ds(post, options)
|
146
163
|
if options[:three_d_secure] || options[:execute_threed]
|
147
164
|
post[:'3ds'] = {}
|
148
165
|
post[:'3ds'][:enabled] = true
|
149
166
|
post[:success_url] = options[:callback_url] if options[:callback_url]
|
150
167
|
post[:failure_url] = options[:callback_url] if options[:callback_url]
|
168
|
+
post[:'3ds'][:attempt_n3d] = options[:attempt_n3d] if options[:attempt_n3d]
|
151
169
|
end
|
152
170
|
|
153
171
|
if options[:three_d_secure]
|
@@ -199,7 +217,7 @@ module ActiveMerchant #:nodoc:
|
|
199
217
|
end
|
200
218
|
|
201
219
|
def url(_post, action, authorization)
|
202
|
-
if action
|
220
|
+
if %i[authorize purchase].include?(action)
|
203
221
|
"#{base_url}/payments"
|
204
222
|
elsif action == :capture
|
205
223
|
"#{base_url}/payments/#{authorization}/captures"
|
@@ -36,20 +36,20 @@ module ActiveMerchant #:nodoc:
|
|
36
36
|
50000 => 'Clearhaus error'
|
37
37
|
}
|
38
38
|
|
39
|
-
def initialize(options={})
|
39
|
+
def initialize(options = {})
|
40
40
|
requires!(options, :api_key)
|
41
41
|
options[:private_key] = options[:private_key].strip if options[:private_key]
|
42
42
|
super
|
43
43
|
end
|
44
44
|
|
45
|
-
def purchase(amount, payment, options={})
|
45
|
+
def purchase(amount, payment, options = {})
|
46
46
|
MultiResponse.run(:use_first_response) do |r|
|
47
47
|
r.process { authorize(amount, payment, options) }
|
48
48
|
r.process { capture(amount, r.authorization, options) }
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
def authorize(amount, payment, options={})
|
52
|
+
def authorize(amount, payment, options = {})
|
53
53
|
post = {}
|
54
54
|
add_invoice(post, amount, options)
|
55
55
|
|
@@ -69,14 +69,14 @@ module ActiveMerchant #:nodoc:
|
|
69
69
|
commit(action, post)
|
70
70
|
end
|
71
71
|
|
72
|
-
def capture(amount, authorization, options={})
|
72
|
+
def capture(amount, authorization, options = {})
|
73
73
|
post = {}
|
74
74
|
add_invoice(post, amount, options)
|
75
75
|
|
76
76
|
commit("/authorizations/#{authorization}/captures", post)
|
77
77
|
end
|
78
78
|
|
79
|
-
def refund(amount, authorization, options={})
|
79
|
+
def refund(amount, authorization, options = {})
|
80
80
|
post = {}
|
81
81
|
add_amount(post, amount, options)
|
82
82
|
|
@@ -87,14 +87,14 @@ module ActiveMerchant #:nodoc:
|
|
87
87
|
commit("/authorizations/#{authorization}/voids", options)
|
88
88
|
end
|
89
89
|
|
90
|
-
def verify(credit_card, options={})
|
90
|
+
def verify(credit_card, options = {})
|
91
91
|
MultiResponse.run(:use_first_response) do |r|
|
92
92
|
r.process { authorize(0, credit_card, options) }
|
93
93
|
r.process(:ignore_result) { void(r.authorization, options) }
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
def store(credit_card, options={})
|
97
|
+
def store(credit_card, options = {})
|
98
98
|
post = {}
|
99
99
|
add_payment(post, credit_card)
|
100
100
|
|