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
@@ -9,9 +9,9 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.test_url = 'https://test.ctpe.io/payment/ctpe'
|
10
10
|
self.live_url = 'https://ctpe.io/payment/ctpe'
|
11
11
|
|
12
|
-
self.supported_countries = [
|
12
|
+
self.supported_countries = %w[LI US]
|
13
13
|
self.default_currency = 'EUR'
|
14
|
-
self.supported_cardtypes = [
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
15
15
|
|
16
16
|
self.homepage_url = 'http://www.bankfrickacquiring.com/'
|
17
17
|
self.display_name = 'Bank Frick'
|
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
URL = 'https://banwire.com/api.pago_pro'
|
5
5
|
|
6
6
|
self.supported_countries = ['MX']
|
7
|
-
self.supported_cardtypes = [
|
7
|
+
self.supported_cardtypes = %i[visa master american_express]
|
8
8
|
self.homepage_url = 'http://www.banwire.com/'
|
9
9
|
self.display_name = 'Banwire'
|
10
10
|
|
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
|
|
63
63
|
post[:card_num] = creditcard.number
|
64
64
|
post[:card_name] = creditcard.name
|
65
65
|
post[:card_type] = card_brand(creditcard)
|
66
|
-
post[:card_exp] = "#{sprintf(
|
66
|
+
post[:card_exp] = "#{sprintf('%02d', creditcard.month)}/#{creditcard.year.to_s[-2, 2]}"
|
67
67
|
post[:card_ccv2] = creditcard.verification_value
|
68
68
|
end
|
69
69
|
|
@@ -4,11 +4,11 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
self.test_url = 'https://pal-test.barclaycardsmartpay.com/pal/servlet'
|
5
5
|
self.live_url = 'https://pal-live.barclaycardsmartpay.com/pal/servlet'
|
6
6
|
|
7
|
-
self.supported_countries = [
|
7
|
+
self.supported_countries = %w[AL AD AM AT AZ BY BE BA BG HR CY CZ DK EE FI FR DE GR HU IS IE IT KZ LV LI LT LU MK MT MD MC ME NL NO PL PT RO RU SM RS SK SI ES SE CH TR UA GB VA]
|
8
8
|
self.default_currency = 'EUR'
|
9
9
|
self.currencies_with_three_decimal_places = %w(BHD KWD OMR RSD TND)
|
10
10
|
self.money_format = :cents
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb dankort maestro]
|
12
12
|
|
13
13
|
self.homepage_url = 'https://www.barclaycardsmartpay.com/'
|
14
14
|
self.display_name = 'Barclaycard Smartpay'
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
self.homepage_url = 'http://www.barclaycard.co.uk/business/accepting-payments/epdq-ecomm/'
|
9
9
|
|
10
10
|
self.supported_countries = ['GB']
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
|
12
12
|
self.default_currency = 'GBP'
|
13
13
|
end
|
14
14
|
end
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.display_name = 'Be2Bill'
|
10
10
|
self.homepage_url = 'http://www.be2bill.com/'
|
11
11
|
self.supported_countries = ['FR']
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express]
|
13
13
|
self.default_currency = 'EUR'
|
14
14
|
self.money_format = :cents
|
15
15
|
|
@@ -131,10 +131,10 @@ module ActiveMerchant #:nodoc:
|
|
131
131
|
base.default_currency = 'CAD'
|
132
132
|
|
133
133
|
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
134
|
-
base.supported_countries = [
|
134
|
+
base.supported_countries = %w[CA US]
|
135
135
|
|
136
136
|
# The card types supported by the payment gateway
|
137
|
-
base.supported_cardtypes = [
|
137
|
+
base.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
138
138
|
|
139
139
|
# The homepage URL of the gateway
|
140
140
|
base.homepage_url = 'http://www.beanstream.com/'
|
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
|
|
155
155
|
end
|
156
156
|
|
157
157
|
def capture(money, authorization, options = {})
|
158
|
-
reference,
|
158
|
+
reference, = split_auth(authorization)
|
159
159
|
post = {}
|
160
160
|
add_amount(post, money)
|
161
161
|
add_reference(post, reference)
|
@@ -259,7 +259,7 @@ module ActiveMerchant #:nodoc:
|
|
259
259
|
[options[:billing_address], options[:shipping_address]].compact.each do |address|
|
260
260
|
next if empty?(address[:country])
|
261
261
|
|
262
|
-
unless [
|
262
|
+
unless %w[US CA].include?(address[:country])
|
263
263
|
address[:state] = '--'
|
264
264
|
address[:zip] = '000000' unless address[:zip]
|
265
265
|
end
|
@@ -44,8 +44,8 @@ module ActiveMerchant #:nodoc:
|
|
44
44
|
'CUST_TOKEN' => :cust_token
|
45
45
|
}
|
46
46
|
|
47
|
-
self.supported_countries = [
|
48
|
-
self.supported_cardtypes = [
|
47
|
+
self.supported_countries = %w[US CA]
|
48
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
49
49
|
self.homepage_url = 'http://www.bluepay.com/'
|
50
50
|
self.display_name = 'BluePay'
|
51
51
|
self.money_format = :dollars
|
@@ -382,9 +382,9 @@ module ActiveMerchant #:nodoc:
|
|
382
382
|
end
|
383
383
|
elsif message == 'Missing ACCOUNT_ID'
|
384
384
|
message = 'The merchant login ID or password is invalid'
|
385
|
-
elsif
|
385
|
+
elsif /Approved/.match?(message)
|
386
386
|
message = 'This transaction has been approved'
|
387
|
-
elsif
|
387
|
+
elsif /Expired/.match?(message)
|
388
388
|
message = 'The credit card has expired'
|
389
389
|
end
|
390
390
|
message
|
@@ -8,7 +8,7 @@ module ActiveMerchant
|
|
8
8
|
self.supported_countries = %w(US CA GB AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE AR BO BR BZ CL CO CR DO EC GF GP GT HN HT MF MQ MX NI PA PE PR PY SV UY VE)
|
9
9
|
|
10
10
|
self.default_currency = 'USD'
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro naranja cabal]
|
12
12
|
self.currencies_without_fractions = %w(BYR CLP ILS JPY KRW VND XOF)
|
13
13
|
self.currencies_with_three_decimal_places = %w(BHD JOD KWD OMR TND)
|
14
14
|
|
@@ -9,10 +9,10 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
|
10
10
|
self.live_url = 'https://gateway01.borgun.is/ws/Heimir.pub.ws:Authorization'
|
11
11
|
|
12
|
-
self.supported_countries = [
|
12
|
+
self.supported_countries = %w[IS GB HU CZ DE DK SE]
|
13
13
|
self.default_currency = 'ISK'
|
14
14
|
self.money_format = :cents
|
15
|
-
self.supported_cardtypes = [
|
15
|
+
self.supported_cardtypes = %i[visa master american_express diners_club discover jcb]
|
16
16
|
|
17
17
|
self.homepage_url = 'https://www.borgun.is/'
|
18
18
|
|
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def add_reference(post, authorization)
|
99
|
-
dateandtime, _batch, transaction, rrn, authcode,
|
99
|
+
dateandtime, _batch, transaction, rrn, authcode, = split_authorization(authorization)
|
100
100
|
post[:DateAndTime] = dateandtime
|
101
101
|
post[:Transaction] = transaction
|
102
102
|
post[:RRN] = rrn
|
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
|
8
8
|
self.supported_countries = ['AU']
|
9
9
|
self.default_currency = 'AUD'
|
10
|
-
self.supported_cardtypes = [
|
10
|
+
self.supported_cardtypes = %i[visa master american_express diners_club]
|
11
11
|
|
12
12
|
self.homepage_url = 'https://www.bpoint.com.au/bpoint'
|
13
13
|
self.display_name = 'BPoint'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BraintreeCommon
|
2
2
|
def self.included(base)
|
3
3
|
base.supported_countries = %w(US CA AD AT BE BG HR CY CZ DK EE FI FR GI DE GR GG HU IS IM IE IT JE LV LI LT LU MT MC NL NO PL PT RO SM SK SI ES SE CH TR GB SG HK MY AU NZ)
|
4
|
-
base.supported_cardtypes = [
|
4
|
+
base.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro]
|
5
5
|
base.homepage_url = 'http://www.braintreepaymentsolutions.com'
|
6
6
|
base.display_name = 'Braintree'
|
7
7
|
base.default_currency = 'USD'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active_merchant/billing/gateways/braintree/braintree_common'
|
2
|
+
require 'active_support/core_ext/array/extract_options'
|
2
3
|
|
3
4
|
begin
|
4
5
|
require 'braintree'
|
@@ -100,7 +101,7 @@ module ActiveMerchant #:nodoc:
|
|
100
101
|
response = response_from_result(@braintree_gateway.transaction.refund(transaction_id, money))
|
101
102
|
|
102
103
|
if !response.success? && options[:force_full_refund_if_unsettled] &&
|
103
|
-
|
104
|
+
response.message =~ /#{ERROR_CODES[:cannot_refund_if_unsettled]}/
|
104
105
|
void(transaction_id)
|
105
106
|
else
|
106
107
|
response
|
@@ -203,12 +204,10 @@ module ActiveMerchant #:nodoc:
|
|
203
204
|
|
204
205
|
def check_customer_exists(customer_vault_id)
|
205
206
|
commit do
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
ActiveMerchant::Billing::Response.new(true, 'Customer not found', {exists: false})
|
211
|
-
end
|
207
|
+
@braintree_gateway.customer.find(customer_vault_id)
|
208
|
+
ActiveMerchant::Billing::Response.new(true, 'Customer found', {exists: true}, authorization: customer_vault_id)
|
209
|
+
rescue Braintree::NotFoundError
|
210
|
+
ActiveMerchant::Billing::Response.new(true, 'Customer not found', {exists: false})
|
212
211
|
end
|
213
212
|
end
|
214
213
|
|
@@ -300,7 +299,7 @@ module ActiveMerchant #:nodoc:
|
|
300
299
|
def merge_credit_card_options(parameters, options)
|
301
300
|
valid_options = {}
|
302
301
|
options.each do |key, value|
|
303
|
-
valid_options[key] = value if [
|
302
|
+
valid_options[key] = value if %i[update_existing_token verify_card verification_merchant_account_id].include?(key)
|
304
303
|
end
|
305
304
|
|
306
305
|
valid_options[:verification_merchant_account_id] ||= @merchant_account_id if valid_options.include?(:verify_card) && @merchant_account_id
|
@@ -583,60 +582,110 @@ module ActiveMerchant #:nodoc:
|
|
583
582
|
}
|
584
583
|
}
|
585
584
|
|
586
|
-
parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking] if options[:skip_advanced_fraud_checking]
|
587
|
-
|
588
|
-
parameters[:options][:skip_avs] = options[:skip_avs] if options[:skip_avs]
|
589
|
-
|
590
|
-
parameters[:options][:skip_cvv] = options[:skip_cvv] if options[:skip_cvv]
|
591
|
-
|
592
585
|
parameters[:custom_fields] = options[:custom_fields]
|
593
586
|
parameters[:device_data] = options[:device_data] if options[:device_data]
|
594
587
|
parameters[:service_fee_amount] = options[:service_fee_amount] if options[:service_fee_amount]
|
595
|
-
if merchant_account_id = (options[:merchant_account_id] || @merchant_account_id)
|
596
|
-
parameters[:merchant_account_id] = merchant_account_id
|
597
|
-
end
|
598
588
|
|
599
|
-
|
600
|
-
|
601
|
-
elsif options[:recurring]
|
602
|
-
parameters[:recurring] = true
|
603
|
-
end
|
589
|
+
add_skip_options(parameters, options)
|
590
|
+
add_merchant_account_id(parameters, options)
|
604
591
|
|
605
592
|
add_payment_method(parameters, credit_card_or_vault_id, options)
|
606
593
|
add_stored_credential_data(parameters, credit_card_or_vault_id, options)
|
594
|
+
add_addresses(parameters, options)
|
595
|
+
|
596
|
+
add_descriptor(parameters, options)
|
597
|
+
add_travel_data(parameters, options) if options[:travel_data]
|
598
|
+
add_lodging_data(parameters, options) if options[:lodging_data]
|
599
|
+
add_channel(parameters, options)
|
600
|
+
add_transaction_source(parameters, options)
|
601
|
+
|
602
|
+
add_level_2_data(parameters, options)
|
603
|
+
add_level_3_data(parameters, options)
|
604
|
+
|
605
|
+
add_3ds_info(parameters, options[:three_d_secure])
|
607
606
|
|
607
|
+
if options[:payment_method_nonce].is_a?(String)
|
608
|
+
parameters.delete(:customer)
|
609
|
+
parameters[:payment_method_nonce] = options[:payment_method_nonce]
|
610
|
+
end
|
611
|
+
|
612
|
+
parameters
|
613
|
+
end
|
614
|
+
|
615
|
+
def add_skip_options(parameters, options)
|
616
|
+
parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking] if options[:skip_advanced_fraud_checking]
|
617
|
+
parameters[:options][:skip_avs] = options[:skip_avs] if options[:skip_avs]
|
618
|
+
parameters[:options][:skip_cvv] = options[:skip_cvv] if options[:skip_cvv]
|
619
|
+
end
|
620
|
+
|
621
|
+
def add_merchant_account_id(parameters, options)
|
622
|
+
return unless merchant_account_id = (options[:merchant_account_id] || @merchant_account_id)
|
623
|
+
|
624
|
+
parameters[:merchant_account_id] = merchant_account_id
|
625
|
+
end
|
626
|
+
|
627
|
+
def add_transaction_source(parameters, options)
|
628
|
+
parameters[:transaction_source] = options[:transaction_source] if options[:transaction_source]
|
629
|
+
parameters[:transaction_source] = 'recurring' if options[:recurring]
|
630
|
+
end
|
631
|
+
|
632
|
+
def add_addresses(parameters, options)
|
608
633
|
parameters[:billing] = map_address(options[:billing_address]) if options[:billing_address]
|
609
634
|
parameters[:shipping] = map_address(options[:shipping_address]) if options[:shipping_address]
|
635
|
+
end
|
610
636
|
|
637
|
+
def add_channel(parameters, options)
|
611
638
|
channel = @options[:channel] || application_id
|
612
639
|
parameters[:channel] = channel if channel
|
640
|
+
end
|
613
641
|
|
614
|
-
|
615
|
-
|
616
|
-
name: options[:descriptor_name],
|
617
|
-
phone: options[:descriptor_phone],
|
618
|
-
url: options[:descriptor_url]
|
619
|
-
}
|
620
|
-
end
|
642
|
+
def add_descriptor(parameters, options)
|
643
|
+
return unless options[:descriptor_name] || options[:descriptor_phone] || options[:descriptor_url]
|
621
644
|
|
622
|
-
|
645
|
+
parameters[:descriptor] = {
|
646
|
+
name: options[:descriptor_name],
|
647
|
+
phone: options[:descriptor_phone],
|
648
|
+
url: options[:descriptor_url]
|
649
|
+
}
|
650
|
+
end
|
623
651
|
|
652
|
+
def add_level_2_data(parameters, options)
|
624
653
|
parameters[:tax_amount] = options[:tax_amount] if options[:tax_amount]
|
625
654
|
parameters[:tax_exempt] = options[:tax_exempt] if options[:tax_exempt]
|
626
655
|
parameters[:purchase_order_number] = options[:purchase_order_number] if options[:purchase_order_number]
|
656
|
+
end
|
627
657
|
|
658
|
+
def add_level_3_data(parameters, options)
|
628
659
|
parameters[:shipping_amount] = options[:shipping_amount] if options[:shipping_amount]
|
629
660
|
parameters[:discount_amount] = options[:discount_amount] if options[:discount_amount]
|
630
661
|
parameters[:ships_from_postal_code] = options[:ships_from_postal_code] if options[:ships_from_postal_code]
|
631
662
|
|
632
663
|
parameters[:line_items] = options[:line_items] if options[:line_items]
|
664
|
+
end
|
633
665
|
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
666
|
+
def add_travel_data(parameters, options)
|
667
|
+
parameters[:industry] = {
|
668
|
+
industry_type: Braintree::Transaction::IndustryType::TravelAndCruise,
|
669
|
+
data: {}
|
670
|
+
}
|
638
671
|
|
639
|
-
parameters
|
672
|
+
parameters[:industry][:data][:travel_package] = options[:travel_data][:travel_package] if options[:travel_data][:travel_package]
|
673
|
+
parameters[:industry][:data][:departure_date] = options[:travel_data][:departure_date] if options[:travel_data][:departure_date]
|
674
|
+
parameters[:industry][:data][:lodging_check_in_date] = options[:travel_data][:lodging_check_in_date] if options[:travel_data][:lodging_check_in_date]
|
675
|
+
parameters[:industry][:data][:lodging_check_out_date] = options[:travel_data][:lodging_check_out_date] if options[:travel_data][:lodging_check_out_date]
|
676
|
+
parameters[:industry][:data][:lodging_name] = options[:travel_data][:lodging_name] if options[:travel_data][:lodging_name]
|
677
|
+
end
|
678
|
+
|
679
|
+
def add_lodging_data(parameters, options)
|
680
|
+
parameters[:industry] = {
|
681
|
+
industry_type: Braintree::Transaction::IndustryType::Lodging,
|
682
|
+
data: {}
|
683
|
+
}
|
684
|
+
|
685
|
+
parameters[:industry][:data][:folio_number] = options[:lodging_data][:folio_number] if options[:lodging_data][:folio_number]
|
686
|
+
parameters[:industry][:data][:check_in_date] = options[:lodging_data][:check_in_date] if options[:lodging_data][:check_in_date]
|
687
|
+
parameters[:industry][:data][:check_out_date] = options[:lodging_data][:check_out_date] if options[:lodging_data][:check_out_date]
|
688
|
+
parameters[:industry][:data][:room_rate] = options[:lodging_data][:room_rate] if options[:lodging_data][:room_rate]
|
640
689
|
end
|
641
690
|
|
642
691
|
def add_3ds_info(parameters, three_d_secure_opts)
|
@@ -9,9 +9,9 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
|
10
10
|
self.live_url = 'https://gateway.itstgate.com/SmartPayments/transact3.asmx'
|
11
11
|
|
12
|
-
self.supported_countries = [
|
12
|
+
self.supported_countries = %w[CA US]
|
13
13
|
self.default_currency = 'USD'
|
14
|
-
self.supported_cardtypes = [
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
15
15
|
|
16
16
|
def initialize(options={})
|
17
17
|
requires!(options, :user_name, :password)
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
|
6
6
|
self.supported_countries = ['US']
|
7
7
|
self.default_currency = 'USD'
|
8
|
-
self.supported_cardtypes = [
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
9
9
|
|
10
10
|
self.homepage_url = 'https://www.centralams.com/'
|
11
11
|
self.display_name = 'CAMS: Central Account Management System'
|
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
|
|
167
167
|
|
168
168
|
def add_payment(post, payment)
|
169
169
|
post[:ccnumber] = payment.number
|
170
|
-
post[:ccexp] = "#{payment.month.to_s.rjust(2,
|
170
|
+
post[:ccexp] = "#{payment.month.to_s.rjust(2, '0')}#{payment.year.to_s[-2..-1]}"
|
171
171
|
post[:cvv] = payment.verification_value
|
172
172
|
end
|
173
173
|
|
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
|
7
7
|
self.supported_countries = ['US']
|
8
8
|
self.default_currency = 'USD'
|
9
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
10
10
|
|
11
11
|
self.homepage_url = 'https://cardconnect.com/'
|
12
12
|
self.display_name = 'Card Connect'
|
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
|
7
7
|
self.money_format = :cents
|
8
8
|
self.default_currency = 'GBP'
|
9
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_cardtypes = %i[visa maestro master american_express jcb]
|
10
10
|
self.supported_countries = ['GB']
|
11
11
|
self.homepage_url = 'http://www.cardsave.net/'
|
12
12
|
self.display_name = 'CardSave'
|
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.money_format = :cents
|
8
8
|
self.default_currency = 'GBP'
|
9
9
|
self.currencies_without_fractions = %w(CVE ISK JPY UGX)
|
10
|
-
self.supported_countries = [
|
11
|
-
self.supported_cardtypes = [
|
10
|
+
self.supported_countries = %w[GB US CH SE SG NO JP IS HK NL CZ CA AU]
|
11
|
+
self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
|
12
12
|
self.homepage_url = 'http://www.cardstream.com/'
|
13
13
|
self.display_name = 'CardStream'
|
14
14
|
|
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
|
|
247
247
|
add_pair(post, :statementNarrative1, options[:merchant_name]) if options[:merchant_name]
|
248
248
|
add_pair(post, :statementNarrative2, options[:dynamic_descriptor]) if options[:dynamic_descriptor]
|
249
249
|
if credit_card_or_reference.respond_to?(:number)
|
250
|
-
if [
|
250
|
+
if %w[american_express diners_club].include?(card_brand(credit_card_or_reference).to_s)
|
251
251
|
add_pair(post, :item1Quantity, 1)
|
252
252
|
add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15))
|
253
253
|
add_pair(post, :item1GrossValue, localized_amount(money, options[:currency] || currency(money)))
|
@@ -309,7 +309,7 @@ module ActiveMerchant #:nodoc:
|
|
309
309
|
end
|
310
310
|
|
311
311
|
def commit(action, parameters)
|
312
|
-
parameters.update(countryCode: self.supported_countries[0]) unless [
|
312
|
+
parameters.update(countryCode: self.supported_countries[0]) unless %w[CAPTURE CANCEL].include?(action)
|
313
313
|
parameters.update(
|
314
314
|
merchantID: @options[:login],
|
315
315
|
action: action
|
@@ -3,9 +3,9 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
class CardknoxGateway < Gateway
|
4
4
|
self.live_url = 'https://x1.cardknox.com/gateway'
|
5
5
|
|
6
|
-
self.supported_countries = [
|
6
|
+
self.supported_countries = %w[US CA GB]
|
7
7
|
self.default_currency = 'USD'
|
8
|
-
self.supported_cardtypes = [
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
9
9
|
|
10
10
|
self.homepage_url = 'https://www.cardknox.com/'
|
11
11
|
self.display_name = 'Cardknox'
|
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def add_reference(post, reference)
|
119
|
-
reference,
|
119
|
+
reference, = split_authorization(reference)
|
120
120
|
post[:Refnum] = reference
|
121
121
|
end
|
122
122
|
|
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
|
|
247
247
|
end
|
248
248
|
|
249
249
|
def add_cardknox_token(post, authorization)
|
250
|
-
_, token,
|
250
|
+
_, token, = split_authorization(authorization)
|
251
251
|
|
252
252
|
post[:Token] = token
|
253
253
|
end
|