activemerchant 1.133.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 +450 -0
- 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 +16 -4
- data/lib/active_merchant/billing/compatibility.rb +4 -4
- data/lib/active_merchant/billing/credit_card.rb +35 -16
- data/lib/active_merchant/billing/credit_card_formatting.rb +13 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +74 -19
- data/lib/active_merchant/billing/gateway.rb +22 -2
- data/lib/active_merchant/billing/gateways/adyen.rb +282 -87
- data/lib/active_merchant/billing/gateways/airwallex.rb +46 -25
- data/lib/active_merchant/billing/gateways/alelo.rb +29 -11
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +49 -41
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +14 -10
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -5
- data/lib/active_merchant/billing/gateways/axcessms.rb +9 -5
- 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 +6 -4
- 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 +12 -8
- 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 +15 -7
- data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -5
- 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 +68 -23
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +266 -89
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -3
- 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 +7 -4
- data/lib/active_merchant/billing/gateways/card_save.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_stream.rb +12 -13
- 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 +4 -4
- data/lib/active_merchant/billing/gateways/cc5.rb +2 -2
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb +331 -0
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_xml.rb +220 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +9 -242
- 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 +362 -50
- data/lib/active_merchant/billing/gateways/clearhaus.rb +2 -2
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +117 -35
- 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 +109 -20
- 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 +379 -100
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +147 -76
- data/lib/active_merchant/billing/gateways/d_local.rb +45 -22
- data/lib/active_merchant/billing/gateways/data_cash.rb +22 -18
- data/lib/active_merchant/billing/gateways/datatrans.rb +284 -0
- data/lib/active_merchant/billing/gateways/decidir.rb +82 -46
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +31 -35
- data/lib/active_merchant/billing/gateways/deepstack.rb +382 -0
- 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 +116 -68
- data/lib/active_merchant/billing/gateways/efsnet.rb +13 -8
- data/lib/active_merchant/billing/gateways/elavon.rb +80 -47
- data/lib/active_merchant/billing/gateways/element.rb +39 -10
- data/lib/active_merchant/billing/gateways/epay.rb +8 -4
- data/lib/active_merchant/billing/gateways/evo_ca.rb +8 -4
- data/lib/active_merchant/billing/gateways/eway.rb +6 -4
- data/lib/active_merchant/billing/gateways/eway_managed.rb +8 -4
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +3 -3
- data/lib/active_merchant/billing/gateways/exact.rb +8 -4
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +37 -7
- data/lib/active_merchant/billing/gateways/federated_canada.rb +8 -4
- 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_common.rb +15 -0
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_json.rb +190 -0
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb +183 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +8 -174
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +8 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +9 -5
- data/lib/active_merchant/billing/gateways/flex_charge.rb +359 -0
- 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 +6 -4
- data/lib/active_merchant/billing/gateways/global_collect.rb +69 -50
- 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 +287 -0
- data/lib/active_merchant/billing/gateways/hps.rb +40 -47
- data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -6
- data/lib/active_merchant/billing/gateways/instapay.rb +9 -6
- data/lib/active_merchant/billing/gateways/ipg.rb +14 -10
- data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
- data/lib/active_merchant/billing/gateways/iridium.rb +18 -8
- data/lib/active_merchant/billing/gateways/itransact.rb +8 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +12 -9
- data/lib/active_merchant/billing/gateways/ixopay.rb +4 -4
- data/lib/active_merchant/billing/gateways/jetpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +9 -6
- data/lib/active_merchant/billing/gateways/komoju.rb +2 -2
- data/lib/active_merchant/billing/gateways/kushki.rb +79 -16
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +8 -4
- data/lib/active_merchant/billing/gateways/litle.rb +37 -54
- 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/mastercard.rb +4 -4
- data/lib/active_merchant/billing/gateways/maxipago.rb +4 -4
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +32 -11
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +10 -7
- 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 +13 -6
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +13 -6
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -5
- data/lib/active_merchant/billing/gateways/mercury.rb +11 -5
- data/lib/active_merchant/billing/gateways/metrics_global.rb +10 -8
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -6
- data/lib/active_merchant/billing/gateways/migs.rb +8 -4
- data/lib/active_merchant/billing/gateways/mit.rb +10 -5
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +21 -13
- data/lib/active_merchant/billing/gateways/moka.rb +2 -2
- data/lib/active_merchant/billing/gateways/monei.rb +3 -3
- data/lib/active_merchant/billing/gateways/moneris.rb +11 -5
- data/lib/active_merchant/billing/gateways/money_movers.rb +8 -4
- 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 +18 -10
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/net_registry.rb +6 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +4 -6
- data/lib/active_merchant/billing/gateways/netbilling.rb +8 -4
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +9 -5
- data/lib/active_merchant/billing/gateways/nmi.rb +29 -8
- data/lib/active_merchant/billing/gateways/nuvei.rb +573 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +8 -4
- data/lib/active_merchant/billing/gateways/omise.rb +2 -2
- data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/opp.rb +3 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +12 -6
- data/lib/active_merchant/billing/gateways/orbital/orbital_codes.rb +273 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +114 -94
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +9 -6
- 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 +8 -4
- data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -5
- data/lib/active_merchant/billing/gateways/pay_junction.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_trace.rb +36 -22
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +14 -14
- data/lib/active_merchant/billing/gateways/payeezy.rb +26 -13
- data/lib/active_merchant/billing/gateways/payex.rb +8 -6
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +3 -3
- 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 +12 -11
- 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 +10 -6
- data/lib/active_merchant/billing/gateways/paymentez.rb +30 -16
- 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 +48 -24
- data/lib/active_merchant/billing/gateways/payscout.rb +9 -6
- data/lib/active_merchant/billing/gateways/paystation.rb +9 -5
- 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.rb +6 -2
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +6 -6
- data/lib/active_merchant/billing/gateways/pin.rb +126 -41
- data/lib/active_merchant/billing/gateways/plexo.rb +71 -20
- data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -2
- data/lib/active_merchant/billing/gateways/priority.rb +29 -24
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +8 -4
- data/lib/active_merchant/billing/gateways/psl_card.rb +6 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +9 -5
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -5
- data/lib/active_merchant/billing/gateways/quickbooks.rb +27 -17
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +7 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +8 -4
- 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 +172 -53
- data/lib/active_merchant/billing/gateways/reach.rb +16 -9
- data/lib/active_merchant/billing/gateways/redsys.rb +7 -15
- data/lib/active_merchant/billing/gateways/redsys_rest.rb +545 -0
- data/lib/active_merchant/billing/gateways/s5.rb +5 -5
- data/lib/active_merchant/billing/gateways/safe_charge.rb +47 -24
- data/lib/active_merchant/billing/gateways/sage.rb +14 -6
- data/lib/active_merchant/billing/gateways/sage_pay.rb +81 -7
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +8 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +9 -5
- data/lib/active_merchant/billing/gateways/secure_pay.rb +10 -8
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -15
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +8 -4
- data/lib/active_merchant/billing/gateways/securion_pay.rb +26 -12
- data/lib/active_merchant/billing/gateways/shift4.rb +34 -26
- data/lib/active_merchant/billing/gateways/shift4_v2.rb +117 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +26 -17
- data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -4
- data/lib/active_merchant/billing/gateways/smart_ps.rb +10 -7
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -4
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -6
- data/lib/active_merchant/billing/gateways/stripe.rb +88 -84
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +388 -77
- data/lib/active_merchant/billing/gateways/sum_up.rb +224 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +6 -4
- data/lib/active_merchant/billing/gateways/telr.rb +6 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +6 -4
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +10 -18
- data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
- 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 +9 -5
- data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -31
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +8 -4
- data/lib/active_merchant/billing/gateways/vanco.rb +2 -4
- data/lib/active_merchant/billing/gateways/vantiv_express.rb +668 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +12 -8
- data/lib/active_merchant/billing/gateways/versa_pay.rb +307 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +8 -4
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +5 -5
- data/lib/active_merchant/billing/gateways/vpos.rb +25 -13
- 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 +10 -6
- data/lib/active_merchant/billing/gateways/wompi.rb +14 -7
- data/lib/active_merchant/billing/gateways/world_net.rb +2 -2
- data/lib/active_merchant/billing/gateways/worldpay.rb +297 -113
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +16 -13
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/gateways/xpay.rb +244 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +15 -3
- data/lib/active_merchant/billing/payment_token.rb +2 -2
- data/lib/active_merchant/billing/response.rb +7 -6
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +8 -20
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +12 -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 +3 -3
- data/lib/support/ssl_verify.rb +6 -6
- data/lib/support/ssl_version.rb +8 -8
- metadata +35 -9
|
@@ -10,8 +10,8 @@ end
|
|
|
10
10
|
|
|
11
11
|
raise 'Need braintree gem >= 2.0.0.' unless Braintree::Version::Major >= 2 && Braintree::Version::Minor >= 0
|
|
12
12
|
|
|
13
|
-
module ActiveMerchant
|
|
14
|
-
module Billing
|
|
13
|
+
module ActiveMerchant # :nodoc:
|
|
14
|
+
module Billing # :nodoc:
|
|
15
15
|
# For more information on the Braintree Gateway please visit their
|
|
16
16
|
# {Developer Portal}[https://www.braintreepayments.com/developers]
|
|
17
17
|
#
|
|
@@ -43,6 +43,9 @@ module ActiveMerchant #:nodoc:
|
|
|
43
43
|
|
|
44
44
|
self.display_name = 'Braintree (Blue Platform)'
|
|
45
45
|
|
|
46
|
+
version Braintree::Configuration::API_VERSION
|
|
47
|
+
version Braintree::Version::String, :gem
|
|
48
|
+
|
|
46
49
|
ERROR_CODES = {
|
|
47
50
|
cannot_refund_if_unsettled: 91506
|
|
48
51
|
}
|
|
@@ -75,9 +78,12 @@ module ActiveMerchant #:nodoc:
|
|
|
75
78
|
@braintree_gateway = Braintree::Gateway.new(@configuration)
|
|
76
79
|
end
|
|
77
80
|
|
|
78
|
-
def setup_purchase
|
|
81
|
+
def setup_purchase(options = {})
|
|
82
|
+
post = {}
|
|
83
|
+
add_merchant_account_id(post, options)
|
|
84
|
+
|
|
79
85
|
commit do
|
|
80
|
-
Response.new(true, 'Client token created', { client_token: @braintree_gateway.client_token.generate })
|
|
86
|
+
Response.new(true, 'Client token created', { client_token: @braintree_gateway.client_token.generate(post) })
|
|
81
87
|
end
|
|
82
88
|
end
|
|
83
89
|
|
|
@@ -106,6 +112,8 @@ module ActiveMerchant #:nodoc:
|
|
|
106
112
|
end
|
|
107
113
|
|
|
108
114
|
def credit(money, credit_card_or_vault_id, options = {})
|
|
115
|
+
return Response.new(false, DIRECT_BANK_ERROR) if credit_card_or_vault_id.is_a? Check
|
|
116
|
+
|
|
109
117
|
create_transaction(:credit, money, credit_card_or_vault_id, options)
|
|
110
118
|
end
|
|
111
119
|
|
|
@@ -139,16 +147,25 @@ module ActiveMerchant #:nodoc:
|
|
|
139
147
|
exp_month = creditcard.month.to_s
|
|
140
148
|
exp_year = creditcard.year.to_s
|
|
141
149
|
expiration = "#{exp_month}/#{exp_year}"
|
|
150
|
+
zip = options[:billing_address].try(:[], :zip)
|
|
151
|
+
address1 = options[:billing_address].try(:[], :address1)
|
|
142
152
|
payload = {
|
|
143
153
|
credit_card: {
|
|
144
154
|
number: creditcard.number,
|
|
145
155
|
expiration_date: expiration,
|
|
146
|
-
cvv: creditcard.verification_value
|
|
147
|
-
billing_address: {
|
|
148
|
-
postal_code: options[:billing_address][:zip]
|
|
149
|
-
}
|
|
156
|
+
cvv: creditcard.verification_value
|
|
150
157
|
}
|
|
151
158
|
}
|
|
159
|
+
if zip || address1
|
|
160
|
+
payload[:credit_card][:billing_address] = {}
|
|
161
|
+
payload[:credit_card][:billing_address][:postal_code] = zip if zip
|
|
162
|
+
payload[:credit_card][:billing_address][:street_address] = address1 if address1
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if merchant_account_id = (options[:merchant_account_id] || @merchant_account_id)
|
|
166
|
+
payload[:options] = { merchant_account_id: }
|
|
167
|
+
end
|
|
168
|
+
|
|
152
169
|
commit do
|
|
153
170
|
result = @braintree_gateway.verification.create(payload)
|
|
154
171
|
response = Response.new(result.success?, message_from_transaction_result(result), response_options(result))
|
|
@@ -193,15 +210,20 @@ module ActiveMerchant #:nodoc:
|
|
|
193
210
|
}
|
|
194
211
|
}, options)[:credit_card]
|
|
195
212
|
|
|
196
|
-
result = @braintree_gateway.customer.update(
|
|
213
|
+
result = @braintree_gateway.customer.update(
|
|
214
|
+
vault_id,
|
|
197
215
|
first_name: creditcard.first_name,
|
|
198
216
|
last_name: creditcard.last_name,
|
|
199
217
|
email: scrub_email(options[:email]),
|
|
200
218
|
phone: phone_from(options),
|
|
201
|
-
credit_card: credit_card_params
|
|
202
|
-
|
|
219
|
+
credit_card: credit_card_params
|
|
220
|
+
)
|
|
221
|
+
Response.new(
|
|
222
|
+
result.success?,
|
|
223
|
+
message_from_result(result),
|
|
203
224
|
braintree_customer: (customer_hash(@braintree_gateway.customer.find(vault_id), :include_credit_cards) if result.success?),
|
|
204
|
-
customer_vault_id: (result.customer.id if result.success?)
|
|
225
|
+
customer_vault_id: (result.customer.id if result.success?)
|
|
226
|
+
)
|
|
205
227
|
end
|
|
206
228
|
end
|
|
207
229
|
|
|
@@ -271,13 +293,16 @@ module ActiveMerchant #:nodoc:
|
|
|
271
293
|
device_data: options[:device_data]
|
|
272
294
|
}.merge credit_card_params
|
|
273
295
|
result = @braintree_gateway.customer.create(merge_credit_card_options(parameters, options))
|
|
274
|
-
Response.new(
|
|
296
|
+
Response.new(
|
|
297
|
+
result.success?,
|
|
298
|
+
message_from_result(result),
|
|
275
299
|
{
|
|
276
300
|
braintree_customer: (customer_hash(result.customer, :include_credit_cards) if result.success?),
|
|
277
301
|
customer_vault_id: (result.customer.id if result.success?),
|
|
278
302
|
credit_card_token: (result.customer.credit_cards[0].token if result.success?)
|
|
279
303
|
},
|
|
280
|
-
authorization: (result.customer.id if result.success?)
|
|
304
|
+
authorization: (result.customer.id if result.success?)
|
|
305
|
+
)
|
|
281
306
|
end
|
|
282
307
|
end
|
|
283
308
|
|
|
@@ -371,8 +396,8 @@ module ActiveMerchant #:nodoc:
|
|
|
371
396
|
|
|
372
397
|
def commit(&block)
|
|
373
398
|
yield
|
|
374
|
-
rescue Braintree::BraintreeError =>
|
|
375
|
-
Response.new(false,
|
|
399
|
+
rescue Braintree::BraintreeError => e
|
|
400
|
+
Response.new(false, e.class.to_s)
|
|
376
401
|
end
|
|
377
402
|
|
|
378
403
|
def message_from_result(result)
|
|
@@ -422,6 +447,8 @@ module ActiveMerchant #:nodoc:
|
|
|
422
447
|
end
|
|
423
448
|
|
|
424
449
|
def avs_code_from(transaction)
|
|
450
|
+
return unless transaction
|
|
451
|
+
|
|
425
452
|
transaction.avs_error_response_code ||
|
|
426
453
|
avs_mapping["street: #{transaction.avs_street_address_response_code}, zip: #{transaction.avs_postal_code_response_code}"]
|
|
427
454
|
end
|
|
@@ -486,18 +513,70 @@ module ActiveMerchant #:nodoc:
|
|
|
486
513
|
result.transaction&.additional_processor_response
|
|
487
514
|
end
|
|
488
515
|
|
|
516
|
+
def payment_instrument_type(result)
|
|
517
|
+
result&.payment_instrument_type
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
def credit_card_details(result)
|
|
521
|
+
if result
|
|
522
|
+
{
|
|
523
|
+
'masked_number' => result.credit_card_details&.masked_number,
|
|
524
|
+
'bin' => result.credit_card_details&.bin,
|
|
525
|
+
'last_4' => result.credit_card_details&.last_4,
|
|
526
|
+
'card_type' => result.credit_card_details&.card_type,
|
|
527
|
+
'token' => result.credit_card_details&.token,
|
|
528
|
+
'debit' => result.credit_card_details&.debit,
|
|
529
|
+
'prepaid' => result.credit_card_details&.prepaid,
|
|
530
|
+
'issuing_bank' => result.credit_card_details&.issuing_bank,
|
|
531
|
+
'country_of_issuance' => result.credit_card_details&.country_of_issuance
|
|
532
|
+
}
|
|
533
|
+
end
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
def network_token_details(result)
|
|
537
|
+
if result
|
|
538
|
+
{
|
|
539
|
+
'debit' => result.network_token_details&.debit,
|
|
540
|
+
'prepaid' => result.network_token_details&.prepaid,
|
|
541
|
+
'issuing_bank' => result.network_token_details&.issuing_bank
|
|
542
|
+
}
|
|
543
|
+
end
|
|
544
|
+
end
|
|
545
|
+
|
|
546
|
+
def google_pay_details(result)
|
|
547
|
+
if result
|
|
548
|
+
{
|
|
549
|
+
'debit' => result.google_pay_details&.debit,
|
|
550
|
+
'prepaid' => result.google_pay_details&.prepaid
|
|
551
|
+
}
|
|
552
|
+
end
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
def apple_pay_details(result)
|
|
556
|
+
if result
|
|
557
|
+
{
|
|
558
|
+
'debit' => result.apple_pay_details&.debit,
|
|
559
|
+
'prepaid' => result.apple_pay_details&.prepaid,
|
|
560
|
+
'issuing_bank' => result.apple_pay_details&.issuing_bank
|
|
561
|
+
}
|
|
562
|
+
end
|
|
563
|
+
end
|
|
564
|
+
|
|
489
565
|
def create_transaction(transaction_type, money, credit_card_or_vault_id, options)
|
|
490
566
|
transaction_params = create_transaction_parameters(money, credit_card_or_vault_id, options)
|
|
491
567
|
commit do
|
|
492
568
|
result = @braintree_gateway.transaction.send(transaction_type, transaction_params)
|
|
493
|
-
make_default_payment_method_token(result
|
|
569
|
+
make_default_payment_method_token(result, options)
|
|
494
570
|
response = Response.new(result.success?, message_from_transaction_result(result), response_params(result), response_options(result))
|
|
495
571
|
response.cvv_result['message'] = ''
|
|
496
572
|
response
|
|
497
573
|
end
|
|
498
574
|
end
|
|
499
575
|
|
|
500
|
-
def make_default_payment_method_token(result)
|
|
576
|
+
def make_default_payment_method_token(result, options)
|
|
577
|
+
return if options[:prevent_default_payment_method]
|
|
578
|
+
return unless options.dig(:paypal, :paypal_flow_type) == 'checkout_with_vault' && result.success?
|
|
579
|
+
|
|
501
580
|
@braintree_gateway.customer.update(
|
|
502
581
|
result.transaction.customer_details.id,
|
|
503
582
|
default_payment_method_token: result.transaction.paypal_details.implicitly_vaulted_payment_method_token
|
|
@@ -545,7 +624,15 @@ module ActiveMerchant #:nodoc:
|
|
|
545
624
|
def transaction_hash(result)
|
|
546
625
|
unless result.success?
|
|
547
626
|
return { 'processor_response_code' => response_code_from_result(result),
|
|
548
|
-
'additional_processor_response' => additional_processor_response_from_result(result)
|
|
627
|
+
'additional_processor_response' => additional_processor_response_from_result(result),
|
|
628
|
+
'payment_instrument_type' => payment_instrument_type(result.transaction),
|
|
629
|
+
'credit_card_details' => credit_card_details(result.transaction),
|
|
630
|
+
'network_token_details' => network_token_details(result.transaction),
|
|
631
|
+
'google_pay_details' => google_pay_details(result.transaction),
|
|
632
|
+
'apple_pay_details' => apple_pay_details(result.transaction),
|
|
633
|
+
'avs_response_code' => avs_code_from(result.transaction),
|
|
634
|
+
'cvv_response_code' => result.transaction&.cvv_response_code,
|
|
635
|
+
'gateway_message' => result.message }
|
|
549
636
|
end
|
|
550
637
|
|
|
551
638
|
transaction = result.transaction
|
|
@@ -561,6 +648,14 @@ module ActiveMerchant #:nodoc:
|
|
|
561
648
|
vault_customer = nil
|
|
562
649
|
end
|
|
563
650
|
|
|
651
|
+
credit_card_details = credit_card_details(transaction)
|
|
652
|
+
|
|
653
|
+
network_token_details = network_token_details(transaction)
|
|
654
|
+
|
|
655
|
+
google_pay_details = google_pay_details(transaction)
|
|
656
|
+
|
|
657
|
+
apple_pay_details = apple_pay_details(transaction)
|
|
658
|
+
|
|
564
659
|
customer_details = {
|
|
565
660
|
'id' => transaction.customer_details.id,
|
|
566
661
|
'email' => transaction.customer_details.email,
|
|
@@ -586,12 +681,11 @@ module ActiveMerchant #:nodoc:
|
|
|
586
681
|
'postal_code' => transaction.shipping_details.postal_code,
|
|
587
682
|
'country_name' => transaction.shipping_details.country_name
|
|
588
683
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
'
|
|
592
|
-
'
|
|
593
|
-
'
|
|
594
|
-
'token' => transaction.credit_card_details.token
|
|
684
|
+
|
|
685
|
+
paypal_details = {
|
|
686
|
+
'payer_id' => transaction.paypal_details.payer_id,
|
|
687
|
+
'payer_email' => transaction.paypal_details.payer_email,
|
|
688
|
+
'paypal_payment_token' => transaction.paypal_details.implicitly_vaulted_payment_method_token || transaction.paypal_details.token
|
|
595
689
|
}
|
|
596
690
|
|
|
597
691
|
if transaction.risk_data
|
|
@@ -605,11 +699,23 @@ module ActiveMerchant #:nodoc:
|
|
|
605
699
|
risk_data = nil
|
|
606
700
|
end
|
|
607
701
|
|
|
702
|
+
if transaction.payment_receipt
|
|
703
|
+
payment_receipt = {
|
|
704
|
+
'global_id' => transaction.payment_receipt.global_id
|
|
705
|
+
}
|
|
706
|
+
else
|
|
707
|
+
payment_receipt = nil
|
|
708
|
+
end
|
|
709
|
+
|
|
608
710
|
{
|
|
609
711
|
'order_id' => transaction.order_id,
|
|
610
712
|
'amount' => transaction.amount.to_s,
|
|
611
713
|
'status' => transaction.status,
|
|
612
714
|
'credit_card_details' => credit_card_details,
|
|
715
|
+
'network_token_details' => network_token_details,
|
|
716
|
+
'apple_pay_details' => apple_pay_details,
|
|
717
|
+
'google_pay_details' => google_pay_details,
|
|
718
|
+
'paypal_details' => paypal_details,
|
|
613
719
|
'customer_details' => customer_details,
|
|
614
720
|
'billing_details' => billing_details,
|
|
615
721
|
'shipping_details' => shipping_details,
|
|
@@ -619,7 +725,9 @@ module ActiveMerchant #:nodoc:
|
|
|
619
725
|
'network_transaction_id' => transaction.network_transaction_id || nil,
|
|
620
726
|
'processor_response_code' => response_code_from_result(result),
|
|
621
727
|
'processor_authorization_code' => transaction.processor_authorization_code,
|
|
622
|
-
'recurring' => transaction.recurring
|
|
728
|
+
'recurring' => transaction.recurring,
|
|
729
|
+
'payment_receipt' => payment_receipt,
|
|
730
|
+
'payment_instrument_type' => payment_instrument_type(transaction)
|
|
623
731
|
}
|
|
624
732
|
end
|
|
625
733
|
|
|
@@ -665,6 +773,8 @@ module ActiveMerchant #:nodoc:
|
|
|
665
773
|
|
|
666
774
|
add_3ds_info(parameters, options[:three_d_secure])
|
|
667
775
|
|
|
776
|
+
parameters[:sca_exemption] = options[:three_ds_exemption_type] if options[:three_ds_exemption_type]
|
|
777
|
+
|
|
668
778
|
if options[:payment_method_nonce].is_a?(String)
|
|
669
779
|
parameters.delete(:customer)
|
|
670
780
|
parameters[:payment_method_nonce] = options[:payment_method_nonce]
|
|
@@ -708,7 +818,7 @@ module ActiveMerchant #:nodoc:
|
|
|
708
818
|
end
|
|
709
819
|
|
|
710
820
|
def add_channel(parameters, options)
|
|
711
|
-
channel = @options[:channel] || application_id
|
|
821
|
+
channel = options[:override_application_id] || @options[:channel] || application_id
|
|
712
822
|
parameters[:channel] = channel if channel
|
|
713
823
|
end
|
|
714
824
|
|
|
@@ -803,78 +913,135 @@ module ActiveMerchant #:nodoc:
|
|
|
803
913
|
end
|
|
804
914
|
|
|
805
915
|
def add_stored_credential_data(parameters, credit_card_or_vault_id, options)
|
|
916
|
+
# Braintree has informed us that the stored_credential mapping may be incorrect
|
|
917
|
+
# In order to prevent possible breaking changes we will only apply the new logic if
|
|
918
|
+
# specifically requested. This will be the default behavior in a future release.
|
|
806
919
|
return unless (stored_credential = options[:stored_credential])
|
|
807
920
|
|
|
808
|
-
parameters
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
parameters[:transaction_source] = 'recurring'
|
|
921
|
+
add_external_vault(parameters, options)
|
|
922
|
+
stored_credentials(parameters, stored_credential)
|
|
923
|
+
end
|
|
924
|
+
|
|
925
|
+
def stored_credentials(parameters, stored_credential)
|
|
926
|
+
case stored_credential[:reason_type]
|
|
927
|
+
when 'recurring', 'installment'
|
|
928
|
+
if stored_credential[:initial_transaction]
|
|
929
|
+
parameters[:transaction_source] = "#{stored_credential[:reason_type]}_first"
|
|
818
930
|
else
|
|
819
931
|
parameters[:transaction_source] = stored_credential[:reason_type]
|
|
820
932
|
end
|
|
821
|
-
|
|
933
|
+
when 'recurring_first', 'moto'
|
|
822
934
|
parameters[:transaction_source] = stored_credential[:reason_type]
|
|
935
|
+
when 'unscheduled'
|
|
936
|
+
parameters[:transaction_source] = stored_credential[:initiator] == 'merchant' ? stored_credential[:reason_type] : ''
|
|
823
937
|
else
|
|
824
938
|
parameters[:transaction_source] = ''
|
|
825
939
|
end
|
|
826
940
|
end
|
|
827
941
|
|
|
942
|
+
def add_external_vault(parameters, options = {})
|
|
943
|
+
stored_credential = options[:stored_credential]
|
|
944
|
+
parameters[:external_vault] = {}
|
|
945
|
+
if stored_credential[:initial_transaction]
|
|
946
|
+
parameters[:external_vault][:status] = 'will_vault'
|
|
947
|
+
else
|
|
948
|
+
parameters[:external_vault][:status] = 'vaulted'
|
|
949
|
+
parameters[:external_vault][:previous_network_transaction_id] = options[:network_transaction_id] || stored_credential[:network_transaction_id]
|
|
950
|
+
end
|
|
951
|
+
end
|
|
952
|
+
|
|
828
953
|
def add_payment_method(parameters, credit_card_or_vault_id, options)
|
|
829
954
|
if credit_card_or_vault_id.is_a?(String) || credit_card_or_vault_id.is_a?(Integer)
|
|
830
|
-
|
|
831
|
-
parameters[:payment_method_token] = credit_card_or_vault_id
|
|
832
|
-
options.delete(:billing_address)
|
|
833
|
-
elsif options[:payment_method_nonce]
|
|
834
|
-
parameters[:payment_method_nonce] = credit_card_or_vault_id
|
|
835
|
-
else
|
|
836
|
-
parameters[:customer_id] = credit_card_or_vault_id
|
|
837
|
-
end
|
|
955
|
+
add_third_party_token(parameters, credit_card_or_vault_id, options)
|
|
838
956
|
else
|
|
839
957
|
parameters[:customer].merge!(
|
|
840
958
|
first_name: credit_card_or_vault_id.first_name,
|
|
841
959
|
last_name: credit_card_or_vault_id.last_name
|
|
842
960
|
)
|
|
843
961
|
if credit_card_or_vault_id.is_a?(NetworkTokenizationCreditCard)
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
eci_indicator: credit_card_or_vault_id.eci
|
|
852
|
-
}
|
|
853
|
-
elsif credit_card_or_vault_id.source == :android_pay || credit_card_or_vault_id.source == :google_pay
|
|
854
|
-
Braintree::Version::Major < 3 ? pay_card = :android_pay_card : pay_card = :google_pay_card
|
|
855
|
-
parameters[pay_card] = {
|
|
856
|
-
number: credit_card_or_vault_id.number,
|
|
857
|
-
cryptogram: credit_card_or_vault_id.payment_cryptogram,
|
|
858
|
-
expiration_month: credit_card_or_vault_id.month.to_s.rjust(2, '0'),
|
|
859
|
-
expiration_year: credit_card_or_vault_id.year.to_s,
|
|
860
|
-
google_transaction_id: credit_card_or_vault_id.transaction_id,
|
|
861
|
-
source_card_type: credit_card_or_vault_id.brand,
|
|
862
|
-
source_card_last_four: credit_card_or_vault_id.last_digits,
|
|
863
|
-
eci_indicator: credit_card_or_vault_id.eci
|
|
864
|
-
}
|
|
962
|
+
case credit_card_or_vault_id.source
|
|
963
|
+
when :apple_pay
|
|
964
|
+
add_apple_pay(parameters, credit_card_or_vault_id, options)
|
|
965
|
+
when :google_pay
|
|
966
|
+
add_google_pay(parameters, credit_card_or_vault_id)
|
|
967
|
+
else
|
|
968
|
+
add_network_tokenization_card(parameters, credit_card_or_vault_id)
|
|
865
969
|
end
|
|
866
970
|
else
|
|
867
|
-
parameters
|
|
868
|
-
number: credit_card_or_vault_id.number,
|
|
869
|
-
cvv: credit_card_or_vault_id.verification_value,
|
|
870
|
-
expiration_month: credit_card_or_vault_id.month.to_s.rjust(2, '0'),
|
|
871
|
-
expiration_year: credit_card_or_vault_id.year.to_s,
|
|
872
|
-
cardholder_name: credit_card_or_vault_id.name
|
|
873
|
-
}
|
|
971
|
+
add_credit_card(parameters, credit_card_or_vault_id)
|
|
874
972
|
end
|
|
875
973
|
end
|
|
876
974
|
end
|
|
877
975
|
|
|
976
|
+
def add_third_party_token(parameters, payment_method, options)
|
|
977
|
+
if options[:payment_method_token]
|
|
978
|
+
parameters[:payment_method_token] = payment_method
|
|
979
|
+
options.delete(:billing_address)
|
|
980
|
+
elsif options[:payment_method_nonce]
|
|
981
|
+
parameters[:payment_method_nonce] = payment_method
|
|
982
|
+
else
|
|
983
|
+
parameters[:customer_id] = payment_method
|
|
984
|
+
end
|
|
985
|
+
end
|
|
986
|
+
|
|
987
|
+
def add_credit_card(parameters, payment_method)
|
|
988
|
+
parameters[:credit_card] = {
|
|
989
|
+
number: payment_method.number,
|
|
990
|
+
cvv: payment_method.verification_value,
|
|
991
|
+
expiration_month: payment_method.month.to_s.rjust(2, '0'),
|
|
992
|
+
expiration_year: payment_method.year.to_s,
|
|
993
|
+
cardholder_name: payment_method.name
|
|
994
|
+
}
|
|
995
|
+
end
|
|
996
|
+
|
|
997
|
+
def add_apple_pay(parameters, payment_method, options)
|
|
998
|
+
if options.dig(:stored_credential, :initiator) == 'merchant'
|
|
999
|
+
parameters[:apple_pay_card] = {
|
|
1000
|
+
number: payment_method.number,
|
|
1001
|
+
expiration_month: payment_method.month.to_s.rjust(2, '0'),
|
|
1002
|
+
expiration_year: payment_method.year.to_s,
|
|
1003
|
+
cardholder_name: payment_method.name,
|
|
1004
|
+
cryptogram: 'cryptogram'
|
|
1005
|
+
}
|
|
1006
|
+
else
|
|
1007
|
+
parameters[:apple_pay_card] = {
|
|
1008
|
+
number: payment_method.number,
|
|
1009
|
+
expiration_month: payment_method.month.to_s.rjust(2, '0'),
|
|
1010
|
+
expiration_year: payment_method.year.to_s,
|
|
1011
|
+
cardholder_name: payment_method.name,
|
|
1012
|
+
cryptogram: payment_method.payment_cryptogram,
|
|
1013
|
+
eci_indicator: payment_method.eci
|
|
1014
|
+
}
|
|
1015
|
+
end
|
|
1016
|
+
end
|
|
1017
|
+
|
|
1018
|
+
def add_google_pay(parameters, payment_method)
|
|
1019
|
+
Braintree::Version::Major < 3 ? pay_card = :android_pay_card : pay_card = :google_pay_card
|
|
1020
|
+
parameters[pay_card] = {
|
|
1021
|
+
number: payment_method.number,
|
|
1022
|
+
cryptogram: payment_method.payment_cryptogram,
|
|
1023
|
+
expiration_month: payment_method.month.to_s.rjust(2, '0'),
|
|
1024
|
+
expiration_year: payment_method.year.to_s,
|
|
1025
|
+
google_transaction_id: payment_method.transaction_id,
|
|
1026
|
+
source_card_type: payment_method.brand,
|
|
1027
|
+
source_card_last_four: payment_method.last_digits,
|
|
1028
|
+
eci_indicator: payment_method.eci
|
|
1029
|
+
}
|
|
1030
|
+
end
|
|
1031
|
+
|
|
1032
|
+
def add_network_tokenization_card(parameters, payment_method)
|
|
1033
|
+
parameters[:credit_card] = {
|
|
1034
|
+
number: payment_method.number,
|
|
1035
|
+
expiration_month: payment_method.month.to_s.rjust(2, '0'),
|
|
1036
|
+
expiration_year: payment_method.year.to_s,
|
|
1037
|
+
cardholder_name: payment_method.name,
|
|
1038
|
+
network_tokenization_attributes: {
|
|
1039
|
+
cryptogram: payment_method.payment_cryptogram,
|
|
1040
|
+
ecommerce_indicator: payment_method.eci
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
end
|
|
1044
|
+
|
|
878
1045
|
def bank_account_errors(payment_method, options)
|
|
879
1046
|
if payment_method.validate.present?
|
|
880
1047
|
payment_method.validate
|
|
@@ -886,7 +1053,7 @@ module ActiveMerchant #:nodoc:
|
|
|
886
1053
|
end
|
|
887
1054
|
|
|
888
1055
|
def add_bank_account_to_customer(payment_method, options)
|
|
889
|
-
bank_account_nonce, error_message = TokenNonce.new(@braintree_gateway, options).create_token_nonce_for_payment_method
|
|
1056
|
+
bank_account_nonce, error_message = TokenNonce.new(@braintree_gateway, options).create_token_nonce_for_payment_method(payment_method, options)
|
|
890
1057
|
return Response.new(false, error_message) unless bank_account_nonce.present?
|
|
891
1058
|
|
|
892
1059
|
result = @braintree_gateway.payment_method.create(
|
|
@@ -897,23 +1064,33 @@ module ActiveMerchant #:nodoc:
|
|
|
897
1064
|
}
|
|
898
1065
|
)
|
|
899
1066
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1067
|
+
success = bank_account_verified?(result)
|
|
1068
|
+
resp_body = if result.respond_to?(:payment_method)
|
|
1069
|
+
{
|
|
1070
|
+
customer_vault_id: options[:customer],
|
|
1071
|
+
bank_account_token: result.payment_method&.token,
|
|
1072
|
+
verified: success
|
|
1073
|
+
}
|
|
1074
|
+
end
|
|
1075
|
+
Response.new(
|
|
1076
|
+
success,
|
|
1077
|
+
message_from_bank_account_result(success, result),
|
|
1078
|
+
resp_body || {},
|
|
1079
|
+
authorization: (result.payment_method&.token if result.respond_to?(:payment_method))
|
|
1080
|
+
)
|
|
1081
|
+
end
|
|
903
1082
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
verified: verified
|
|
909
|
-
},
|
|
910
|
-
authorization: result.payment_method&.token)
|
|
1083
|
+
def bank_account_verified?(result)
|
|
1084
|
+
return false unless result.respond_to?(:payment_method)
|
|
1085
|
+
|
|
1086
|
+
result.success? && result.payment_method&.verified
|
|
911
1087
|
end
|
|
912
1088
|
|
|
913
|
-
def
|
|
914
|
-
return
|
|
1089
|
+
def message_from_bank_account_result(success, response)
|
|
1090
|
+
return message_from_result(response) if !response.respond_to?(:payment_method) || success
|
|
1091
|
+
return unless response.payment_method.verifications.present?
|
|
915
1092
|
|
|
916
|
-
verification =
|
|
1093
|
+
verification = response.payment_method.verifications.first
|
|
917
1094
|
"verification_status: [#{verification.status}], processor_response: [#{verification.processor_response_code}-#{verification.processor_response_text}]"
|
|
918
1095
|
end
|
|
919
1096
|
|
|
@@ -944,7 +1121,7 @@ module ActiveMerchant #:nodoc:
|
|
|
944
1121
|
Response.new(
|
|
945
1122
|
result.success?,
|
|
946
1123
|
message_from_result(result),
|
|
947
|
-
{ customer_vault_id: customer_id,
|
|
1124
|
+
{ customer_vault_id: customer_id, exists: true }
|
|
948
1125
|
)
|
|
949
1126
|
end
|
|
950
1127
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require 'active_merchant/billing/gateways/smart_ps
|
|
1
|
+
require 'active_merchant/billing/gateways/smart_ps'
|
|
2
2
|
require 'active_merchant/billing/gateways/braintree/braintree_common'
|
|
3
3
|
|
|
4
|
-
module ActiveMerchant
|
|
5
|
-
module Billing
|
|
4
|
+
module ActiveMerchant # :nodoc:
|
|
5
|
+
module Billing # :nodoc:
|
|
6
6
|
class BraintreeOrangeGateway < SmartPs
|
|
7
7
|
include BraintreeCommon
|
|
8
8
|
|
|
@@ -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 BridgePayGateway < Gateway
|
|
6
6
|
self.display_name = 'BridgePay'
|
|
7
7
|
self.homepage_url = 'http://www.bridgepaynetwork.com/'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class CardConnectGateway < Gateway
|
|
4
4
|
self.test_url = 'https://fts-uat.cardconnect.com/cardconnect/rest/'
|
|
5
5
|
self.live_url = 'https://fts.cardconnect.com/cardconnect/rest/'
|
|
@@ -146,9 +146,12 @@ module ActiveMerchant #:nodoc:
|
|
|
146
146
|
|
|
147
147
|
def unstore(authorization, options = {})
|
|
148
148
|
account_id, profile_id = authorization.split('|')
|
|
149
|
-
commit(
|
|
149
|
+
commit(
|
|
150
|
+
'profile',
|
|
151
|
+
{},
|
|
150
152
|
verb: :delete,
|
|
151
|
-
path: "/#{profile_id}/#{account_id}/#{@options[:merchant_id]}"
|
|
153
|
+
path: "/#{profile_id}/#{account_id}/#{@options[:merchant_id]}"
|
|
154
|
+
)
|
|
152
155
|
end
|
|
153
156
|
|
|
154
157
|
def supports_scrubbing?
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class CardSaveGateway < IridiumGateway
|
|
4
4
|
# CardSave lets you handle failovers on payments by providing 3 gateways in case one happens to be down
|
|
5
5
|
# URLS = ['https://gw1.cardsaveonlinepayments.com:4430/','https://gw2.cardsaveonlinepayments.com:4430/','https://gw3.cardsaveonlinepayments.com:4430/']
|