activemerchant 1.137.0 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +212 -2
- data/CONTRIBUTORS +1 -0
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +2 -2
- data/lib/active_merchant/billing/base.rb +2 -2
- data/lib/active_merchant/billing/check.rb +14 -2
- data/lib/active_merchant/billing/credit_card.rb +24 -8
- data/lib/active_merchant/billing/credit_card_formatting.rb +9 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +17 -15
- data/lib/active_merchant/billing/gateway.rb +13 -2
- data/lib/active_merchant/billing/gateways/adyen.rb +139 -63
- data/lib/active_merchant/billing/gateways/airwallex.rb +22 -15
- data/lib/active_merchant/billing/gateways/alelo.rb +6 -6
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +6 -6
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +4 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -2
- data/lib/active_merchant/billing/gateways/axcessms.rb +3 -3
- data/lib/active_merchant/billing/gateways/balanced.rb +2 -2
- 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 +8 -8
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +2 -2
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +5 -5
- data/lib/active_merchant/billing/gateways/beanstream.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +2 -2
- data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/bogus.rb +2 -2
- data/lib/active_merchant/billing/gateways/borgun.rb +2 -2
- data/lib/active_merchant/billing/gateways/bpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +3 -1
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +4 -4
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +56 -32
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +2 -2
- 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 +2 -2
- data/lib/active_merchant/billing/gateways/card_save.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_stream.rb +8 -7
- data/lib/active_merchant/billing/gateways/cardknox.rb +2 -2
- data/lib/active_merchant/billing/gateways/cardprocess.rb +2 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +3 -3
- data/lib/active_merchant/billing/gateways/cc5.rb +2 -2
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb +27 -12
- data/lib/active_merchant/billing/gateways/cecabank.rb +2 -2
- data/lib/active_merchant/billing/gateways/cenpos.rb +9 -3
- data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +128 -20
- data/lib/active_merchant/billing/gateways/clearhaus.rb +2 -2
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +57 -32
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
- data/lib/active_merchant/billing/gateways/creditcall.rb +2 -2
- data/lib/active_merchant/billing/gateways/credorax.rb +106 -15
- data/lib/active_merchant/billing/gateways/ct_payment.rb +6 -6
- data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source.rb +237 -96
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +64 -37
- data/lib/active_merchant/billing/gateways/d_local.rb +19 -7
- data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
- data/lib/active_merchant/billing/gateways/datatrans.rb +16 -11
- data/lib/active_merchant/billing/gateways/decidir.rb +30 -29
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +27 -34
- data/lib/active_merchant/billing/gateways/deepstack.rb +2 -2
- data/lib/active_merchant/billing/gateways/dibs.rb +3 -3
- data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +82 -38
- data/lib/active_merchant/billing/gateways/efsnet.rb +7 -6
- data/lib/active_merchant/billing/gateways/elavon.rb +8 -41
- data/lib/active_merchant/billing/gateways/element.rb +3 -3
- data/lib/active_merchant/billing/gateways/epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/evo_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/eway.rb +2 -2
- data/lib/active_merchant/billing/gateways/eway_managed.rb +2 -2
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +3 -3
- data/lib/active_merchant/billing/gateways/exact.rb +2 -2
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +6 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -2
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_json.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +2 -2
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +2 -2
- data/lib/active_merchant/billing/gateways/flex_charge.rb +40 -28
- data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -2
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
- data/lib/active_merchant/billing/gateways/forte.rb +6 -4
- data/lib/active_merchant/billing/gateways/fortis.rb +347 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/global_collect.rb +29 -18
- data/lib/active_merchant/billing/gateways/global_transport.rb +2 -2
- data/lib/active_merchant/billing/gateways/hdfc.rb +2 -2
- data/lib/active_merchant/billing/gateways/hi_pay.rb +7 -6
- data/lib/active_merchant/billing/gateways/hps.rb +40 -47
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +2 -2
- data/lib/active_merchant/billing/gateways/instapay.rb +2 -2
- data/lib/active_merchant/billing/gateways/ipg.rb +5 -5
- data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
- data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
- data/lib/active_merchant/billing/gateways/itransact.rb +2 -2
- data/lib/active_merchant/billing/gateways/iveri.rb +9 -6
- data/lib/active_merchant/billing/gateways/ixopay.rb +2 -2
- data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +5 -4
- data/lib/active_merchant/billing/gateways/komoju.rb +2 -2
- data/lib/active_merchant/billing/gateways/kushki.rb +7 -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 +5 -5
- data/lib/active_merchant/billing/gateways/loan_payment_pro.rb +267 -0
- data/lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb +93 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +32 -11
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercury.rb +5 -3
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -2
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +6 -6
- data/lib/active_merchant/billing/gateways/migs.rb +2 -2
- data/lib/active_merchant/billing/gateways/mit.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/moka.rb +2 -2
- data/lib/active_merchant/billing/gateways/monei.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris.rb +2 -2
- data/lib/active_merchant/billing/gateways/money_movers.rb +2 -2
- data/lib/active_merchant/billing/gateways/multi_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +5 -3
- data/lib/active_merchant/billing/gateways/nab_transact.rb +6 -6
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +3 -3
- 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 +3 -3
- data/lib/active_merchant/billing/gateways/nmi.rb +13 -4
- data/lib/active_merchant/billing/gateways/nuvei.rb +573 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
- data/lib/active_merchant/billing/gateways/omise.rb +2 -2
- data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/opp.rb +2 -2
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +6 -4
- data/lib/active_merchant/billing/gateways/orbital/orbital_codes.rb +273 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +2 -2
- data/lib/active_merchant/billing/gateways/orbital.rb +47 -86
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +2 -2
- data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
- data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_arc.rb +9 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +6 -4
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_hub.rb +3 -3
- data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_trace.rb +5 -4
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +14 -14
- data/lib/active_merchant/billing/gateways/payeezy.rb +7 -5
- data/lib/active_merchant/billing/gateways/payex.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow.rb +11 -8
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/paymentez.rb +7 -5
- data/lib/active_merchant/billing/gateways/paymill.rb +6 -4
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +17 -12
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal.rb +4 -2
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -2
- data/lib/active_merchant/billing/gateways/paysafe.rb +36 -13
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -2
- data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_in.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -5
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +4 -4
- data/lib/active_merchant/billing/gateways/pin.rb +104 -37
- data/lib/active_merchant/billing/gateways/plexo.rb +32 -20
- data/lib/active_merchant/billing/gateways/priority.rb +23 -19
- 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/qbms.rb +3 -3
- data/lib/active_merchant/billing/gateways/quantum.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickbooks.rb +21 -12
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +2 -2
- data/lib/active_merchant/billing/gateways/rapyd.rb +28 -11
- data/lib/active_merchant/billing/gateways/reach.rb +5 -5
- data/lib/active_merchant/billing/gateways/redsys.rb +5 -5
- data/lib/active_merchant/billing/gateways/redsys_rest.rb +57 -19
- data/lib/active_merchant/billing/gateways/s5.rb +2 -2
- data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -9
- data/lib/active_merchant/billing/gateways/sage.rb +2 -2
- data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_net.rb +3 -3
- data/lib/active_merchant/billing/gateways/secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +13 -11
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/securion_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/shift4.rb +19 -8
- data/lib/active_merchant/billing/gateways/shift4_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/simetrik.rb +9 -6
- data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -2
- data/lib/active_merchant/billing/gateways/smart_ps.rb +3 -3
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +2 -2
- data/lib/active_merchant/billing/gateways/stripe.rb +41 -69
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +218 -56
- data/lib/active_merchant/billing/gateways/sum_up.rb +5 -4
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +2 -2
- data/lib/active_merchant/billing/gateways/telr.rb +3 -3
- data/lib/active_merchant/billing/gateways/trans_first.rb +5 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/transact_pro.rb +2 -2
- data/lib/active_merchant/billing/gateways/transax.rb +2 -2
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +3 -3
- data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +23 -23
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -3
- data/lib/active_merchant/billing/gateways/vantiv_express.rb +84 -3
- data/lib/active_merchant/billing/gateways/verifi.rb +6 -6
- data/lib/active_merchant/billing/gateways/versa_pay.rb +307 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +2 -2
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
- data/lib/active_merchant/billing/gateways/vpos.rb +23 -11
- data/lib/active_merchant/billing/gateways/webpay.rb +3 -3
- data/lib/active_merchant/billing/gateways/wepay.rb +6 -4
- data/lib/active_merchant/billing/gateways/wirecard.rb +3 -3
- data/lib/active_merchant/billing/gateways/wompi.rb +9 -7
- data/lib/active_merchant/billing/gateways/world_net.rb +2 -2
- data/lib/active_merchant/billing/gateways/worldpay.rb +180 -63
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/gateways/xpay.rb +8 -6
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +14 -2
- data/lib/active_merchant/billing/payment_token.rb +2 -2
- data/lib/active_merchant/billing/response.rb +5 -4
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +6 -4
- data/lib/active_merchant/country.rb +2 -1
- data/lib/active_merchant/errors.rb +2 -2
- data/lib/active_merchant/net_http_ssl_connection.rb +35 -0
- data/lib/active_merchant/posts_data.rb +19 -4
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant/versionable.rb +29 -0
- data/lib/certs/cacert.pem +1326 -1491
- data/lib/support/gateway_support.rb +1 -1
- data/lib/support/ssl_verify.rb +2 -2
- data/lib/support/ssl_version.rb +2 -2
- metadata +13 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class AdyenGateway < Gateway
|
|
4
4
|
# we recommend setting up merchant-specific endpoints.
|
|
5
5
|
# https://docs.adyen.com/developers/api-manual#apiendpoints
|
|
@@ -10,15 +10,16 @@ module ActiveMerchant #:nodoc:
|
|
|
10
10
|
self.default_currency = 'USD'
|
|
11
11
|
self.currencies_without_fractions = %w(CVE DJF GNF IDR JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
|
|
12
12
|
self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LYD OMR TND)
|
|
13
|
-
self.supported_cardtypes = %i[visa master american_express diners_club jcb dankort maestro discover elo naranja cabal unionpay]
|
|
13
|
+
self.supported_cardtypes = %i[visa master american_express diners_club jcb dankort maestro discover elo naranja cabal unionpay patagonia_365 tarjeta_sol]
|
|
14
14
|
|
|
15
15
|
self.money_format = :cents
|
|
16
16
|
|
|
17
17
|
self.homepage_url = 'https://www.adyen.com/'
|
|
18
18
|
self.display_name = 'Adyen'
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
version 'v68', :payment_api
|
|
21
|
+
version 'v68', :payout_api
|
|
22
|
+
version 'v68', :recurring_api
|
|
22
23
|
|
|
23
24
|
STANDARD_ERROR_CODE_MAPPING = {
|
|
24
25
|
'0' => STANDARD_ERROR_CODE[:processing_error],
|
|
@@ -63,7 +64,7 @@ module ActiveMerchant #:nodoc:
|
|
|
63
64
|
add_3ds(post, options)
|
|
64
65
|
add_3ds_authenticated_data(post, options)
|
|
65
66
|
add_splits(post, options)
|
|
66
|
-
add_recurring_contract(post, options)
|
|
67
|
+
add_recurring_contract(post, options, payment)
|
|
67
68
|
add_network_transaction_reference(post, options)
|
|
68
69
|
add_application_info(post, options)
|
|
69
70
|
add_level_2_data(post, options)
|
|
@@ -71,6 +72,10 @@ module ActiveMerchant #:nodoc:
|
|
|
71
72
|
add_data_airline(post, options)
|
|
72
73
|
add_data_lodging(post, options)
|
|
73
74
|
add_metadata(post, options)
|
|
75
|
+
add_recurring_detail_reference(post, options)
|
|
76
|
+
add_fund_source(post, options)
|
|
77
|
+
add_fund_destination(post, options)
|
|
78
|
+
post[:localizedShopperStatement] = options[:localized_shopper_statement] if options[:localized_shopper_statement]
|
|
74
79
|
commit('authorise', post, options)
|
|
75
80
|
end
|
|
76
81
|
|
|
@@ -90,6 +95,7 @@ module ActiveMerchant #:nodoc:
|
|
|
90
95
|
add_reference(post, authorization, options)
|
|
91
96
|
add_splits(post, options)
|
|
92
97
|
add_network_transaction_reference(post, options)
|
|
98
|
+
add_shopper_statement(post, options)
|
|
93
99
|
commit('refund', post, options)
|
|
94
100
|
end
|
|
95
101
|
|
|
@@ -115,7 +121,7 @@ module ActiveMerchant #:nodoc:
|
|
|
115
121
|
post[:dateOfBirth] = options[:date_of_birth] if options[:date_of_birth]
|
|
116
122
|
post[:nationality] = options[:nationality] if options[:nationality]
|
|
117
123
|
end
|
|
118
|
-
|
|
124
|
+
add_recurring_detail_reference(post, options)
|
|
119
125
|
commit(action, post, options)
|
|
120
126
|
end
|
|
121
127
|
|
|
@@ -132,6 +138,7 @@ module ActiveMerchant #:nodoc:
|
|
|
132
138
|
add_invoice_for_modification(post, money, options)
|
|
133
139
|
add_reference(post, authorization, options)
|
|
134
140
|
add_extra_data(post, nil, options)
|
|
141
|
+
add_recurring_detail_reference(post, options)
|
|
135
142
|
commit('adjustAuthorisation', post, options)
|
|
136
143
|
end
|
|
137
144
|
|
|
@@ -247,8 +254,7 @@ module ActiveMerchant #:nodoc:
|
|
|
247
254
|
|
|
248
255
|
def add_extra_data(post, payment, options)
|
|
249
256
|
post[:telephoneNumber] = (options[:billing_address][:phone_number] if options.dig(:billing_address, :phone_number)) || (options[:billing_address][:phone] if options.dig(:billing_address, :phone)) || ''
|
|
250
|
-
post[:selectedBrand] = options[:selected_brand] if options[:selected_brand]
|
|
251
|
-
post[:selectedBrand] ||= NETWORK_TOKENIZATION_CARD_SOURCE[payment.source.to_s] if payment.is_a?(NetworkTokenizationCreditCard)
|
|
257
|
+
post[:selectedBrand] = options[:selected_brand] if options[:selected_brand] && !post[:selectedBrand]
|
|
252
258
|
post[:deliveryDate] = options[:delivery_date] if options[:delivery_date]
|
|
253
259
|
post[:merchantOrderReference] = options[:merchant_order_reference] if options[:merchant_order_reference]
|
|
254
260
|
post[:captureDelayHours] = options[:capture_delay_hours] if options[:capture_delay_hours]
|
|
@@ -274,12 +280,12 @@ module ActiveMerchant #:nodoc:
|
|
|
274
280
|
post[:additionalData] ||= {}
|
|
275
281
|
post[:additionalData][:overwriteBrand] = normalize(options[:overwrite_brand]) if options[:overwrite_brand]
|
|
276
282
|
post[:additionalData][:customRoutingFlag] = options[:custom_routing_flag] if options[:custom_routing_flag]
|
|
277
|
-
post[:additionalData]['paymentdatasource.type'] = NETWORK_TOKENIZATION_CARD_SOURCE[payment.source.to_s] if payment.is_a?(NetworkTokenizationCreditCard)
|
|
278
283
|
post[:additionalData][:authorisationType] = options[:authorisation_type] if options[:authorisation_type]
|
|
279
284
|
post[:additionalData][:adjustAuthorisationData] = options[:adjust_authorisation_data] if options[:adjust_authorisation_data]
|
|
280
285
|
post[:additionalData][:industryUsage] = options[:industry_usage] if options[:industry_usage]
|
|
281
286
|
post[:additionalData][:RequestedTestAcquirerResponseCode] = options[:requested_test_acquirer_response_code] if options[:requested_test_acquirer_response_code] && test?
|
|
282
287
|
post[:additionalData][:updateShopperStatement] = options[:update_shopper_statement] if options[:update_shopper_statement]
|
|
288
|
+
post[:additionalData][:manualCapture] = options[:manual_capture] if options[:manual_capture]
|
|
283
289
|
end
|
|
284
290
|
|
|
285
291
|
def extract_and_transform(mapper, from)
|
|
@@ -293,8 +299,8 @@ module ActiveMerchant #:nodoc:
|
|
|
293
299
|
return unless options[:level_2_data].present?
|
|
294
300
|
|
|
295
301
|
mapper = {
|
|
296
|
-
|
|
297
|
-
|
|
302
|
+
'enhancedSchemeData.totalTaxAmount': 'total_tax_amount',
|
|
303
|
+
'enhancedSchemeData.customerReference': 'customer_reference'
|
|
298
304
|
}
|
|
299
305
|
post[:additionalData].merge!(extract_and_transform(mapper, options[:level_2_data]))
|
|
300
306
|
end
|
|
@@ -302,13 +308,13 @@ module ActiveMerchant #:nodoc:
|
|
|
302
308
|
def add_level_3_data(post, options)
|
|
303
309
|
return unless options[:level_3_data].present?
|
|
304
310
|
|
|
305
|
-
mapper = {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
311
|
+
mapper = { 'enhancedSchemeData.freightAmount': 'freight_amount',
|
|
312
|
+
'enhancedSchemeData.destinationStateProvinceCode': 'destination_state_province_code',
|
|
313
|
+
'enhancedSchemeData.shipFromPostalCode': 'ship_from_postal_code',
|
|
314
|
+
'enhancedSchemeData.orderDate': 'order_date',
|
|
315
|
+
'enhancedSchemeData.destinationPostalCode': 'destination_postal_code',
|
|
316
|
+
'enhancedSchemeData.destinationCountryCode': 'destination_country_code',
|
|
317
|
+
'enhancedSchemeData.dutyAmount': 'duty_amount' }
|
|
312
318
|
|
|
313
319
|
post[:additionalData].merge!(extract_and_transform(mapper, options[:level_3_data]))
|
|
314
320
|
|
|
@@ -362,6 +368,26 @@ module ActiveMerchant #:nodoc:
|
|
|
362
368
|
post[:additionalData].merge!(extract_and_transform(leg_data, options[:additional_data_airline][:leg]))
|
|
363
369
|
end
|
|
364
370
|
|
|
371
|
+
# temporary duplication with minor modification (:legs array with nested hashes instead of a single :leg hash)
|
|
372
|
+
# this should preserve backward-compatibility with :leg logic above until it is deprecated/removed
|
|
373
|
+
if options[:additional_data_airline][:legs].present?
|
|
374
|
+
options[:additional_data_airline][:legs].each_with_index do |leg, number|
|
|
375
|
+
leg_data = %w[
|
|
376
|
+
carrier_code
|
|
377
|
+
class_of_travel
|
|
378
|
+
date_of_travel
|
|
379
|
+
depart_airport
|
|
380
|
+
depart_tax
|
|
381
|
+
destination_code
|
|
382
|
+
fare_base_code
|
|
383
|
+
flight_number
|
|
384
|
+
stop_over_code
|
|
385
|
+
].each_with_object({}) { |value, hash| hash["airline.leg#{number + 1}.#{value}"] = value }
|
|
386
|
+
|
|
387
|
+
post[:additionalData].merge!(extract_and_transform(leg_data, leg))
|
|
388
|
+
end
|
|
389
|
+
end
|
|
390
|
+
|
|
365
391
|
if options[:additional_data_airline][:passenger].present?
|
|
366
392
|
passenger_data = %w[
|
|
367
393
|
date_of_birth
|
|
@@ -403,11 +429,9 @@ module ActiveMerchant #:nodoc:
|
|
|
403
429
|
end
|
|
404
430
|
|
|
405
431
|
def add_shopper_statement(post, options)
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
post[:additionalData] =
|
|
409
|
-
shopperStatement: options[:shopper_statement]
|
|
410
|
-
}
|
|
432
|
+
post[:additionalData] ||= {}
|
|
433
|
+
post[:additionalData][:shopperStatement] = options[:shopper_statement] if options[:shopper_statement]
|
|
434
|
+
post[:additionalData][:localizedShopperStatement] = options[:localized_shopper_statement] if options[:localized_shopper_statement]
|
|
411
435
|
end
|
|
412
436
|
|
|
413
437
|
def add_merchant_data(post, options)
|
|
@@ -435,16 +459,17 @@ module ActiveMerchant #:nodoc:
|
|
|
435
459
|
|
|
436
460
|
splits = []
|
|
437
461
|
split_data.each do |split|
|
|
438
|
-
amount
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
462
|
+
if split['amount']
|
|
463
|
+
amount = {}
|
|
464
|
+
amount[:value] = split['amount']['value'] if split['amount']['value']
|
|
465
|
+
amount[:currency] = split['amount']['currency'] if split['amount']['currency']
|
|
466
|
+
end
|
|
442
467
|
|
|
443
468
|
split_hash = {
|
|
444
|
-
amount: amount,
|
|
445
469
|
type: split['type'],
|
|
446
470
|
reference: split['reference']
|
|
447
471
|
}
|
|
472
|
+
split_hash[:amount] = amount unless amount.nil?
|
|
448
473
|
split_hash['account'] = split['account'] if split['account']
|
|
449
474
|
splits.push(split_hash)
|
|
450
475
|
end
|
|
@@ -465,9 +490,7 @@ module ActiveMerchant #:nodoc:
|
|
|
465
490
|
end
|
|
466
491
|
|
|
467
492
|
def add_shopper_interaction(post, payment, options = {})
|
|
468
|
-
if
|
|
469
|
-
(payment.respond_to?(:verification_value) && payment.verification_value && options.dig(:stored_credential, :initial_transaction).nil?) ||
|
|
470
|
-
payment.is_a?(NetworkTokenizationCreditCard)
|
|
493
|
+
if ecommerce_shopper_interaction?(payment, options)
|
|
471
494
|
shopper_interaction = 'Ecommerce'
|
|
472
495
|
else
|
|
473
496
|
shopper_interaction = 'ContAuth'
|
|
@@ -510,9 +533,12 @@ module ActiveMerchant #:nodoc:
|
|
|
510
533
|
end
|
|
511
534
|
|
|
512
535
|
def add_billing_address(post, options, address)
|
|
536
|
+
address[:address1] = 'NA' if address[:address1].blank?
|
|
537
|
+
address[:address2] = 'NA' if address[:address2].blank?
|
|
538
|
+
|
|
513
539
|
post[:billingAddress] = {}
|
|
514
|
-
post[:billingAddress][:street] = options[:address_override] == true ? address[:address2] : address[:address1]
|
|
515
|
-
post[:billingAddress][:houseNumberOrName] = options[:address_override] == true ? address[:address1] : address[:address2]
|
|
540
|
+
post[:billingAddress][:street] = options[:address_override] == true ? address[:address2] : address[:address1]
|
|
541
|
+
post[:billingAddress][:houseNumberOrName] = options[:address_override] == true ? address[:address1] : address[:address2]
|
|
516
542
|
post[:billingAddress][:postalCode] = address[:zip] if address[:zip]
|
|
517
543
|
post[:billingAddress][:city] = address[:city] || 'NA'
|
|
518
544
|
post[:billingAddress][:stateOrProvince] = get_state(address)
|
|
@@ -532,7 +558,7 @@ module ActiveMerchant #:nodoc:
|
|
|
532
558
|
currency = options[:currency] || currency(money)
|
|
533
559
|
amount = {
|
|
534
560
|
value: localized_amount(money, currency),
|
|
535
|
-
currency:
|
|
561
|
+
currency:
|
|
536
562
|
}
|
|
537
563
|
|
|
538
564
|
post[:amount] = amount
|
|
@@ -542,24 +568,33 @@ module ActiveMerchant #:nodoc:
|
|
|
542
568
|
currency = options[:currency] || currency(money)
|
|
543
569
|
amount = {
|
|
544
570
|
value: localized_amount(money, currency),
|
|
545
|
-
currency:
|
|
571
|
+
currency:
|
|
546
572
|
}
|
|
547
573
|
post[:modificationAmount] = amount
|
|
548
574
|
end
|
|
549
575
|
|
|
550
576
|
def add_payment(post, payment, options, action = nil)
|
|
551
|
-
|
|
577
|
+
case payment
|
|
578
|
+
when String
|
|
552
579
|
_, _, recurring_detail_reference = payment.split('#')
|
|
553
580
|
post[:selectedRecurringDetailReference] = recurring_detail_reference
|
|
554
581
|
options[:recurring_contract_type] ||= 'RECURRING'
|
|
555
|
-
|
|
582
|
+
when Check
|
|
556
583
|
add_bank_account(post, payment, options, action)
|
|
557
584
|
else
|
|
558
|
-
|
|
585
|
+
add_network_tokenization_card(post, payment, options) if network_tokenization_payment?(payment, options)
|
|
559
586
|
add_card(post, payment)
|
|
560
587
|
end
|
|
561
588
|
end
|
|
562
589
|
|
|
590
|
+
def network_tokenization_payment?(payment, options)
|
|
591
|
+
payment.is_a?(NetworkTokenizationCreditCard) || options[:wallet_type] == :google_pay
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
def add_recurring_detail_reference(post, options)
|
|
595
|
+
post[:selectedRecurringDetailReference] = options[:recurring_detail_reference] if options[:recurring_detail_reference].present?
|
|
596
|
+
end
|
|
597
|
+
|
|
563
598
|
def add_bank_account(post, bank_account, options, action)
|
|
564
599
|
bank = {
|
|
565
600
|
bankAccountNumber: bank_account.account_number,
|
|
@@ -617,25 +652,44 @@ module ActiveMerchant #:nodoc:
|
|
|
617
652
|
post[:originalReference] = original_reference
|
|
618
653
|
end
|
|
619
654
|
|
|
620
|
-
def
|
|
621
|
-
|
|
655
|
+
def add_network_tokenization_card(post, payment, options)
|
|
656
|
+
selected_brand = NETWORK_TOKENIZATION_CARD_SOURCE[options[:wallet_type]&.to_s || payment.source.to_s]
|
|
657
|
+
if selected_brand
|
|
658
|
+
post[:selectedBrand] = selected_brand
|
|
659
|
+
post[:additionalData] = {} unless post[:additionalData]
|
|
660
|
+
post[:additionalData]['paymentdatasource.type'] = selected_brand
|
|
661
|
+
post[:additionalData]['paymentdatasource.tokenized'] = options[:wallet_type] ? 'false' : 'true' if selected_brand == 'googlepay'
|
|
662
|
+
end
|
|
663
|
+
|
|
664
|
+
return if skip_mpi_data?(payment, options)
|
|
665
|
+
|
|
666
|
+
post[:mpiData] = {
|
|
667
|
+
authenticationResponse: 'Y',
|
|
668
|
+
directoryResponse: 'Y',
|
|
669
|
+
eci: payment.eci || '07'
|
|
670
|
+
}
|
|
622
671
|
|
|
623
|
-
|
|
624
|
-
post[:mpiData][
|
|
625
|
-
post[:mpiData][:cavv] = payment.payment_cryptogram
|
|
626
|
-
post[:mpiData][:directoryResponse] = 'Y'
|
|
627
|
-
post[:mpiData][:eci] = payment.eci || '07'
|
|
672
|
+
cryptogram_field = payment.try(:network_token?) ? :tokenAuthenticationVerificationValue : :cavv
|
|
673
|
+
post[:mpiData][cryptogram_field] = payment.payment_cryptogram
|
|
628
674
|
end
|
|
629
675
|
|
|
630
|
-
def add_recurring_contract(post, options = {})
|
|
631
|
-
return unless options[:recurring_contract_type]
|
|
676
|
+
def add_recurring_contract(post, options = {}, payment = nil)
|
|
677
|
+
return unless options[:recurring_contract_type] || payment.try(:network_token?)
|
|
632
678
|
|
|
633
|
-
post[:recurring]
|
|
634
|
-
post[:recurring][:contract] = options[:recurring_contract_type]
|
|
679
|
+
post[:recurring] ||= {}
|
|
680
|
+
post[:recurring][:contract] = options[:recurring_contract_type] if options[:recurring_contract_type]
|
|
635
681
|
post[:recurring][:recurringDetailName] = options[:recurring_detail_name] if options[:recurring_detail_name]
|
|
636
682
|
post[:recurring][:recurringExpiry] = options[:recurring_expiry] if options[:recurring_expiry]
|
|
637
683
|
post[:recurring][:recurringFrequency] = options[:recurring_frequency] if options[:recurring_frequency]
|
|
638
684
|
post[:recurring][:tokenService] = options[:token_service] if options[:token_service]
|
|
685
|
+
|
|
686
|
+
if payment.try(:network_token?)
|
|
687
|
+
post[:recurring][:contract] = 'EXTERNAL'
|
|
688
|
+
post[:recurring][:tokenService] = case payment.brand
|
|
689
|
+
when 'visa' then 'VISATOKENSERVICE'
|
|
690
|
+
else 'MCTOKENSERVICE'
|
|
691
|
+
end
|
|
692
|
+
end
|
|
639
693
|
end
|
|
640
694
|
|
|
641
695
|
def add_application_info(post, options)
|
|
@@ -736,6 +790,7 @@ module ActiveMerchant #:nodoc:
|
|
|
736
790
|
|
|
737
791
|
post[:fundSource] = {}
|
|
738
792
|
post[:fundSource][:additionalData] = fund_source[:additional_data] if fund_source[:additional_data]
|
|
793
|
+
post[:fundSource][:shopperEmail] = fund_source[:shopper_email] if fund_source[:shopper_email]
|
|
739
794
|
|
|
740
795
|
if fund_source[:first_name] && fund_source[:last_name]
|
|
741
796
|
post[:fundSource][:shopperName] = {}
|
|
@@ -748,6 +803,13 @@ module ActiveMerchant #:nodoc:
|
|
|
748
803
|
end
|
|
749
804
|
end
|
|
750
805
|
|
|
806
|
+
def add_fund_destination(post, options)
|
|
807
|
+
return unless fund_destination = options[:fund_destination]
|
|
808
|
+
|
|
809
|
+
post[:fundDestination] = {}
|
|
810
|
+
post[:fundDestination][:additionalData] = fund_destination[:additional_data] if fund_destination[:additional_data]
|
|
811
|
+
end
|
|
812
|
+
|
|
751
813
|
def add_metadata(post, options = {})
|
|
752
814
|
return unless options[:metadata]
|
|
753
815
|
|
|
@@ -819,11 +881,11 @@ module ActiveMerchant #:nodoc:
|
|
|
819
881
|
def endpoint(action)
|
|
820
882
|
case action
|
|
821
883
|
when 'disable', 'storeToken'
|
|
822
|
-
"Recurring/#{
|
|
884
|
+
"Recurring/#{fetch_version(:recurring_api)}/#{action}"
|
|
823
885
|
when 'payout'
|
|
824
|
-
"Payout/#{
|
|
886
|
+
"Payout/#{fetch_version(:payout_api)}/#{action}"
|
|
825
887
|
else
|
|
826
|
-
"Payment/#{
|
|
888
|
+
"Payment/#{fetch_version(:payment_api)}/#{action}"
|
|
827
889
|
end
|
|
828
890
|
end
|
|
829
891
|
|
|
@@ -889,8 +951,6 @@ module ActiveMerchant #:nodoc:
|
|
|
889
951
|
end
|
|
890
952
|
|
|
891
953
|
def authorize_message_from(response, options = {})
|
|
892
|
-
return raw_authorize_error_message(response) if options[:raw_error_message]
|
|
893
|
-
|
|
894
954
|
if response['refusalReason'] && response['additionalData'] && (response['additionalData']['merchantAdviceCode'] || response['additionalData']['refusalReasonRaw'])
|
|
895
955
|
"#{response['refusalReason']} | #{response['additionalData']['merchantAdviceCode'] || response['additionalData']['refusalReasonRaw']}"
|
|
896
956
|
else
|
|
@@ -898,14 +958,6 @@ module ActiveMerchant #:nodoc:
|
|
|
898
958
|
end
|
|
899
959
|
end
|
|
900
960
|
|
|
901
|
-
def raw_authorize_error_message(response)
|
|
902
|
-
if response['refusalReason'] && response['additionalData'] && response['additionalData']['refusalReasonRaw']
|
|
903
|
-
"#{response['refusalReason']} | #{response['additionalData']['refusalReasonRaw']}"
|
|
904
|
-
else
|
|
905
|
-
response['refusalReason'] || response['resultCode'] || response['message'] || response['result']
|
|
906
|
-
end
|
|
907
|
-
end
|
|
908
|
-
|
|
909
961
|
def authorization_from(action, parameters, response)
|
|
910
962
|
return nil if response['pspReference'].nil?
|
|
911
963
|
|
|
@@ -968,6 +1020,30 @@ module ActiveMerchant #:nodoc:
|
|
|
968
1020
|
def card_not_stored?(response)
|
|
969
1021
|
response.authorization ? response.authorization.split('#')[2].nil? : true
|
|
970
1022
|
end
|
|
1023
|
+
|
|
1024
|
+
def skip_mpi_data?(payment, options = {})
|
|
1025
|
+
return true if options[:shopper_interaction] == 'ContAuth' && options[:recurring_processing_model] == 'Subscription'
|
|
1026
|
+
return true if options.dig(:stored_credential, :initiator) == 'merchant' && payment.is_a?(NetworkTokenizationCreditCard)
|
|
1027
|
+
|
|
1028
|
+
# Skips adding the NT mpi data if it is explicitly skipped in options, or if it is MIT and not the initial transaction.
|
|
1029
|
+
options[:wallet_type] || (!options.dig(:stored_credential, :initial_transaction) && options.dig(:stored_credential, :initiator) == 'merchant')
|
|
1030
|
+
end
|
|
1031
|
+
|
|
1032
|
+
def ecommerce_shopper_interaction?(payment, options)
|
|
1033
|
+
return true if payment.is_a?(NetworkTokenizationCreditCard) && options.dig(:stored_credential, :initiator) != 'merchant'
|
|
1034
|
+
return true unless (stored_credential = options[:stored_credential])
|
|
1035
|
+
|
|
1036
|
+
cardholder_shopper_interaction?(stored_credential) ||
|
|
1037
|
+
(payment.respond_to?(:verification_value) && payment.verification_value && stored_credential[:initial_transaction])
|
|
1038
|
+
end
|
|
1039
|
+
|
|
1040
|
+
def cardholder_shopper_interaction?(stored_credential)
|
|
1041
|
+
if stored_credential[:reason_type] == 'unscheduled'
|
|
1042
|
+
stored_credential[:initial_transaction] && stored_credential[:initiator] == 'cardholder'
|
|
1043
|
+
else
|
|
1044
|
+
stored_credential[:initiator] == 'cardholder'
|
|
1045
|
+
end
|
|
1046
|
+
end
|
|
971
1047
|
end
|
|
972
1048
|
end
|
|
973
1049
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class AirwallexGateway < Gateway
|
|
4
4
|
self.test_url = 'https://api-demo.airwallex.com/api/v1'
|
|
5
5
|
self.live_url = 'https://pci-api.airwallex.com/api/v1'
|
|
@@ -152,7 +152,7 @@ module ActiveMerchant #:nodoc:
|
|
|
152
152
|
def build_request_url(action, id = nil)
|
|
153
153
|
base_url = (test? ? test_url : live_url)
|
|
154
154
|
endpoint = ENDPOINTS[action].to_s
|
|
155
|
-
endpoint = id.present? ? endpoint % { id:
|
|
155
|
+
endpoint = id.present? ? endpoint % { id: } : endpoint
|
|
156
156
|
base_url + endpoint
|
|
157
157
|
end
|
|
158
158
|
|
|
@@ -235,16 +235,23 @@ module ActiveMerchant #:nodoc:
|
|
|
235
235
|
end
|
|
236
236
|
|
|
237
237
|
def add_order(post, options)
|
|
238
|
-
return unless shipping_address
|
|
238
|
+
return unless options[:shipping_address] || options[:products]
|
|
239
|
+
|
|
240
|
+
if shipping_address = options[:shipping_address]
|
|
241
|
+
physical_address = build_shipping_address(shipping_address)
|
|
242
|
+
first_name, last_name = split_names(shipping_address[:name])
|
|
243
|
+
shipping = {}
|
|
244
|
+
shipping[:first_name] = first_name if first_name
|
|
245
|
+
shipping[:last_name] = last_name if last_name
|
|
246
|
+
shipping[:phone_number] = shipping_address[:phone_number] if shipping_address[:phone_number]
|
|
247
|
+
shipping[:address] = physical_address
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
order = {}
|
|
251
|
+
order[:shipping] = shipping if shipping
|
|
252
|
+
order[:products] = options[:products] if options[:products]
|
|
239
253
|
|
|
240
|
-
|
|
241
|
-
first_name, last_name = split_names(shipping_address[:name])
|
|
242
|
-
shipping = {}
|
|
243
|
-
shipping[:first_name] = first_name if first_name
|
|
244
|
-
shipping[:last_name] = last_name if last_name
|
|
245
|
-
shipping[:phone_number] = shipping_address[:phone_number] if shipping_address[:phone_number]
|
|
246
|
-
shipping[:address] = physical_address
|
|
247
|
-
post[:order] = { shipping: shipping }
|
|
254
|
+
post[:order] = order
|
|
248
255
|
end
|
|
249
256
|
|
|
250
257
|
def build_shipping_address(shipping_address)
|
|
@@ -296,7 +303,7 @@ module ActiveMerchant #:nodoc:
|
|
|
296
303
|
eci: three_d_secure[:eci]
|
|
297
304
|
}.merge(three_ds_version_specific_fields(three_d_secure))
|
|
298
305
|
|
|
299
|
-
pm_options ? pm_options.merge!(external_three_ds:
|
|
306
|
+
pm_options ? pm_options.merge!(external_three_ds:) : post['payment_method_options'] = { card: { external_three_ds: } }
|
|
300
307
|
end
|
|
301
308
|
|
|
302
309
|
def format_three_ds_version(three_d_secure)
|
|
@@ -326,7 +333,7 @@ module ActiveMerchant #:nodoc:
|
|
|
326
333
|
end
|
|
327
334
|
|
|
328
335
|
def add_descriptor(post, options)
|
|
329
|
-
post[:descriptor] = options[:description] if options[:description]
|
|
336
|
+
post[:descriptor] = truncate(options[:description], 32) if options[:description]
|
|
330
337
|
end
|
|
331
338
|
|
|
332
339
|
def parse(body)
|
|
@@ -373,7 +380,7 @@ module ActiveMerchant #:nodoc:
|
|
|
373
380
|
end
|
|
374
381
|
|
|
375
382
|
def authorization_from(response)
|
|
376
|
-
response.dig('latest_payment_attempt', 'payment_intent_id')
|
|
383
|
+
response.dig('latest_payment_attempt', 'payment_intent_id') || response.dig('payment_intent_id')
|
|
377
384
|
end
|
|
378
385
|
|
|
379
386
|
def error_code_from(response)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'jose'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
class AleloGateway < Gateway
|
|
6
6
|
class_attribute :prelive_url
|
|
7
7
|
|
|
@@ -149,9 +149,9 @@ module ActiveMerchant #:nodoc:
|
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
{
|
|
152
|
-
key
|
|
153
|
-
uuid
|
|
154
|
-
access_token
|
|
152
|
+
key:,
|
|
153
|
+
uuid:,
|
|
154
|
+
access_token:,
|
|
155
155
|
multiresp: multiresp.responses.present? ? multiresp : nil
|
|
156
156
|
}
|
|
157
157
|
rescue ActiveMerchant::OAuthResponseError => e
|
|
@@ -173,7 +173,7 @@ module ActiveMerchant #:nodoc:
|
|
|
173
173
|
token = JOSE::JWE.block_encrypt(jwk, body.to_json, alg_enc).compact
|
|
174
174
|
|
|
175
175
|
encrypted_body = {
|
|
176
|
-
token
|
|
176
|
+
token:,
|
|
177
177
|
uuid: credentials[:uuid]
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -189,7 +189,7 @@ module ActiveMerchant
|
|
|
189
189
|
return 100 unless options[:verify_amount].present?
|
|
190
190
|
|
|
191
191
|
amount = options[:verify_amount]
|
|
192
|
-
raise ArgumentError.new 'verify_amount value must be an integer' unless amount.is_a?(Integer) && !amount.negative? || amount.is_a?(String) && amount.match?(/^\d+$/) && !amount.to_i.negative?
|
|
192
|
+
raise ArgumentError.new 'verify_amount value must be an integer' unless (amount.is_a?(Integer) && !amount.negative?) || (amount.is_a?(String) && amount.match?(/^\d+$/) && !amount.to_i.negative?)
|
|
193
193
|
raise ArgumentError.new 'Billing address including zip code is required for a 0 amount verify' if amount.to_i.zero? && !validate_billing_address_values?(options)
|
|
194
194
|
|
|
195
195
|
amount.to_i
|
|
@@ -839,8 +839,8 @@ module ActiveMerchant
|
|
|
839
839
|
end
|
|
840
840
|
end
|
|
841
841
|
|
|
842
|
-
def commit(action, options = {}, &
|
|
843
|
-
raw_response = ssl_post(url, post_data(action, &
|
|
842
|
+
def commit(action, options = {}, &)
|
|
843
|
+
raw_response = ssl_post(url, post_data(action, &), headers)
|
|
844
844
|
response = parse(action, raw_response, options)
|
|
845
845
|
|
|
846
846
|
avs_result_code = response[:avs_result_code].upcase if response[:avs_result_code]
|
|
@@ -855,8 +855,8 @@ module ActiveMerchant
|
|
|
855
855
|
response,
|
|
856
856
|
authorization: authorization_from(action, response),
|
|
857
857
|
test: test?,
|
|
858
|
-
avs_result
|
|
859
|
-
cvv_result
|
|
858
|
+
avs_result:,
|
|
859
|
+
cvv_result:,
|
|
860
860
|
fraud_review: fraud_review?(response),
|
|
861
861
|
error_code: map_error_code(response[:response_code], response[:response_reason_code])
|
|
862
862
|
)
|
|
@@ -903,7 +903,7 @@ module ActiveMerchant
|
|
|
903
903
|
doc = Nokogiri::XML(body)
|
|
904
904
|
doc.remove_namespaces!
|
|
905
905
|
|
|
906
|
-
response = { action:
|
|
906
|
+
response = { action: }
|
|
907
907
|
|
|
908
908
|
response[:response_code] = if (element = doc.at_xpath('//transactionResponse/responseCode'))
|
|
909
909
|
empty?(element.content) ? nil : element.content.to_i
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
# For more information on the Authorize.Net Gateway please visit their {Integration Center}[http://developer.authorize.net/]
|
|
4
4
|
#
|
|
5
5
|
# The login and password are not the username and password you use to
|
|
@@ -126,7 +126,7 @@ module ActiveMerchant #:nodoc:
|
|
|
126
126
|
# * <tt>subscription_id</tt> -- A string containing the +subscription_id+ of the recurring payment already in place
|
|
127
127
|
# for a given credit card. (REQUIRED)
|
|
128
128
|
def cancel_recurring(subscription_id)
|
|
129
|
-
request = build_recurring_request(:cancel, subscription_id:
|
|
129
|
+
request = build_recurring_request(:cancel, subscription_id:)
|
|
130
130
|
recurring_commit(:cancel, request)
|
|
131
131
|
end
|
|
132
132
|
|
|
@@ -139,7 +139,7 @@ module ActiveMerchant #:nodoc:
|
|
|
139
139
|
# * <tt>subscription_id</tt> -- A string containing the +subscription_id+ of the recurring payment already in place
|
|
140
140
|
# for a given credit card. (REQUIRED)
|
|
141
141
|
def status_recurring(subscription_id)
|
|
142
|
-
request = build_recurring_request(:status, subscription_id:
|
|
142
|
+
request = build_recurring_request(:status, subscription_id:)
|
|
143
143
|
recurring_commit(:status, request)
|
|
144
144
|
end
|
|
145
145
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
# ==== Customer Information Manager (CIM)
|
|
6
6
|
#
|
|
7
7
|
# The Authorize.Net Customer Information Manager (CIM) is an optional additional service that allows you to store sensitive payment information on
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class AxcessmsGateway < Gateway
|
|
4
4
|
self.test_url = 'https://test.ctpe.io/payment/ctpe'
|
|
5
5
|
self.live_url = 'https://ctpe.io/payment/ctpe'
|
|
@@ -75,7 +75,7 @@ module ActiveMerchant #:nodoc:
|
|
|
75
75
|
success,
|
|
76
76
|
message,
|
|
77
77
|
response,
|
|
78
|
-
authorization
|
|
78
|
+
authorization:,
|
|
79
79
|
test: (response[:mode] != 'LIVE')
|
|
80
80
|
)
|
|
81
81
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'nokogiri'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
class BamboraApacGateway < Gateway
|
|
6
6
|
self.live_url = 'https://www.bambora.co.nz/interface/api'
|
|
7
7
|
self.test_url = 'https://demo.bambora.co.nz/interface/api'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'nokogiri'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
# For more information visit {Bank Frick Acquiring Services}[http://www.bankfrickacquiring.com/merchantsolutions_en.html]
|
|
6
6
|
#
|
|
7
7
|
# Written by Piers Chambers (Varyonic.com)
|