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
|
@@ -2,8 +2,8 @@ require 'time'
|
|
|
2
2
|
require 'date'
|
|
3
3
|
require 'active_merchant/billing/model'
|
|
4
4
|
|
|
5
|
-
module ActiveMerchant
|
|
6
|
-
module Billing
|
|
5
|
+
module ActiveMerchant # :nodoc:
|
|
6
|
+
module Billing # :nodoc:
|
|
7
7
|
# A +CreditCard+ object represents a physical credit card, and is capable of validating the various
|
|
8
8
|
# data associated with these.
|
|
9
9
|
#
|
|
@@ -39,6 +39,11 @@ module ActiveMerchant #:nodoc:
|
|
|
39
39
|
# * Anda
|
|
40
40
|
# * Creditos directos (Tarjeta D)
|
|
41
41
|
# * Panal
|
|
42
|
+
# * Verve
|
|
43
|
+
# * Tuya
|
|
44
|
+
# * UATP
|
|
45
|
+
# * Patagonia365
|
|
46
|
+
# * Tarjeta Sol
|
|
42
47
|
#
|
|
43
48
|
# For testing purposes, use the 'bogus' credit card brand. This skips the vast majority of
|
|
44
49
|
# validations, allowing you to focus on your core concerns until you're ready to be more concerned
|
|
@@ -132,6 +137,11 @@ module ActiveMerchant #:nodoc:
|
|
|
132
137
|
# * +'anda'+
|
|
133
138
|
# * +'tarjeta-d'+
|
|
134
139
|
# * +'panal'+
|
|
140
|
+
# * +'verve'+
|
|
141
|
+
# * +'tuya'+
|
|
142
|
+
# * +'uatp'+
|
|
143
|
+
# * +'patagonia_365'+
|
|
144
|
+
# * +'tarjeta_sol'+
|
|
135
145
|
#
|
|
136
146
|
# Or, if you wish to test your implementation, +'bogus'+.
|
|
137
147
|
#
|
|
@@ -288,7 +298,7 @@ module ActiveMerchant #:nodoc:
|
|
|
288
298
|
end
|
|
289
299
|
|
|
290
300
|
%w(month year start_month start_year).each do |m|
|
|
291
|
-
class_eval
|
|
301
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
|
292
302
|
def #{m}=(v)
|
|
293
303
|
@#{m} = case v
|
|
294
304
|
when "", nil, 0
|
|
@@ -297,7 +307,7 @@ module ActiveMerchant #:nodoc:
|
|
|
297
307
|
v.to_i
|
|
298
308
|
end
|
|
299
309
|
end
|
|
300
|
-
|
|
310
|
+
RUBY
|
|
301
311
|
end
|
|
302
312
|
|
|
303
313
|
def verification_value?
|
|
@@ -357,6 +367,18 @@ module ActiveMerchant #:nodoc:
|
|
|
357
367
|
BRANDS_WITH_SPACES_IN_NUMBER.include?(self.class.brand?(self.number || number))
|
|
358
368
|
end
|
|
359
369
|
|
|
370
|
+
def network_token?
|
|
371
|
+
false
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def mobile_wallet?
|
|
375
|
+
false
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
def encrypted_wallet?
|
|
379
|
+
false
|
|
380
|
+
end
|
|
381
|
+
|
|
360
382
|
private
|
|
361
383
|
|
|
362
384
|
def filter_number(value)
|
|
@@ -368,7 +390,7 @@ module ActiveMerchant #:nodoc:
|
|
|
368
390
|
value.to_s.gsub(regex, '')
|
|
369
391
|
end
|
|
370
392
|
|
|
371
|
-
def validate_essential_attributes
|
|
393
|
+
def validate_essential_attributes # :nodoc:
|
|
372
394
|
errors = []
|
|
373
395
|
|
|
374
396
|
if self.class.requires_name?
|
|
@@ -392,12 +414,10 @@ module ActiveMerchant #:nodoc:
|
|
|
392
414
|
errors
|
|
393
415
|
end
|
|
394
416
|
|
|
395
|
-
def validate_card_brand_and_number
|
|
417
|
+
def validate_card_brand_and_number # :nodoc:
|
|
396
418
|
errors = []
|
|
397
419
|
|
|
398
|
-
if !empty?(brand)
|
|
399
|
-
errors << [:brand, 'is invalid'] if !CreditCard.card_companies.include?(brand)
|
|
400
|
-
end
|
|
420
|
+
errors << [:brand, 'is invalid'] if !empty?(brand) && !CreditCard.card_companies.include?(brand)
|
|
401
421
|
|
|
402
422
|
if empty?(number)
|
|
403
423
|
errors << [:number, 'is required']
|
|
@@ -405,14 +425,12 @@ module ActiveMerchant #:nodoc:
|
|
|
405
425
|
errors << [:number, 'is not a valid credit card number']
|
|
406
426
|
end
|
|
407
427
|
|
|
408
|
-
if errors.empty?
|
|
409
|
-
errors << [:brand, 'does not match the card number'] if !CreditCard.matching_brand?(number, brand)
|
|
410
|
-
end
|
|
428
|
+
errors << [:brand, 'does not match the card number'] if errors.empty? && !CreditCard.matching_brand?(number, brand)
|
|
411
429
|
|
|
412
430
|
errors
|
|
413
431
|
end
|
|
414
432
|
|
|
415
|
-
def validate_verification_value
|
|
433
|
+
def validate_verification_value # :nodoc:
|
|
416
434
|
errors = []
|
|
417
435
|
|
|
418
436
|
if verification_value?
|
|
@@ -423,18 +441,19 @@ module ActiveMerchant #:nodoc:
|
|
|
423
441
|
errors
|
|
424
442
|
end
|
|
425
443
|
|
|
426
|
-
class ExpiryDate
|
|
444
|
+
class ExpiryDate # :nodoc:
|
|
427
445
|
attr_reader :month, :year
|
|
446
|
+
|
|
428
447
|
def initialize(month, year)
|
|
429
448
|
@month = month.to_i
|
|
430
449
|
@year = year.to_i
|
|
431
450
|
end
|
|
432
451
|
|
|
433
|
-
def expired?
|
|
452
|
+
def expired? # :nodoc:
|
|
434
453
|
Time.now.utc > expiration
|
|
435
454
|
end
|
|
436
455
|
|
|
437
|
-
def expiration
|
|
456
|
+
def expiration # :nodoc:
|
|
438
457
|
Time.utc(year, month, month_days, 23, 59, 59)
|
|
439
458
|
rescue ArgumentError
|
|
440
459
|
Time.at(0).utc
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
module CreditCardFormatting
|
|
4
4
|
def expdate(credit_card)
|
|
5
5
|
"#{format(credit_card.month, :two_digits)}#{format(credit_card.year, :two_digits)}"
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
+
def strftime_yyyymm(credit_card)
|
|
9
|
+
format(credit_card.year, :four_digits) + format(credit_card.month, :two_digits)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def strftime_yyyymmdd_last_day(credit_card)
|
|
13
|
+
year = credit_card.year.to_i
|
|
14
|
+
month = credit_card.month.to_i
|
|
15
|
+
last_day = Date.civil(year, month, -1).day
|
|
16
|
+
format(year, :four_digits) + format(month, :two_digits) + format(last_day, :two_digits)
|
|
17
|
+
end
|
|
18
|
+
|
|
8
19
|
# This method is used to format numerical information pertaining to credit cards.
|
|
9
20
|
#
|
|
10
21
|
# format(2005, :two_digits) # => "05"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'set'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
# Convenience methods that can be included into a custom Credit Card object, such as an ActiveRecord based Credit Card object.
|
|
6
6
|
module CreditCardMethods
|
|
7
7
|
CARD_COMPANY_DETECTORS = {
|
|
@@ -24,7 +24,11 @@ module ActiveMerchant #:nodoc:
|
|
|
24
24
|
},
|
|
25
25
|
'maestro_no_luhn' => ->(num) { num =~ /^(501080|501081|501082)\d{6,13}$/ },
|
|
26
26
|
'forbrugsforeningen' => ->(num) { num =~ /^600722\d{10}$/ },
|
|
27
|
-
'sodexo' =>
|
|
27
|
+
'sodexo' => lambda { |num|
|
|
28
|
+
num&.size == 16 && (
|
|
29
|
+
SODEXO_BINS.any? { |bin| num.slice(0, bin.size) == bin }
|
|
30
|
+
)
|
|
31
|
+
},
|
|
28
32
|
'alia' => ->(num) { num =~ /^(504997|505878|601030|601073|505874)\d{10}$/ },
|
|
29
33
|
'vr' => ->(num) { num =~ /^(627416|637036)\d{10}$/ },
|
|
30
34
|
'unionpay' => ->(num) { (16..19).cover?(num&.size) && in_bin_range?(num.slice(0, 8), UNIONPAY_RANGES) },
|
|
@@ -39,7 +43,7 @@ module ActiveMerchant #:nodoc:
|
|
|
39
43
|
'creditel' => ->(num) { num =~ /^601933\d{10}$/ },
|
|
40
44
|
'confiable' => ->(num) { num =~ /^560718\d{10}$/ },
|
|
41
45
|
'synchrony' => ->(num) { num =~ /^700600\d{10}$/ },
|
|
42
|
-
'routex' => ->(num) { num =~ /^(700676|700678)\d{13}$/ },
|
|
46
|
+
'routex' => ->(num) { num =~ /^(700674|700676|700678)\d{12,13}$/ },
|
|
43
47
|
'mada' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), MADA_RANGES) },
|
|
44
48
|
'bp_plus' => ->(num) { num =~ /^(7050\d\s\d{9}\s\d{3}$|705\d\s\d{8}\s\d{5}$)/ },
|
|
45
49
|
'passcard' => ->(num) { num =~ /^628026\d{10}$/ },
|
|
@@ -47,7 +51,12 @@ module ActiveMerchant #:nodoc:
|
|
|
47
51
|
'anda' => ->(num) { num =~ /^603199\d{10}$/ },
|
|
48
52
|
'tarjeta-d' => ->(num) { num =~ /^601828\d{10}$/ },
|
|
49
53
|
'hipercard' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), HIPERCARD_RANGES) },
|
|
50
|
-
'panal' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), PANAL_RANGES) }
|
|
54
|
+
'panal' => ->(num) { num&.size == 16 && in_bin_range?(num.slice(0, 6), PANAL_RANGES) },
|
|
55
|
+
'verve' => ->(num) { (16..19).cover?(num&.size) && in_bin_range?(num.slice(0, 6), VERVE_RANGES) },
|
|
56
|
+
'tuya' => ->(num) { num =~ /^588800\d{10}$/ },
|
|
57
|
+
'uatp' => ->(num) { num =~ /^(1175|1290)\d{11}$/ },
|
|
58
|
+
'patagonia_365' => ->(num) { num =~ /^504656\d{10}$/ },
|
|
59
|
+
'tarjeta_sol' => ->(num) { num =~ /^504639\d{10}$/ }
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
SODEXO_NO_LUHN = ->(num) { num =~ /^(505864|505865)\d{10}$/ }
|
|
@@ -72,6 +81,13 @@ module ActiveMerchant #:nodoc:
|
|
|
72
81
|
(491730..491759),
|
|
73
82
|
]
|
|
74
83
|
|
|
84
|
+
SODEXO_BINS = Set.new(
|
|
85
|
+
%w[
|
|
86
|
+
606071 603389 606070 606069 606068 600818 505864 505865
|
|
87
|
+
60607601 60607607 60894400 60894410 60894420 60607606
|
|
88
|
+
]
|
|
89
|
+
)
|
|
90
|
+
|
|
75
91
|
CARNET_RANGES = [
|
|
76
92
|
(506199..506499),
|
|
77
93
|
]
|
|
@@ -113,7 +129,8 @@ module ActiveMerchant #:nodoc:
|
|
|
113
129
|
501500 501623
|
|
114
130
|
501879 502113 502120 502121 502301
|
|
115
131
|
503175 503337 503645 503670
|
|
116
|
-
504310 504338 504363 504533 504587 504620
|
|
132
|
+
504310 504338 504363 504533 504587 504620 504738 504781 504910
|
|
133
|
+
505616
|
|
117
134
|
507001 507002 507004 507082 507090
|
|
118
135
|
560014 560565 561033
|
|
119
136
|
572402 572610 572626
|
|
@@ -161,7 +178,7 @@ module ActiveMerchant #:nodoc:
|
|
|
161
178
|
(501104..501105),
|
|
162
179
|
(501107..501108),
|
|
163
180
|
(501104..501105),
|
|
164
|
-
(501107..
|
|
181
|
+
(501107..501109),
|
|
165
182
|
(501800..501899),
|
|
166
183
|
(502000..502099),
|
|
167
184
|
(503800..503899),
|
|
@@ -221,7 +238,8 @@ module ActiveMerchant #:nodoc:
|
|
|
221
238
|
58965700..58965799,
|
|
222
239
|
60352200..60352299,
|
|
223
240
|
65027200..65027299,
|
|
224
|
-
65008700..65008700
|
|
241
|
+
65008700..65008700,
|
|
242
|
+
65090000..65090099
|
|
225
243
|
]
|
|
226
244
|
|
|
227
245
|
MADA_RANGES = [
|
|
@@ -236,7 +254,7 @@ module ActiveMerchant #:nodoc:
|
|
|
236
254
|
|
|
237
255
|
# https://www.discoverglobalnetwork.com/content/dam/discover/en_us/dgn/pdfs/IPP-VAR-Enabler-Compliance.pdf
|
|
238
256
|
UNIONPAY_RANGES = [
|
|
239
|
-
62000000..62000000, 62212600..62379699, 62400000..62699999, 62820000..62889999,
|
|
257
|
+
62000000..62000000, 62178570..62178570, 62212600..62379699, 62400000..62699999, 62820000..62889999,
|
|
240
258
|
81000000..81099999, 81100000..81319999, 81320000..81519999, 81520000..81639999, 81640000..81719999
|
|
241
259
|
]
|
|
242
260
|
|
|
@@ -251,6 +269,43 @@ module ActiveMerchant #:nodoc:
|
|
|
251
269
|
|
|
252
270
|
PANAL_RANGES = [[602049]]
|
|
253
271
|
|
|
272
|
+
VERVE_RANGES = [
|
|
273
|
+
[506099],
|
|
274
|
+
[506101],
|
|
275
|
+
[506103],
|
|
276
|
+
(506111..506114),
|
|
277
|
+
[506116],
|
|
278
|
+
[506118],
|
|
279
|
+
[506124],
|
|
280
|
+
[506127],
|
|
281
|
+
[506130],
|
|
282
|
+
(506132..506139),
|
|
283
|
+
[506141],
|
|
284
|
+
[506144],
|
|
285
|
+
(506146..506152),
|
|
286
|
+
(506154..506161),
|
|
287
|
+
(506163..506164),
|
|
288
|
+
[506167],
|
|
289
|
+
(506169..506198),
|
|
290
|
+
(507865..507866),
|
|
291
|
+
(507868..507872),
|
|
292
|
+
(507874..507899),
|
|
293
|
+
(507901..507909),
|
|
294
|
+
(507911..507919),
|
|
295
|
+
[507921],
|
|
296
|
+
(507923..507925),
|
|
297
|
+
(507927..507962),
|
|
298
|
+
[507964],
|
|
299
|
+
[627309],
|
|
300
|
+
[627903],
|
|
301
|
+
[628051],
|
|
302
|
+
[636625],
|
|
303
|
+
[637058],
|
|
304
|
+
[637634],
|
|
305
|
+
[639245],
|
|
306
|
+
[639383]
|
|
307
|
+
]
|
|
308
|
+
|
|
254
309
|
def self.included(base)
|
|
255
310
|
base.extend(ClassMethods)
|
|
256
311
|
end
|
|
@@ -324,9 +379,9 @@ module ActiveMerchant #:nodoc:
|
|
|
324
379
|
# - http://www.beachnet.com/~hstiles/cardtype.html
|
|
325
380
|
def valid_number?(number)
|
|
326
381
|
valid_test_mode_card_number?(number) ||
|
|
327
|
-
valid_card_number_length?(number) &&
|
|
382
|
+
(valid_card_number_length?(number) &&
|
|
328
383
|
valid_card_number_characters?(brand?(number), number) &&
|
|
329
|
-
valid_by_algorithm?(brand?(number), number)
|
|
384
|
+
valid_by_algorithm?(brand?(number), number))
|
|
330
385
|
end
|
|
331
386
|
|
|
332
387
|
def card_companies
|
|
@@ -386,20 +441,20 @@ module ActiveMerchant #:nodoc:
|
|
|
386
441
|
|
|
387
442
|
private
|
|
388
443
|
|
|
389
|
-
def valid_card_number_length?(number)
|
|
444
|
+
def valid_card_number_length?(number) # :nodoc:
|
|
390
445
|
return false if number.nil?
|
|
391
446
|
|
|
392
447
|
number.length >= 12
|
|
393
448
|
end
|
|
394
449
|
|
|
395
|
-
def valid_card_number_characters?(brand, number)
|
|
450
|
+
def valid_card_number_characters?(brand, number) # :nodoc:
|
|
396
451
|
return false if number.nil?
|
|
397
452
|
return number =~ /\A[0-9 ]+\Z/ if brand == 'bp_plus'
|
|
398
453
|
|
|
399
454
|
!number.match(/\D/)
|
|
400
455
|
end
|
|
401
456
|
|
|
402
|
-
def valid_test_mode_card_number?(number)
|
|
457
|
+
def valid_test_mode_card_number?(number) # :nodoc:
|
|
403
458
|
ActiveMerchant::Billing::Base.test? &&
|
|
404
459
|
%w[1 2 3 success failure error].include?(number)
|
|
405
460
|
end
|
|
@@ -408,10 +463,10 @@ module ActiveMerchant #:nodoc:
|
|
|
408
463
|
SODEXO_NO_LUHN.call(numbers)
|
|
409
464
|
end
|
|
410
465
|
|
|
411
|
-
def valid_by_algorithm?(brand, numbers)
|
|
466
|
+
def valid_by_algorithm?(brand, numbers) # :nodoc:
|
|
412
467
|
case brand
|
|
413
468
|
when 'naranja'
|
|
414
|
-
valid_naranja_algo?(numbers)
|
|
469
|
+
valid_naranja_algo?(numbers) || valid_luhn?(numbers)
|
|
415
470
|
when 'creditel'
|
|
416
471
|
valid_creditel_algo?(numbers)
|
|
417
472
|
when 'alia', 'confiable', 'maestro_no_luhn', 'anda', 'tarjeta-d', 'hipercard'
|
|
@@ -455,7 +510,7 @@ module ActiveMerchant #:nodoc:
|
|
|
455
510
|
# Checks the validity of a card number by use of the Luhn Algorithm.
|
|
456
511
|
# Please see http://en.wikipedia.org/wiki/Luhn_algorithm for details.
|
|
457
512
|
# This implementation is from the luhn_checksum gem, https://github.com/zendesk/luhn_checksum.
|
|
458
|
-
def valid_luhn?(numbers)
|
|
513
|
+
def valid_luhn?(numbers) # :nodoc:
|
|
459
514
|
sum = 0
|
|
460
515
|
|
|
461
516
|
odd = true
|
|
@@ -494,7 +549,7 @@ module ActiveMerchant #:nodoc:
|
|
|
494
549
|
end
|
|
495
550
|
|
|
496
551
|
# Checks the validity of a card number by use of specific algorithms
|
|
497
|
-
def valid_naranja_algo?(numbers)
|
|
552
|
+
def valid_naranja_algo?(numbers) # :nodoc:
|
|
498
553
|
num_array = numbers.to_s.chars.map(&:to_i)
|
|
499
554
|
multipliers = [4, 3, 2, 7, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
|
|
500
555
|
num_sum = num_array[0..14].zip(multipliers).map { |a, b| a * b }.reduce(:+)
|
|
@@ -503,7 +558,7 @@ module ActiveMerchant #:nodoc:
|
|
|
503
558
|
final_num == num_array[15]
|
|
504
559
|
end
|
|
505
560
|
|
|
506
|
-
def valid_creditel_algo?(numbers)
|
|
561
|
+
def valid_creditel_algo?(numbers) # :nodoc:
|
|
507
562
|
num_array = numbers.to_s.chars.map(&:to_i)
|
|
508
563
|
multipliers = [5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9]
|
|
509
564
|
num_sum = num_array[0..14].zip(multipliers).map { |a, b| a * b }.reduce(:+)
|
|
@@ -2,8 +2,8 @@ require 'net/http'
|
|
|
2
2
|
require 'net/https'
|
|
3
3
|
require 'active_merchant/billing/response'
|
|
4
4
|
|
|
5
|
-
module ActiveMerchant
|
|
6
|
-
module Billing
|
|
5
|
+
module ActiveMerchant # :nodoc:
|
|
6
|
+
module Billing # :nodoc:
|
|
7
7
|
#
|
|
8
8
|
# == Description
|
|
9
9
|
# The Gateway class is the base class for all ActiveMerchant gateway implementations.
|
|
@@ -55,6 +55,7 @@ module ActiveMerchant #:nodoc:
|
|
|
55
55
|
class Gateway
|
|
56
56
|
include PostsData
|
|
57
57
|
include CreditCardFormatting
|
|
58
|
+
include Versionable
|
|
58
59
|
|
|
59
60
|
CREDIT_DEPRECATION_MESSAGE = 'Support for using credit to refund existing transactions is deprecated and will be removed from a future release of ActiveMerchant. Please use the refund method instead.'
|
|
60
61
|
RECURRING_DEPRECATION_MESSAGE = 'Recurring functionality in ActiveMerchant is deprecated and will be removed in a future version. Please contact the ActiveMerchant maintainers if you have an interest in taking ownership of a separate gem that continues support for it.'
|
|
@@ -315,6 +316,25 @@ module ActiveMerchant #:nodoc:
|
|
|
315
316
|
[first_name, last_name]
|
|
316
317
|
end
|
|
317
318
|
|
|
319
|
+
def format_name(str = '')
|
|
320
|
+
return nil unless str.respond_to?(:force_encoding)
|
|
321
|
+
|
|
322
|
+
str = str.force_encoding('utf-8').encode
|
|
323
|
+
emoji_regex = /[\u{1f600}-\u{1f64f}\u{2702}-\u{27b0}\u{1f680}-\u{1f6ff}\u{24C2}-\u{1F251}\u{1f300}-\u{1f5ff}]/
|
|
324
|
+
emoticon_regex = /[:;=8xX]-?[)(DPpO3]/
|
|
325
|
+
str = str.gsub(emoji_regex, '').gsub(emoticon_regex, '').strip
|
|
326
|
+
I18n.transliterate(str).gsub(/[^\w\s]/, '')
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
def split_address(full_address)
|
|
330
|
+
address_parts = (full_address || '').split
|
|
331
|
+
return [nil, nil] if address_parts.size == 0
|
|
332
|
+
|
|
333
|
+
number = address_parts.shift
|
|
334
|
+
street = address_parts.join(' ')
|
|
335
|
+
[number, street]
|
|
336
|
+
end
|
|
337
|
+
|
|
318
338
|
def requires!(hash, *params)
|
|
319
339
|
params.each do |param|
|
|
320
340
|
if param.is_a?(Array)
|