activemerchant 1.108.0 → 1.113.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +69 -0
- data/README.md +2 -2
- 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 +3 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +10 -7
- data/lib/active_merchant/billing/gateway.rb +1 -1
- data/lib/active_merchant/billing/gateways/adyen.rb +25 -14
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +13 -13
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +4 -4
- data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
- data/lib/active_merchant/billing/gateways/balanced.rb +2 -2
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +3 -3
- data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
- 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 +2 -2
- data/lib/active_merchant/billing/gateways/blue_snap.rb +50 -13
- data/lib/active_merchant/billing/gateways/borgun.rb +4 -4
- 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 +85 -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 +5 -5
- 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 +13 -13
- data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +3 -3
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +3 -3
- 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 +13 -3
- data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source.rb +66 -20
- data/lib/active_merchant/billing/gateways/d_local.rb +7 -3
- data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
- data/lib/active_merchant/billing/gateways/decidir.rb +1 -1
- data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
- data/lib/active_merchant/billing/gateways/digitzs.rb +3 -3
- data/lib/active_merchant/billing/gateways/ebanx.rb +4 -4
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -3
- data/lib/active_merchant/billing/gateways/elavon.rb +1 -1
- data/lib/active_merchant/billing/gateways/element.rb +7 -3
- 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 +4 -4
- data/lib/active_merchant/billing/gateways/exact.rb +3 -3
- data/lib/active_merchant/billing/gateways/ezic.rb +2 -2
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -7
- 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 +4 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +11 -3
- data/lib/active_merchant/billing/gateways/flo2cash.rb +11 -11
- data/lib/active_merchant/billing/gateways/forte.rb +2 -2
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/global_collect.rb +10 -5
- data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
- data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
- data/lib/active_merchant/billing/gateways/hps.rb +10 -7
- 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 +3 -3
- data/lib/active_merchant/billing/gateways/iridium.rb +5 -5
- 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 +3 -3
- data/lib/active_merchant/billing/gateways/litle.rb +5 -5
- data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +12 -7
- 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 +2 -2
- data/lib/active_merchant/billing/gateways/netbanx.rb +53 -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 +2 -2
- data/lib/active_merchant/billing/gateways/opp.rb +4 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +5 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +14 -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 +3 -3
- 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 +5 -5
- 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 +5 -5
- data/lib/active_merchant/billing/gateways/payex.rb +18 -18
- data/lib/active_merchant/billing/gateways/payflow.rb +8 -5
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- 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 +4 -4
- 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 +10 -8
- data/lib/active_merchant/billing/gateways/payway.rb +1 -1
- data/lib/active_merchant/billing/gateways/pin.rb +1 -1
- data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -6
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +2 -2
- data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +4 -4
- data/lib/active_merchant/billing/gateways/quantum.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickbooks.rb +9 -8
- 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 +2 -2
- data/lib/active_merchant/billing/gateways/realex.rb +2 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +7 -7
- data/lib/active_merchant/billing/gateways/s5.rb +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 +7 -7
- 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 +6 -6
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +8 -8
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +20 -1
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/telr.rb +5 -5
- data/lib/active_merchant/billing/gateways/tns.rb +1 -1
- data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +3 -3
- data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -1
- data/lib/active_merchant/billing/gateways/transax.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +1 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +12 -12
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +10 -10
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +2 -2
- 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 +6 -6
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +3 -3
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/gateway_support.rb +1 -1
- metadata +45 -31
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
'W' => '9-digit zip/postal code matches billing information, street address does not',
|
52
52
|
'X' => 'Street address and 9-digit zip/postal code matches billing information',
|
53
53
|
'Y' => 'Street address and 5-digit zip/postal code matches billing information',
|
54
|
-
'Z' => '5-digit zip/postal code matches billing information, street address does not'
|
54
|
+
'Z' => '5-digit zip/postal code matches billing information, street address does not'
|
55
55
|
}
|
56
56
|
|
57
57
|
CHANGE_STATUS_ERROR_MESSAGES = {
|
@@ -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
|
|
@@ -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/'
|
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
|
|
53
53
|
|
54
54
|
BANK_ACCOUNT_HOLDER_TYPE_MAPPING = {
|
55
55
|
'personal' => 'individual',
|
56
|
-
'business' => 'company'
|
56
|
+
'business' => 'company'
|
57
57
|
}
|
58
58
|
|
59
59
|
MINIMUM_AUTHORIZE_AMOUNTS = {
|
@@ -430,7 +430,7 @@ module ActiveMerchant #:nodoc:
|
|
430
430
|
end
|
431
431
|
|
432
432
|
def add_customer_data(post, options)
|
433
|
-
metadata_options = [
|
433
|
+
metadata_options = %i[description ip user_agent referrer]
|
434
434
|
post.update(options.slice(*metadata_options))
|
435
435
|
|
436
436
|
post[:external_id] = options[:order_id]
|
@@ -452,7 +452,7 @@ module ActiveMerchant #:nodoc:
|
|
452
452
|
|
453
453
|
def add_statement_address(post, options)
|
454
454
|
return unless statement_address = options[:statement_address]
|
455
|
-
return unless [
|
455
|
+
return unless %i[address1 city zip state].all? { |key| statement_address[key].present? }
|
456
456
|
|
457
457
|
post[:statement_address] = {}
|
458
458
|
post[:statement_address][:line1] = statement_address[:address1]
|
@@ -613,7 +613,7 @@ module ActiveMerchant #:nodoc:
|
|
613
613
|
idempotency_key = options[:idempotency_key]
|
614
614
|
|
615
615
|
headers = {
|
616
|
-
'Authorization' => 'Basic ' + Base64.
|
616
|
+
'Authorization' => 'Basic ' + Base64.strict_encode64(key.to_s + ':').strip,
|
617
617
|
'User-Agent' => "Stripe/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
|
618
618
|
'Stripe-Version' => api_version(options),
|
619
619
|
'X-Stripe-Client-User-Agent' => stripe_client_user_agent(options),
|
@@ -655,7 +655,7 @@ module ActiveMerchant #:nodoc:
|
|
655
655
|
success = success_from(response, options)
|
656
656
|
|
657
657
|
card = card_from_response(response)
|
658
|
-
avs_code = AVS_CODE_TRANSLATOR["line1: #{card[
|
658
|
+
avs_code = AVS_CODE_TRANSLATOR["line1: #{card['address_line1_check']}, zip: #{card['address_zip_check']}"]
|
659
659
|
cvc_code = CVC_CODE_TRANSLATOR[card['cvc_check']]
|
660
660
|
|
661
661
|
Response.new(success,
|
@@ -755,7 +755,7 @@ module ActiveMerchant #:nodoc:
|
|
755
755
|
currency: 'usd',
|
756
756
|
routing_number: bank_account.routing_number,
|
757
757
|
name: bank_account.name,
|
758
|
-
account_holder_type: account_holder_type
|
758
|
+
account_holder_type: account_holder_type
|
759
759
|
}
|
760
760
|
}
|
761
761
|
|
@@ -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
|
@@ -170,6 +185,10 @@ module ActiveMerchant #:nodoc:
|
|
170
185
|
end
|
171
186
|
end
|
172
187
|
|
188
|
+
def verify(payment_method, options = {})
|
189
|
+
create_setup_intent(payment_method, options.merge!(confirm: true))
|
190
|
+
end
|
191
|
+
|
173
192
|
private
|
174
193
|
|
175
194
|
def add_connected_account(post, options = {})
|
@@ -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,16 +8,16 @@ 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',
|
18
18
|
'N' => 'N',
|
19
19
|
'X' => 'P',
|
20
|
-
'E' => 'U'
|
20
|
+
'E' => 'U'
|
21
21
|
}
|
22
22
|
|
23
23
|
AVS_CODE_TRANSLATOR = {
|
@@ -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
|
|
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
purchase_echeck: 'ACHDebit',
|
19
19
|
refund: 'CreditCardCredit',
|
20
20
|
refund_echeck: 'ACHVoidTransaction',
|
21
|
-
void: 'CreditCardAutoRefundorVoid'
|
21
|
+
void: 'CreditCardAutoRefundorVoid'
|
22
22
|
}
|
23
23
|
|
24
24
|
ENDPOINTS = {
|
@@ -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/'
|
@@ -152,7 +152,7 @@ module ActiveMerchant #:nodoc:
|
|
152
152
|
'R1' => 'The transaction was declined or returned, because the cardholder requested that payment of all recurring or installment payment transactions for a specific merchant account be stopped/ Reserved for client-specific use (declined)',
|
153
153
|
'Q1' => 'Card Authentication failed/ Reserved for client-specific use (declined)',
|
154
154
|
'XA' => 'Forward to Issuer/ Reserved for client-specific use (declined)',
|
155
|
-
'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)'
|
155
|
+
'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)'
|
156
156
|
}
|
157
157
|
|
158
158
|
EXTENDED_RESPONSE_MESSAGES = {
|
@@ -179,7 +179,7 @@ module ActiveMerchant #:nodoc:
|
|
179
179
|
refund_echeck: 16,
|
180
180
|
void_echeck: 16,
|
181
181
|
|
182
|
-
wallet_sale: 14
|
182
|
+
wallet_sale: 14
|
183
183
|
}
|
184
184
|
|
185
185
|
def initialize(options={})
|
@@ -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'
|
@@ -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
|
|
@@ -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'
|
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
|
|
151
151
|
|
152
152
|
def authorize(money, creditcard_or_billing_id, options = {})
|
153
153
|
parameters = {
|
154
|
-
amount: amount(money)
|
154
|
+
amount: amount(money)
|
155
155
|
}
|
156
156
|
|
157
157
|
add_order_id(parameters, options)
|
@@ -168,7 +168,7 @@ module ActiveMerchant #:nodoc:
|
|
168
168
|
# to process a purchase are an amount in cents or a money object and a creditcard object or billingid string.
|
169
169
|
def purchase(money, creditcard_or_billing_id, options = {})
|
170
170
|
parameters = {
|
171
|
-
amount: amount(money)
|
171
|
+
amount: amount(money)
|
172
172
|
}
|
173
173
|
|
174
174
|
add_order_id(parameters, options)
|
@@ -185,10 +185,10 @@ 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
|
-
transid: transaction_id
|
191
|
+
transid: transaction_id
|
192
192
|
}
|
193
193
|
add_aggregator(parameters, options)
|
194
194
|
add_custom_fields(parameters, options)
|
@@ -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),
|
@@ -239,7 +239,7 @@ module ActiveMerchant #:nodoc:
|
|
239
239
|
action = (VOIDABLE_ACTIONS - ['preauth']).include?(original_action) ? 'void' : 'reversal'
|
240
240
|
|
241
241
|
parameters = {
|
242
|
-
transid: transaction_id
|
242
|
+
transid: transaction_id
|
243
243
|
}
|
244
244
|
|
245
245
|
add_aggregator(parameters, options)
|
@@ -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]
|
@@ -285,7 +285,7 @@ module ActiveMerchant #:nodoc:
|
|
285
285
|
cycle: cycle,
|
286
286
|
verify: options[:verify] || 'y',
|
287
287
|
billingid: options[:billingid] || nil,
|
288
|
-
payments: options[:payments] || nil
|
288
|
+
payments: options[:payments] || nil
|
289
289
|
}
|
290
290
|
|
291
291
|
add_creditcard(parameters, creditcard)
|
@@ -300,7 +300,7 @@ module ActiveMerchant #:nodoc:
|
|
300
300
|
def store(creditcard, options = {})
|
301
301
|
parameters = {
|
302
302
|
verify: options[:verify] || 'y',
|
303
|
-
billingid: options[:billingid] || options[:billing_id] || nil
|
303
|
+
billingid: options[:billingid] || options[:billing_id] || nil
|
304
304
|
}
|
305
305
|
|
306
306
|
add_creditcard(parameters, creditcard)
|
@@ -314,7 +314,7 @@ module ActiveMerchant #:nodoc:
|
|
314
314
|
# unstore() the information will be removed and a Response object will be returned indicating the success of the action.
|
315
315
|
def unstore(identification, options = {})
|
316
316
|
parameters = {
|
317
|
-
billingid: identification
|
317
|
+
billingid: identification
|
318
318
|
}
|
319
319
|
|
320
320
|
add_custom_fields(parameters, options)
|
@@ -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
|
|
@@ -126,7 +126,7 @@ module ActiveMerchant #:nodoc:
|
|
126
126
|
COMMON_ADDRESS_OPTIONS,
|
127
127
|
{
|
128
128
|
address1: [:string, 'Street'],
|
129
|
-
address2: [:string, 'Street2']
|
129
|
+
address2: [:string, 'Street2']
|
130
130
|
}
|
131
131
|
].inject(:merge) #:nodoc
|
132
132
|
|
@@ -136,7 +136,7 @@ module ActiveMerchant #:nodoc:
|
|
136
136
|
COMMON_ADDRESS_OPTIONS,
|
137
137
|
{
|
138
138
|
address1: [:string, 'Address'],
|
139
|
-
address2: [:string, 'Address2']
|
139
|
+
address2: [:string, 'Address2']
|
140
140
|
},
|
141
141
|
{
|
142
142
|
card_number: [:string, 'CardNumber'],
|
@@ -144,7 +144,7 @@ module ActiveMerchant #:nodoc:
|
|
144
144
|
account: [:string, 'Account'],
|
145
145
|
routing: [:string, 'Routing'],
|
146
146
|
check_format: [:string, 'CheckFormat'],
|
147
|
-
record_type: [:string, 'RecordType']
|
147
|
+
record_type: [:string, 'RecordType']
|
148
148
|
}
|
149
149
|
].inject(:merge) #:nodoc
|
150
150
|
|
@@ -187,7 +187,7 @@ module ActiveMerchant #:nodoc:
|
|
187
187
|
comments: [:string, 'Comments'],
|
188
188
|
allow_partial_auth: [:boolean, 'AllowPartialAuth'],
|
189
189
|
currency: [:string, 'Currency'],
|
190
|
-
non_tax: [:boolean, 'NonTax']
|
190
|
+
non_tax: [:boolean, 'NonTax']
|
191
191
|
} #:nodoc:
|
192
192
|
|
193
193
|
TRANSACTION_DETAIL_MONEY_OPTIONS = {
|
@@ -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)
|