activemerchant 1.107.2 → 1.110.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +73 -0
- data/README.md +3 -3
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +1 -1
- data/lib/active_merchant/billing/credit_card.rb +2 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
- data/lib/active_merchant/billing/gateways/adyen.rb +18 -12
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +8 -8
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
- data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
- data/lib/active_merchant/billing/gateways/blue_pay.rb +4 -4
- data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
- data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +84 -35
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/cams.rb +2 -2
- 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 +4 -4
- data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
- data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
- data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +4 -4
- data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
- data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
- data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
- data/lib/active_merchant/billing/gateways/credorax.rb +7 -3
- data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
- data/lib/active_merchant/billing/gateways/cyber_source.rb +72 -23
- data/lib/active_merchant/billing/gateways/d_local.rb +24 -8
- data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
- data/lib/active_merchant/billing/gateways/decidir.rb +24 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
- data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +6 -4
- data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
- data/lib/active_merchant/billing/gateways/elavon.rb +56 -9
- data/lib/active_merchant/billing/gateways/element.rb +16 -8
- data/lib/active_merchant/billing/gateways/epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
- data/lib/active_merchant/billing/gateways/exact.rb +3 -3
- data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +5 -5
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +12 -4
- data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
- data/lib/active_merchant/billing/gateways/forte.rb +9 -8
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/global_collect.rb +5 -5
- data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
- data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
- data/lib/active_merchant/billing/gateways/hps.rb +3 -3
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
- data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
- data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
- data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
- data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
- data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
- data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/litle.rb +10 -5
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +12 -6
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
- data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
- data/lib/active_merchant/billing/gateways/monei.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +3 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +51 -23
- data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
- data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
- data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
- data/lib/active_merchant/billing/gateways/omise.rb +1 -1
- data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/opp.rb +2 -2
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
- data/lib/active_merchant/billing/gateways/orbital.rb +49 -7
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
- data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
- data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
- data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
- data/lib/active_merchant/billing/gateways/payex.rb +13 -13
- data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -8
- data/lib/active_merchant/billing/gateways/payway.rb +1 -1
- data/lib/active_merchant/billing/gateways/pin.rb +2 -2
- data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
- data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
- data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
- data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
- data/lib/active_merchant/billing/gateways/realex.rb +11 -4
- data/lib/active_merchant/billing/gateways/redsys.rb +5 -5
- data/lib/active_merchant/billing/gateways/s5.rb +1 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
- data/lib/active_merchant/billing/gateways/sage.rb +3 -3
- data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +13 -8
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +46 -3
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/telr.rb +4 -4
- data/lib/active_merchant/billing/gateways/tns.rb +1 -1
- data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
- data/lib/active_merchant/billing/gateways/transax.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
- data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
- data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
- data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
- data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
- data/lib/active_merchant/connection.rb +40 -42
- data/lib/active_merchant/network_connection_retries.rb +10 -12
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/gateway_support.rb +1 -1
- metadata +36 -36
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class SecurePayTechGateway < Gateway
|
4
4
|
class SecurePayTechPostData < PostData
|
5
|
-
self.required_fields = [
|
5
|
+
self.required_fields = %i[OrderReference CardNumber CardExpiry CardHolderName CardType MerchantID MerchantKey Amount Currency]
|
6
6
|
end
|
7
7
|
|
8
8
|
self.live_url = self.test_url = 'https://tx.securepaytech.com/web/HttpPostPurchase'
|
@@ -21,7 +21,7 @@ module ActiveMerchant #:nodoc:
|
|
21
21
|
|
22
22
|
self.default_currency = 'NZD'
|
23
23
|
self.supported_countries = ['NZ']
|
24
|
-
self.supported_cardtypes = [
|
24
|
+
self.supported_cardtypes = %i[visa master american_express diners_club]
|
25
25
|
self.homepage_url = 'http://www.securepaytech.com/'
|
26
26
|
self.display_name = 'SecurePayTech'
|
27
27
|
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
self.default_currency = 'USD'
|
11
11
|
self.money_format = :cents
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
|
13
13
|
|
14
14
|
self.homepage_url = 'https://securionpay.com/'
|
15
15
|
self.display_name = 'SecurionPay'
|
@@ -160,8 +160,8 @@ module ActiveMerchant #:nodoc:
|
|
160
160
|
'-117' => 'POS Check Invalid Cashier Number'
|
161
161
|
}
|
162
162
|
|
163
|
-
self.supported_countries = [
|
164
|
-
self.supported_cardtypes = [
|
163
|
+
self.supported_countries = %w[US CA]
|
164
|
+
self.supported_cardtypes = %i[visa master american_express jcb discover diners_club]
|
165
165
|
self.homepage_url = 'http://www.skipjack.com/'
|
166
166
|
self.display_name = 'SkipJack'
|
167
167
|
|
@@ -300,9 +300,9 @@ module ActiveMerchant #:nodoc:
|
|
300
300
|
when :authorization
|
301
301
|
parse_authorization_response(body)
|
302
302
|
when :get_status
|
303
|
-
parse_status_response(body, [
|
303
|
+
parse_status_response(body, %i[SerialNumber TransactionAmount TransactionStatusCode TransactionStatusMessage OrderNumber TransactionDateTime TransactionID ApprovalCode BatchNumber])
|
304
304
|
else
|
305
|
-
parse_status_response(body, [
|
305
|
+
parse_status_response(body, %i[SerialNumber TransactionAmount DesiredStatus StatusResponse StatusResponseMessage OrderNumber AuditID])
|
306
306
|
end
|
307
307
|
end
|
308
308
|
|
@@ -329,7 +329,7 @@ module ActiveMerchant #:nodoc:
|
|
329
329
|
def parse_status_response(body, response_keys)
|
330
330
|
lines = split_lines(body)
|
331
331
|
|
332
|
-
keys = [
|
332
|
+
keys = %i[szSerialNumber szErrorCode szNumberRecords]
|
333
333
|
values = split_line(lines[0])[0..2]
|
334
334
|
|
335
335
|
result = Hash[*keys.zip(values).flatten]
|
@@ -4,13 +4,13 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
|
5
5
|
self.money_format = :cents
|
6
6
|
|
7
|
-
self.supported_countries = [
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
self.supported_countries = %w[
|
8
|
+
US CA AT BE BG HR CY CZ DK EE
|
9
|
+
FI FR DE GR HU IE IT LV LT LU
|
10
|
+
MT NL PL PT RO SK SI ES SE GB
|
11
|
+
IS NO CH
|
12
12
|
]
|
13
|
-
self.supported_cardtypes = [
|
13
|
+
self.supported_cardtypes = %i[visa master american_express discover maestro jcb diners_club]
|
14
14
|
self.homepage_url = 'http://www.soeasypay.com/'
|
15
15
|
self.display_name = 'SoEasyPay'
|
16
16
|
|
@@ -149,7 +149,7 @@ module ActiveMerchant #:nodoc:
|
|
149
149
|
def parse(response, action)
|
150
150
|
result = {}
|
151
151
|
document = REXML::Document.new(response)
|
152
|
-
response_element = document.root.get_elements("
|
152
|
+
response_element = document.root.get_elements("//*[@xsi:type='tns:#{action}Response']").first
|
153
153
|
response_element.elements.each do |element|
|
154
154
|
result[element.name.underscore] = element.text
|
155
155
|
end
|
@@ -14,7 +14,7 @@ module ActiveMerchant #:nodoc:
|
|
14
14
|
MT MU MV MX MY NL NO NZ OM PH PL PT QA RO SA SE SG SI SK SM
|
15
15
|
TR TT UM US VA VN ZA)
|
16
16
|
|
17
|
-
self.supported_cardtypes = [
|
17
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
18
18
|
self.homepage_url = 'https://spreedly.com'
|
19
19
|
self.display_name = 'Spreedly'
|
20
20
|
self.money_format = :cents
|
@@ -25,10 +25,10 @@ module ActiveMerchant #:nodoc:
|
|
25
25
|
|
26
26
|
DEFAULT_API_VERSION = '2015-04-07'
|
27
27
|
|
28
|
-
self.supported_countries = %w(AT AU BE BR CA CH DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MX NL NO NZ PL PT SE SG SI SK US)
|
28
|
+
self.supported_countries = %w(AT AU BE BG BR CA CH CY CZ DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MT MX NL NO NZ PL PT RO SE SG SI SK US)
|
29
29
|
self.default_currency = 'USD'
|
30
30
|
self.money_format = :cents
|
31
|
-
self.supported_cardtypes = [
|
31
|
+
self.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro]
|
32
32
|
self.currencies_without_fractions = %w(BIF CLP DJF GNF JPY KMF KRW MGA PYG RWF VND VUV XAF XOF XPF UGX)
|
33
33
|
|
34
34
|
self.homepage_url = 'https://stripe.com/'
|
@@ -80,6 +80,11 @@ module ActiveMerchant #:nodoc:
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def authorize(money, payment, options = {})
|
83
|
+
if ach?(payment)
|
84
|
+
direct_bank_error = 'Direct bank account transactions are not supported for authorize.'
|
85
|
+
return Response.new(false, direct_bank_error)
|
86
|
+
end
|
87
|
+
|
83
88
|
MultiResponse.run do |r|
|
84
89
|
if payment.is_a?(ApplePayPaymentToken)
|
85
90
|
r.process { tokenize_apple_pay_token(payment) }
|
@@ -425,7 +430,7 @@ module ActiveMerchant #:nodoc:
|
|
425
430
|
end
|
426
431
|
|
427
432
|
def add_customer_data(post, options)
|
428
|
-
metadata_options = [
|
433
|
+
metadata_options = %i[description ip user_agent referrer]
|
429
434
|
post.update(options.slice(*metadata_options))
|
430
435
|
|
431
436
|
post[:external_id] = options[:order_id]
|
@@ -447,7 +452,7 @@ module ActiveMerchant #:nodoc:
|
|
447
452
|
|
448
453
|
def add_statement_address(post, options)
|
449
454
|
return unless statement_address = options[:statement_address]
|
450
|
-
return unless [
|
455
|
+
return unless %i[address1 city zip state].all? { |key| statement_address[key].present? }
|
451
456
|
|
452
457
|
post[:statement_address] = {}
|
453
458
|
post[:statement_address][:line1] = statement_address[:address1]
|
@@ -608,7 +613,7 @@ module ActiveMerchant #:nodoc:
|
|
608
613
|
idempotency_key = options[:idempotency_key]
|
609
614
|
|
610
615
|
headers = {
|
611
|
-
'Authorization' => 'Basic ' + Base64.
|
616
|
+
'Authorization' => 'Basic ' + Base64.strict_encode64(key.to_s + ':').strip,
|
612
617
|
'User-Agent' => "Stripe/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
|
613
618
|
'Stripe-Version' => api_version(options),
|
614
619
|
'X-Stripe-Client-User-Agent' => stripe_client_user_agent(options),
|
@@ -647,10 +652,10 @@ module ActiveMerchant #:nodoc:
|
|
647
652
|
add_expand_parameters(parameters, options) if parameters
|
648
653
|
response = api_request(method, url, parameters, options)
|
649
654
|
response['webhook_id'] = options[:webhook_id] if options[:webhook_id]
|
650
|
-
success = success_from(response)
|
655
|
+
success = success_from(response, options)
|
651
656
|
|
652
657
|
card = card_from_response(response)
|
653
|
-
avs_code = AVS_CODE_TRANSLATOR["line1: #{card[
|
658
|
+
avs_code = AVS_CODE_TRANSLATOR["line1: #{card['address_line1_check']}, zip: #{card['address_zip_check']}"]
|
654
659
|
cvc_code = CVC_CODE_TRANSLATOR[card['cvc_check']]
|
655
660
|
|
656
661
|
Response.new(success,
|
@@ -681,7 +686,7 @@ module ActiveMerchant #:nodoc:
|
|
681
686
|
success ? 'Transaction approved' : response.fetch('error', {'message' => 'No error details'})['message']
|
682
687
|
end
|
683
688
|
|
684
|
-
def success_from(response)
|
689
|
+
def success_from(response, options)
|
685
690
|
!response.key?('error') && response['status'] != 'failed'
|
686
691
|
end
|
687
692
|
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
# This gateway uses the current Stripe {Payment Intents API}[https://stripe.com/docs/api/payment_intents].
|
6
6
|
# For the legacy API, see the Stripe gateway
|
7
7
|
class StripePaymentIntentsGateway < StripeGateway
|
8
|
-
self.supported_countries = %w(AT AU BE BR CA CH DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MX NL NO NZ PL PT SE SG SI SK US)
|
8
|
+
self.supported_countries = %w(AT AU BE BG BR CA CH CY CZ DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MT MX NL NO NZ PL PT RO SE SG SI SK US)
|
9
9
|
|
10
10
|
ALLOWED_METHOD_STATES = %w[automatic manual].freeze
|
11
11
|
ALLOWED_CANCELLATION_REASONS = %w[duplicate fraudulent requested_by_customer abandoned].freeze
|
@@ -84,6 +84,21 @@ module ActiveMerchant #:nodoc:
|
|
84
84
|
commit(:post, "payment_intents/#{intent_id}", post, options)
|
85
85
|
end
|
86
86
|
|
87
|
+
def create_setup_intent(payment_method, options = {})
|
88
|
+
post = {}
|
89
|
+
add_customer(post, options)
|
90
|
+
payment_method = add_payment_method_token(post, payment_method, options)
|
91
|
+
return payment_method if payment_method.is_a?(ActiveMerchant::Billing::Response)
|
92
|
+
|
93
|
+
add_metadata(post, options)
|
94
|
+
add_return_url(post, options)
|
95
|
+
post[:on_behalf_of] = options[:on_behalf_of] if options[:on_behalf_of]
|
96
|
+
post[:usage] = options[:usage] if %w(on_session off_session).include?(options[:usage])
|
97
|
+
post[:description] = options[:description] if options[:description]
|
98
|
+
|
99
|
+
commit(:post, 'setup_intents', post, options)
|
100
|
+
end
|
101
|
+
|
87
102
|
def authorize(money, payment_method, options = {})
|
88
103
|
create_intent(money, payment_method, options.merge!(confirm: true, capture_method: 'manual'))
|
89
104
|
end
|
@@ -112,8 +127,22 @@ module ActiveMerchant #:nodoc:
|
|
112
127
|
end
|
113
128
|
|
114
129
|
def refund(money, intent_id, options = {})
|
115
|
-
|
116
|
-
|
130
|
+
if intent_id.include?('pi_')
|
131
|
+
intent = api_request(:get, "payment_intents/#{intent_id}", nil, options)
|
132
|
+
|
133
|
+
return Response.new(false, intent['error']['message'], intent) if intent['error']
|
134
|
+
|
135
|
+
charge_id = intent.try(:[], 'charges').try(:[], 'data').try(:[], 0).try(:[], 'id')
|
136
|
+
|
137
|
+
if charge_id.nil?
|
138
|
+
error_message = "No associated charge for #{intent['id']}"
|
139
|
+
error_message << "; payment_intent has a status of #{intent['status']}" if intent.try(:[], 'status') && intent.try(:[], 'status') != 'succeeded'
|
140
|
+
return Response.new(false, error_message, intent)
|
141
|
+
end
|
142
|
+
else
|
143
|
+
charge_id = intent_id
|
144
|
+
end
|
145
|
+
|
117
146
|
super(money, charge_id, options)
|
118
147
|
end
|
119
148
|
|
@@ -156,6 +185,10 @@ module ActiveMerchant #:nodoc:
|
|
156
185
|
end
|
157
186
|
end
|
158
187
|
|
188
|
+
def verify(payment_method, options = {})
|
189
|
+
create_setup_intent(payment_method, options.merge!(confirm: true))
|
190
|
+
end
|
191
|
+
|
159
192
|
private
|
160
193
|
|
161
194
|
def add_connected_account(post, options = {})
|
@@ -281,6 +314,16 @@ module ActiveMerchant #:nodoc:
|
|
281
314
|
|
282
315
|
options.merge(idempotency_key: "#{options[:idempotency_key]}-#{suffix}")
|
283
316
|
end
|
317
|
+
|
318
|
+
def success_from(response, options)
|
319
|
+
if response['status'] == 'requires_action' && !options[:execute_threed]
|
320
|
+
response['error'] = {}
|
321
|
+
response['error']['message'] = 'Received unexpected 3DS authentication response. Use the execute_threed option to initiate a proper 3DS flow.'
|
322
|
+
return false
|
323
|
+
end
|
324
|
+
|
325
|
+
super(response, options)
|
326
|
+
end
|
284
327
|
end
|
285
328
|
end
|
286
329
|
end
|
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
|
14
14
|
self.supported_countries = %w[NZ CA]
|
15
15
|
self.default_currency = 'NZD'
|
16
|
-
self.supported_cardtypes = [
|
16
|
+
self.supported_cardtypes = %i[visa master]
|
17
17
|
self.homepage_url = 'https://www.swipehq.com/checkout'
|
18
18
|
self.display_name = 'Swipe Checkout'
|
19
19
|
self.money_format = :dollars
|
@@ -8,10 +8,10 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
self.live_url = 'https://secure.telr.com/gateway/remote.xml'
|
10
10
|
|
11
|
-
self.supported_countries = [
|
11
|
+
self.supported_countries = %w[AE IN SA]
|
12
12
|
self.default_currency = 'AED'
|
13
13
|
self.money_format = :dollars
|
14
|
-
self.supported_cardtypes = [
|
14
|
+
self.supported_cardtypes = %i[visa master american_express maestro jcb]
|
15
15
|
|
16
16
|
CVC_CODE_TRANSLATOR = {
|
17
17
|
'Y' => 'M',
|
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
|
|
78
78
|
|
79
79
|
def verify_credentials
|
80
80
|
response = void('0')
|
81
|
-
|
81
|
+
!%w[01 04].include?(response.error_code)
|
82
82
|
end
|
83
83
|
|
84
84
|
def supports_scrubbing?
|
@@ -149,7 +149,7 @@ module ActiveMerchant #:nodoc:
|
|
149
149
|
end
|
150
150
|
|
151
151
|
def add_ref(doc, action, payment_method)
|
152
|
-
doc.ref(split_authorization(payment_method)[0]) if [
|
152
|
+
doc.ref(split_authorization(payment_method)[0]) if %w[capture refund void].include?(action) || payment_method.is_a?(String)
|
153
153
|
end
|
154
154
|
|
155
155
|
def add_authentication(doc)
|
@@ -20,7 +20,7 @@ module ActiveMerchant
|
|
20
20
|
self.homepage_url = 'http://www.tnsi.com/'
|
21
21
|
self.supported_countries = %w(AR AU BR FR DE HK MX NZ SG GB US)
|
22
22
|
self.default_currency = 'USD'
|
23
|
-
self.supported_cardtypes = [
|
23
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
self.live_url = 'https://webservices.primerchants.com'
|
6
6
|
|
7
7
|
self.supported_countries = ['US']
|
8
|
-
self.supported_cardtypes = [
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
9
9
|
self.homepage_url = 'http://www.transfirst.com/'
|
10
10
|
self.display_name = 'TransFirst'
|
11
11
|
|
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
|
|
60
60
|
def void(authorization, options={})
|
61
61
|
post = {}
|
62
62
|
|
63
|
-
transaction_id,
|
63
|
+
transaction_id, = split_authorization(authorization)
|
64
64
|
add_pair(post, :TransID, transaction_id)
|
65
65
|
|
66
66
|
commit(:void, post)
|
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
self.supported_countries = ['US']
|
13
13
|
self.default_currency = 'USD'
|
14
14
|
self.money_format = :cents
|
15
|
-
self.supported_cardtypes = [
|
15
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club]
|
16
16
|
|
17
17
|
V1_NAMESPACE = 'http://postilion/realtime/merchantframework/xsd/v1/'
|
18
18
|
SOAPENV_NAMESPACE = 'http://schemas.xmlsoap.org/soap/envelope/'
|
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
self.supported_countries = ['US']
|
13
13
|
self.default_currency = 'USD'
|
14
14
|
self.money_format = :cents
|
15
|
-
self.supported_cardtypes = [
|
15
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
16
16
|
|
17
17
|
self.homepage_url = 'https://www.transactpro.lv/business/online-payments-acceptance'
|
18
18
|
self.display_name = 'Transact Pro'
|
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def parse(body)
|
165
|
-
if
|
165
|
+
if /^ID:/.match?(body)
|
166
166
|
body.split('~').reduce(Hash.new) { |h, v|
|
167
167
|
m = v.match('(.*?):(.*)')
|
168
168
|
h.merge!(m[1].underscore.to_sym => m[2])
|
@@ -197,7 +197,7 @@ module ActiveMerchant #:nodoc:
|
|
197
197
|
end
|
198
198
|
|
199
199
|
def split_authorization(authorization)
|
200
|
-
if authorization
|
200
|
+
if /|/.match?(authorization)
|
201
201
|
identifier, amount = authorization.split('|')
|
202
202
|
[identifier, amount.to_i]
|
203
203
|
else
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.supported_countries = ['US']
|
10
10
|
|
11
11
|
# The card types supported by the payment gateway
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
13
13
|
|
14
14
|
# The homepage URL of the gateway
|
15
15
|
self.homepage_url = 'https://www.nelixtransax.com/'
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
10
10
|
GI GR HK HU ID IE IL IM IN IS IT JO KW LB LI LK LT LU LV MC
|
11
11
|
MT MU MV MX MY NL NO NZ OM PH PL PT QA RO SA SE SG SI SK SM
|
12
12
|
TR TT UM US VA VN ZA)
|
13
|
-
self.supported_cardtypes = [
|
13
|
+
self.supported_cardtypes = %i[visa master american_express]
|
14
14
|
self.homepage_url = 'https://trexle.com'
|
15
15
|
self.display_name = 'Trexle'
|
16
16
|
|
@@ -137,7 +137,7 @@ module ActiveMerchant #:nodoc:
|
|
137
137
|
name: creditcard.name
|
138
138
|
)
|
139
139
|
elsif creditcard.kind_of?(String)
|
140
|
-
if
|
140
|
+
if /^token_/.match?(creditcard)
|
141
141
|
post[:card_token] = creditcard
|
142
142
|
else
|
143
143
|
post[:customer_token] = creditcard
|
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
|
|
67
67
|
class TrustCommerceGateway < Gateway
|
68
68
|
self.live_url = self.test_url = 'https://vault.trustcommerce.com/trans/'
|
69
69
|
|
70
|
-
SUCCESS_TYPES = [
|
70
|
+
SUCCESS_TYPES = %w[approved accepted]
|
71
71
|
|
72
72
|
DECLINE_CODES = {
|
73
73
|
'decline' => 'The credit card was declined',
|
@@ -107,7 +107,7 @@ module ActiveMerchant #:nodoc:
|
|
107
107
|
VOIDABLE_ACTIONS = %w(preauth sale postauth credit)
|
108
108
|
|
109
109
|
self.money_format = :cents
|
110
|
-
self.supported_cardtypes = [
|
110
|
+
self.supported_cardtypes = %i[visa master discover american_express diners_club jcb]
|
111
111
|
self.supported_countries = ['US']
|
112
112
|
self.homepage_url = 'http://www.trustcommerce.com/'
|
113
113
|
self.display_name = 'TrustCommerce'
|
@@ -185,7 +185,7 @@ module ActiveMerchant #:nodoc:
|
|
185
185
|
# postauth, we preserve active_merchant's nomenclature of capture() for consistency with the rest of the library. To process
|
186
186
|
# a postauthorization with TC, you need an amount in cents or a money object, and a TC transid.
|
187
187
|
def capture(money, authorization, options = {})
|
188
|
-
transaction_id,
|
188
|
+
transaction_id, = split_authorization(authorization)
|
189
189
|
parameters = {
|
190
190
|
amount: amount(money),
|
191
191
|
transid: transaction_id,
|
@@ -199,7 +199,7 @@ module ActiveMerchant #:nodoc:
|
|
199
199
|
# refund() allows you to return money to a card that was previously billed. You need to supply the amount, in cents or a money object,
|
200
200
|
# that you want to refund, and a TC transid for the transaction that you are refunding.
|
201
201
|
def refund(money, identification, options = {})
|
202
|
-
transaction_id,
|
202
|
+
transaction_id, = split_authorization(identification)
|
203
203
|
|
204
204
|
parameters = {
|
205
205
|
amount: amount(money),
|
@@ -262,7 +262,7 @@ module ActiveMerchant #:nodoc:
|
|
262
262
|
def recurring(money, creditcard, options = {})
|
263
263
|
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
264
264
|
|
265
|
-
requires!(options, [
|
265
|
+
requires!(options, %i[periodicity bimonthly monthly biweekly weekly yearly daily])
|
266
266
|
|
267
267
|
cycle =
|
268
268
|
case options[:periodicity]
|
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
|
|
73
73
|
FAILURE_MESSAGE = 'Default Failure' #:nodoc:
|
74
74
|
|
75
75
|
self.supported_countries = ['US']
|
76
|
-
self.supported_cardtypes = [
|
76
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
77
77
|
self.homepage_url = 'http://www.usaepay.com/'
|
78
78
|
self.display_name = 'USA ePay Advanced SOAP Interface'
|
79
79
|
|
@@ -676,9 +676,9 @@ module ActiveMerchant #:nodoc:
|
|
676
676
|
commit(__method__, request)
|
677
677
|
end
|
678
678
|
|
679
|
-
TRANSACTION_METHODS = [
|
680
|
-
|
681
|
-
|
679
|
+
TRANSACTION_METHODS = %i[
|
680
|
+
run_sale run_auth_only run_credit
|
681
|
+
run_check_sale run_check_credit
|
682
682
|
] #:nodoc:
|
683
683
|
|
684
684
|
TRANSACTION_METHODS.each do |method|
|
@@ -1336,7 +1336,7 @@ module ActiveMerchant #:nodoc:
|
|
1336
1336
|
when payment_method[:method].kind_of?(ActiveMerchant::Billing::CreditCard)
|
1337
1337
|
build_tag soap, :string, 'CardNumber', payment_method[:method].number
|
1338
1338
|
build_tag soap, :string, 'CardExpiration',
|
1339
|
-
"#{
|
1339
|
+
"#{'%02d' % payment_method[:method].month}#{payment_method[:method].year.to_s[-2..-1]}"
|
1340
1340
|
if options[:billing_address]
|
1341
1341
|
build_tag soap, :string, 'AvsStreet', options[:billing_address][:address1]
|
1342
1342
|
build_tag soap, :string, 'AvsZip', options[:billing_address][:zip]
|
@@ -1432,7 +1432,7 @@ module ActiveMerchant #:nodoc:
|
|
1432
1432
|
def build_card_expiration(options)
|
1433
1433
|
month = options[:payment_method].month
|
1434
1434
|
year = options[:payment_method].year
|
1435
|
-
"#{
|
1435
|
+
"#{'%02d' % month}#{year.to_s[-2..-1]}" unless month.nil? || year.nil?
|
1436
1436
|
end
|
1437
1437
|
|
1438
1438
|
def build_check_data(soap, options)
|