activemerchant 1.100.0 → 1.133.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +1057 -0
- data/README.md +11 -9
- data/lib/active_merchant/billing/avs_result.rb +9 -9
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +49 -17
- data/lib/active_merchant/billing/compatibility.rb +5 -4
- data/lib/active_merchant/billing/credit_card.rb +55 -8
- data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +209 -36
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +38 -36
- data/lib/active_merchant/billing/gateways/adyen.rb +399 -78
- data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
- data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +14 -14
- data/lib/active_merchant/billing/gateways/authorize_net.rb +200 -130
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +27 -20
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +48 -51
- data/lib/active_merchant/billing/gateways/axcessms.rb +13 -15
- data/lib/active_merchant/billing/gateways/balanced.rb +43 -36
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +16 -20
- data/lib/active_merchant/billing/gateways/bank_frick.rb +13 -13
- data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -30
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +5 -5
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +37 -36
- data/lib/active_merchant/billing/gateways/beanstream.rb +21 -3
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +53 -28
- data/lib/active_merchant/billing/gateways/blue_snap.rb +176 -54
- data/lib/active_merchant/billing/gateways/bogus.rb +24 -20
- data/lib/active_merchant/billing/gateways/borgun.rb +92 -38
- data/lib/active_merchant/billing/gateways/bpoint.rb +15 -15
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +8 -2
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +387 -175
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +13 -13
- data/lib/active_merchant/billing/gateways/cams.rb +10 -10
- data/lib/active_merchant/billing/gateways/card_connect.rb +33 -14
- data/lib/active_merchant/billing/gateways/card_save.rb +3 -4
- data/lib/active_merchant/billing/gateways/card_stream.rb +67 -40
- data/lib/active_merchant/billing/gateways/cardknox.rb +13 -13
- data/lib/active_merchant/billing/gateways/cardprocess.rb +4 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +28 -12
- data/lib/active_merchant/billing/gateways/cc5.rb +9 -9
- data/lib/active_merchant/billing/gateways/cecabank.rb +38 -38
- data/lib/active_merchant/billing/gateways/cenpos.rb +29 -28
- data/lib/active_merchant/billing/gateways/checkout.rb +7 -9
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +316 -68
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -2
- data/lib/active_merchant/billing/gateways/clearhaus.rb +32 -33
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +370 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +8 -6
- data/lib/active_merchant/billing/gateways/creditcall.rb +18 -17
- data/lib/active_merchant/billing/gateways/credorax.rb +152 -63
- data/lib/active_merchant/billing/gateways/ct_payment.rb +15 -14
- data/lib/active_merchant/billing/gateways/culqi.rb +30 -28
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +496 -187
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +148 -31
- data/lib/active_merchant/billing/gateways/data_cash.rb +34 -37
- data/lib/active_merchant/billing/gateways/decidir.rb +134 -21
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +10 -10
- data/lib/active_merchant/billing/gateways/digitzs.rb +11 -8
- data/lib/active_merchant/billing/gateways/ebanx.rb +90 -40
- data/lib/active_merchant/billing/gateways/efsnet.rb +36 -36
- data/lib/active_merchant/billing/gateways/elavon.rb +349 -194
- data/lib/active_merchant/billing/gateways/element.rb +71 -21
- data/lib/active_merchant/billing/gateways/epay.rb +43 -43
- data/lib/active_merchant/billing/gateways/evo_ca.rb +12 -13
- data/lib/active_merchant/billing/gateways/eway.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway_managed.rb +55 -56
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +37 -22
- data/lib/active_merchant/billing/gateways/exact.rb +19 -20
- data/lib/active_merchant/billing/gateways/ezic.rb +9 -9
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -19
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -7
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +5 -4
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +39 -38
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +51 -31
- data/lib/active_merchant/billing/gateways/flo2cash.rb +24 -24
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +38 -22
- data/lib/active_merchant/billing/gateways/garanti.rb +12 -15
- data/lib/active_merchant/billing/gateways/global_collect.rb +333 -89
- data/lib/active_merchant/billing/gateways/global_transport.rb +8 -9
- data/lib/active_merchant/billing/gateways/hdfc.rb +22 -23
- data/lib/active_merchant/billing/gateways/hps.rb +171 -50
- data/lib/active_merchant/billing/gateways/iats_payments.rb +47 -25
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +22 -27
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -8
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +9 -9
- data/lib/active_merchant/billing/gateways/iridium.rb +30 -31
- data/lib/active_merchant/billing/gateways/itransact.rb +11 -10
- data/lib/active_merchant/billing/gateways/iveri.rb +62 -23
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +10 -17
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +13 -18
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +100 -22
- data/lib/active_merchant/billing/gateways/latitude19.rb +20 -19
- data/lib/active_merchant/billing/gateways/linkpoint.rb +71 -72
- data/lib/active_merchant/billing/gateways/litle.rb +181 -45
- data/lib/active_merchant/billing/gateways/mastercard.rb +16 -22
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +89 -18
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +58 -24
- data/lib/active_merchant/billing/gateways/merchant_one.rb +7 -10
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +19 -19
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +18 -22
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +15 -17
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +46 -8
- data/lib/active_merchant/billing/gateways/mercury.rb +19 -23
- data/lib/active_merchant/billing/gateways/metrics_global.rb +24 -33
- data/lib/active_merchant/billing/gateways/micropayment.rb +11 -12
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +18 -21
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +10 -12
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +236 -150
- data/lib/active_merchant/billing/gateways/moneris.rb +122 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -7
- data/lib/active_merchant/billing/gateways/mundipagg.rb +69 -23
- data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -20
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +10 -12
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -9
- data/lib/active_merchant/billing/gateways/netaxept.rb +12 -12
- data/lib/active_merchant/billing/gateways/netbanx.rb +128 -46
- data/lib/active_merchant/billing/gateways/netbilling.rb +18 -21
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -4
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -10
- data/lib/active_merchant/billing/gateways/nmi.rb +69 -27
- data/lib/active_merchant/billing/gateways/ogone.rb +62 -31
- data/lib/active_merchant/billing/gateways/omise.rb +15 -16
- data/lib/active_merchant/billing/gateways/openpay.rb +33 -15
- data/lib/active_merchant/billing/gateways/opp.rb +39 -33
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -42
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +623 -362
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +20 -20
- data/lib/active_merchant/billing/gateways/pagarme.rb +16 -23
- data/lib/active_merchant/billing/gateways/pago_facil.rb +4 -6
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +17 -17
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -33
- data/lib/active_merchant/billing/gateways/pay_hub.rb +10 -10
- data/lib/active_merchant/billing/gateways/pay_junction.rb +31 -31
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +36 -18
- data/lib/active_merchant/billing/gateways/pay_secure.rb +10 -11
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +64 -40
- data/lib/active_merchant/billing/gateways/payeezy.rb +130 -27
- data/lib/active_merchant/billing/gateways/payex.rb +24 -25
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +17 -17
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +103 -25
- data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +22 -18
- data/lib/active_merchant/billing/gateways/paymentez.rb +89 -24
- data/lib/active_merchant/billing/gateways/paymill.rb +14 -16
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +13 -5
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -1
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +8 -9
- data/lib/active_merchant/billing/gateways/paystation.rb +6 -9
- data/lib/active_merchant/billing/gateways/payu_in.rb +20 -19
- data/lib/active_merchant/billing/gateways/payu_latam.rb +70 -37
- data/lib/active_merchant/billing/gateways/payway.rb +22 -22
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +60 -21
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +20 -21
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +13 -14
- data/lib/active_merchant/billing/gateways/psigate.rb +29 -29
- data/lib/active_merchant/billing/gateways/psl_card.rb +7 -8
- data/lib/active_merchant/billing/gateways/qbms.rb +25 -26
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -11
- data/lib/active_merchant/billing/gateways/quickbooks.rb +126 -39
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +98 -98
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +19 -23
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay.rb +0 -1
- data/lib/active_merchant/billing/gateways/qvalent.rb +36 -20
- data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
- data/lib/active_merchant/billing/gateways/reach.rb +277 -0
- data/lib/active_merchant/billing/gateways/realex.rb +42 -16
- data/lib/active_merchant/billing/gateways/redsys.rb +191 -86
- data/lib/active_merchant/billing/gateways/s5.rb +10 -9
- data/lib/active_merchant/billing/gateways/safe_charge.rb +70 -33
- data/lib/active_merchant/billing/gateways/sage.rb +19 -21
- data/lib/active_merchant/billing/gateways/sage_pay.rb +57 -57
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +3 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -26
- data/lib/active_merchant/billing/gateways/secure_pay.rb +24 -33
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +18 -20
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +4 -5
- data/lib/active_merchant/billing/gateways/securion_pay.rb +48 -7
- data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +19 -19
- data/lib/active_merchant/billing/gateways/smart_ps.rb +26 -32
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +24 -25
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +27 -21
- data/lib/active_merchant/billing/gateways/stripe.rb +126 -53
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +441 -113
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +7 -8
- data/lib/active_merchant/billing/gateways/telr.rb +17 -18
- data/lib/active_merchant/billing/gateways/tns.rb +3 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +10 -9
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +28 -24
- data/lib/active_merchant/billing/gateways/transact_pro.rb +13 -15
- data/lib/active_merchant/billing/gateways/transax.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +57 -47
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +176 -184
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +60 -48
- data/lib/active_merchant/billing/gateways/vanco.rb +17 -8
- data/lib/active_merchant/billing/gateways/verifi.rb +13 -14
- data/lib/active_merchant/billing/gateways/viaklix.rb +9 -14
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +26 -21
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +4 -4
- data/lib/active_merchant/billing/gateways/wepay.rb +14 -16
- data/lib/active_merchant/billing/gateways/wirecard.rb +14 -16
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +36 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +556 -190
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +47 -54
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +16 -16
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +2 -2
- data/lib/active_merchant/billing/response.rb +25 -6
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +14 -15
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +15 -17
- data/lib/active_merchant/post_data.rb +3 -2
- data/lib/active_merchant/posts_data.rb +2 -2
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +2 -2
- data/lib/certs/cacert.pem +1587 -2361
- data/lib/support/gateway_support.rb +1 -1
- data/lib/support/ssl_verify.rb +3 -7
- data/lib/support/ssl_version.rb +2 -3
- metadata +86 -34
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
self.supported_countries = %w(CA PR US)
|
10
10
|
self.default_currency = 'USD'
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
12
12
|
|
13
13
|
self.homepage_url = 'https://www.globalpaymentsinc.com'
|
14
14
|
self.display_name = 'Global Transport'
|
@@ -20,12 +20,12 @@ module ActiveMerchant #:nodoc:
|
|
20
20
|
# :global_password - Your Global password
|
21
21
|
# :term_type - 3 character field assigned by Global Transport after
|
22
22
|
# - your application is certified.
|
23
|
-
def initialize(options={})
|
23
|
+
def initialize(options = {})
|
24
24
|
requires!(options, :global_user_name, :global_password, :term_type)
|
25
25
|
super
|
26
26
|
end
|
27
27
|
|
28
|
-
def purchase(money, payment_method, options={})
|
28
|
+
def purchase(money, payment_method, options = {})
|
29
29
|
post = {}
|
30
30
|
add_invoice(post, money, options)
|
31
31
|
add_payment_method(post, payment_method)
|
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
|
|
34
34
|
commit('Sale', post, options)
|
35
35
|
end
|
36
36
|
|
37
|
-
def authorize(money, payment_method, options={})
|
37
|
+
def authorize(money, payment_method, options = {})
|
38
38
|
post = {}
|
39
39
|
add_invoice(post, money, options)
|
40
40
|
add_payment_method(post, payment_method)
|
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
|
|
43
43
|
commit('Auth', post, options)
|
44
44
|
end
|
45
45
|
|
46
|
-
def capture(money, authorization, options={})
|
46
|
+
def capture(money, authorization, options = {})
|
47
47
|
post = {}
|
48
48
|
add_invoice(post, money, options)
|
49
49
|
add_auth(post, authorization)
|
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
commit('Force', post, options)
|
52
52
|
end
|
53
53
|
|
54
|
-
def refund(money, authorization, options={})
|
54
|
+
def refund(money, authorization, options = {})
|
55
55
|
post = {}
|
56
56
|
add_invoice(post, money, options)
|
57
57
|
add_auth(post, authorization)
|
@@ -59,14 +59,14 @@ module ActiveMerchant #:nodoc:
|
|
59
59
|
commit('Return', post, options)
|
60
60
|
end
|
61
61
|
|
62
|
-
def void(authorization, options={})
|
62
|
+
def void(authorization, options = {})
|
63
63
|
post = {}
|
64
64
|
add_auth(post, authorization)
|
65
65
|
|
66
66
|
commit('Void', post, options)
|
67
67
|
end
|
68
68
|
|
69
|
-
def verify(payment_method, options={})
|
69
|
+
def verify(payment_method, options = {})
|
70
70
|
post = {}
|
71
71
|
add_payment_method(post, payment_method)
|
72
72
|
add_address(post, options)
|
@@ -188,7 +188,6 @@ module ActiveMerchant #:nodoc:
|
|
188
188
|
ExtData: ''
|
189
189
|
}
|
190
190
|
end
|
191
|
-
|
192
191
|
end
|
193
192
|
end
|
194
193
|
end
|
@@ -12,14 +12,14 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
self.supported_countries = ['IN']
|
13
13
|
self.default_currency = 'INR'
|
14
14
|
self.money_format = :dollars
|
15
|
-
self.supported_cardtypes = [
|
15
|
+
self.supported_cardtypes = %i[visa master discover diners_club]
|
16
16
|
|
17
|
-
def initialize(options={})
|
17
|
+
def initialize(options = {})
|
18
18
|
requires!(options, :login, :password)
|
19
19
|
super
|
20
20
|
end
|
21
21
|
|
22
|
-
def purchase(amount, payment_method, options={})
|
22
|
+
def purchase(amount, payment_method, options = {})
|
23
23
|
post = {}
|
24
24
|
add_invoice(post, amount, options)
|
25
25
|
add_payment_method(post, payment_method)
|
@@ -28,7 +28,7 @@ module ActiveMerchant #:nodoc:
|
|
28
28
|
commit('purchase', post)
|
29
29
|
end
|
30
30
|
|
31
|
-
def authorize(amount, payment_method, options={})
|
31
|
+
def authorize(amount, payment_method, options = {})
|
32
32
|
post = {}
|
33
33
|
add_invoice(post, amount, options)
|
34
34
|
add_payment_method(post, payment_method)
|
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
|
|
37
37
|
commit('authorize', post)
|
38
38
|
end
|
39
39
|
|
40
|
-
def capture(amount, authorization, options={})
|
40
|
+
def capture(amount, authorization, options = {})
|
41
41
|
post = {}
|
42
42
|
add_invoice(post, amount, options)
|
43
43
|
add_reference(post, authorization)
|
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
|
|
46
46
|
commit('capture', post)
|
47
47
|
end
|
48
48
|
|
49
|
-
def refund(amount, authorization, options={})
|
49
|
+
def refund(amount, authorization, options = {})
|
50
50
|
post = {}
|
51
51
|
add_invoice(post, amount, options)
|
52
52
|
add_reference(post, authorization)
|
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
|
|
57
57
|
|
58
58
|
private
|
59
59
|
|
60
|
-
CURRENCY_CODES = Hash.new { |
|
60
|
+
CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
|
61
61
|
CURRENCY_CODES['AED'] = '784'
|
62
62
|
CURRENCY_CODES['AUD'] = '036'
|
63
63
|
CURRENCY_CODES['CAD'] = '124'
|
@@ -81,14 +81,14 @@ module ActiveMerchant #:nodoc:
|
|
81
81
|
post[:udf2] = escape(options[:email]) if options[:email]
|
82
82
|
if address = (options[:billing_address] || options[:address])
|
83
83
|
post[:udf3] = escape(address[:phone]) if address[:phone]
|
84
|
-
post[:udf4] = escape(
|
85
|
-
#{address[:name]}
|
86
|
-
#{address[:company]}
|
87
|
-
#{address[:address1]}
|
88
|
-
#{address[:address2]}
|
89
|
-
#{address[:city]} #{address[:state]} #{address[:zip]}
|
90
|
-
#{address[:country]}
|
91
|
-
|
84
|
+
post[:udf4] = escape(<<~ADDRESS)
|
85
|
+
#{address[:name]}
|
86
|
+
#{address[:company]}
|
87
|
+
#{address[:address1]}
|
88
|
+
#{address[:address2]}
|
89
|
+
#{address[:city]} #{address[:state]} #{address[:zip]}
|
90
|
+
#{address[:country]}
|
91
|
+
ADDRESS
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -134,7 +134,7 @@ EOA
|
|
134
134
|
'purchase' => '1',
|
135
135
|
'refund' => '2',
|
136
136
|
'authorize' => '4',
|
137
|
-
'capture' => '5'
|
137
|
+
'capture' => '5'
|
138
138
|
}
|
139
139
|
|
140
140
|
def commit(action, post)
|
@@ -149,13 +149,13 @@ EOA
|
|
149
149
|
succeeded,
|
150
150
|
message_from(succeeded, raw),
|
151
151
|
raw,
|
152
|
-
:
|
153
|
-
:
|
152
|
+
authorization: authorization_from(post, raw),
|
153
|
+
test: test?
|
154
154
|
)
|
155
155
|
end
|
156
156
|
|
157
157
|
def build_request(post)
|
158
|
-
xml = Builder::XmlMarkup.new :
|
158
|
+
xml = Builder::XmlMarkup.new indent: 2
|
159
159
|
xml.instruct!
|
160
160
|
post.each do |field, value|
|
161
161
|
xml.tag!(field, value)
|
@@ -194,11 +194,10 @@ EOA
|
|
194
194
|
[tranid, member]
|
195
195
|
end
|
196
196
|
|
197
|
-
def escape(string, max_length=250)
|
197
|
+
def escape(string, max_length = 250)
|
198
198
|
return '' unless string
|
199
|
-
|
200
|
-
|
201
|
-
end
|
199
|
+
|
200
|
+
string = string[0...max_length] if max_length
|
202
201
|
string.gsub(/[^A-Za-z0-9 \-_@\.\n]/, '')
|
203
202
|
end
|
204
203
|
end
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
self.supported_countries = ['US']
|
10
10
|
self.default_currency = 'USD'
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover jbc diners_club]
|
12
12
|
|
13
13
|
self.homepage_url = 'http://developer.heartlandpaymentsystems.com/SecureSubmit/'
|
14
14
|
self.display_name = 'Heartland Payment Systems'
|
@@ -21,65 +21,81 @@ module ActiveMerchant #:nodoc:
|
|
21
21
|
visa: 'Visa 3DSecure',
|
22
22
|
american_express: 'AMEX 3DSecure',
|
23
23
|
discover: 'Discover 3DSecure',
|
24
|
+
android_pay: 'GooglePayApp',
|
25
|
+
google_pay: 'GooglePayApp'
|
24
26
|
}
|
25
27
|
|
26
|
-
def initialize(options={})
|
28
|
+
def initialize(options = {})
|
27
29
|
requires!(options, :secret_api_key)
|
28
30
|
super
|
29
31
|
end
|
30
32
|
|
31
|
-
def authorize(money, card_or_token, options={})
|
33
|
+
def authorize(money, card_or_token, options = {})
|
32
34
|
commit('CreditAuth') do |xml|
|
33
35
|
add_amount(xml, money)
|
34
36
|
add_allow_dup(xml)
|
35
|
-
|
37
|
+
add_card_or_token_customer_data(xml, card_or_token, options)
|
36
38
|
add_details(xml, options)
|
37
39
|
add_descriptor_name(xml, options)
|
38
|
-
|
40
|
+
add_card_or_token_payment(xml, card_or_token, options)
|
39
41
|
add_three_d_secure(xml, card_or_token, options)
|
42
|
+
add_stored_credentials(xml, options)
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
43
|
-
def capture(money, transaction_id, options={})
|
44
|
-
commit('CreditAddToBatch') do |xml|
|
46
|
+
def capture(money, transaction_id, options = {})
|
47
|
+
commit('CreditAddToBatch', transaction_id) do |xml|
|
45
48
|
add_amount(xml, money)
|
46
49
|
add_reference(xml, transaction_id)
|
47
50
|
end
|
48
51
|
end
|
49
52
|
|
50
|
-
def purchase(money,
|
51
|
-
|
53
|
+
def purchase(money, payment_method, options = {})
|
54
|
+
if payment_method.is_a?(Check)
|
55
|
+
commit_check_sale(money, payment_method, options)
|
56
|
+
elsif options.dig(:stored_credential, :reason_type) == 'recurring'
|
57
|
+
commit_recurring_billing_sale(money, payment_method, options)
|
58
|
+
else
|
59
|
+
commit_credit_sale(money, payment_method, options)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def refund(money, transaction_id, options = {})
|
64
|
+
commit('CreditReturn') do |xml|
|
52
65
|
add_amount(xml, money)
|
53
66
|
add_allow_dup(xml)
|
54
|
-
|
67
|
+
add_reference(xml, transaction_id)
|
68
|
+
add_card_or_token_customer_data(xml, transaction_id, options)
|
55
69
|
add_details(xml, options)
|
56
|
-
add_descriptor_name(xml, options)
|
57
|
-
add_payment(xml, card_or_token, options)
|
58
|
-
add_three_d_secure(xml, card_or_token, options)
|
59
70
|
end
|
60
71
|
end
|
61
72
|
|
62
|
-
def
|
73
|
+
def credit(money, payment_method, options = {})
|
63
74
|
commit('CreditReturn') do |xml|
|
64
75
|
add_amount(xml, money)
|
65
76
|
add_allow_dup(xml)
|
66
|
-
|
67
|
-
add_customer_data(xml, transaction_id, options)
|
77
|
+
add_card_or_token_payment(xml, payment_method, options)
|
68
78
|
add_details(xml, options)
|
69
79
|
end
|
70
80
|
end
|
71
81
|
|
72
|
-
def verify(card_or_token, options={})
|
82
|
+
def verify(card_or_token, options = {})
|
73
83
|
commit('CreditAccountVerify') do |xml|
|
74
|
-
|
84
|
+
add_card_or_token_customer_data(xml, card_or_token, options)
|
75
85
|
add_descriptor_name(xml, options)
|
76
|
-
|
86
|
+
add_card_or_token_payment(xml, card_or_token, options)
|
77
87
|
end
|
78
88
|
end
|
79
89
|
|
80
|
-
def void(transaction_id, options={})
|
81
|
-
|
82
|
-
|
90
|
+
def void(transaction_id, options = {})
|
91
|
+
if options[:check_void]
|
92
|
+
commit('CheckVoid') do |xml|
|
93
|
+
add_reference(xml, transaction_id)
|
94
|
+
end
|
95
|
+
else
|
96
|
+
commit('CreditVoid') do |xml|
|
97
|
+
add_reference(xml, transaction_id)
|
98
|
+
end
|
83
99
|
end
|
84
100
|
end
|
85
101
|
|
@@ -92,20 +108,60 @@ module ActiveMerchant #:nodoc:
|
|
92
108
|
gsub(%r((<hps:CardNbr>)[^<]*(<\/hps:CardNbr>))i, '\1[FILTERED]\2').
|
93
109
|
gsub(%r((<hps:CVV2>)[^<]*(<\/hps:CVV2>))i, '\1[FILTERED]\2').
|
94
110
|
gsub(%r((<hps:SecretAPIKey>)[^<]*(<\/hps:SecretAPIKey>))i, '\1[FILTERED]\2').
|
95
|
-
gsub(%r((<hps:PaymentData>)[^<]*(<\/hps:PaymentData>))i, '\1[FILTERED]\2')
|
111
|
+
gsub(%r((<hps:PaymentData>)[^<]*(<\/hps:PaymentData>))i, '\1[FILTERED]\2').
|
112
|
+
gsub(%r((<hps:RoutingNumber>)[^<]*(<\/hps:RoutingNumber>))i, '\1[FILTERED]\2').
|
113
|
+
gsub(%r((<hps:AccountNumber>)[^<]*(<\/hps:AccountNumber>))i, '\1[FILTERED]\2')
|
96
114
|
end
|
97
115
|
|
98
116
|
private
|
99
117
|
|
118
|
+
def commit_check_sale(money, check, options)
|
119
|
+
commit('CheckSale') do |xml|
|
120
|
+
add_check_payment(xml, check, options)
|
121
|
+
add_amount(xml, money)
|
122
|
+
add_sec_code(xml, options)
|
123
|
+
add_check_customer_data(xml, check, options)
|
124
|
+
add_details(xml, options)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def commit_credit_sale(money, card_or_token, options)
|
129
|
+
commit('CreditSale') do |xml|
|
130
|
+
add_amount(xml, money)
|
131
|
+
add_allow_dup(xml)
|
132
|
+
add_card_or_token_customer_data(xml, card_or_token, options)
|
133
|
+
add_details(xml, options)
|
134
|
+
add_descriptor_name(xml, options)
|
135
|
+
add_card_or_token_payment(xml, card_or_token, options)
|
136
|
+
add_three_d_secure(xml, card_or_token, options)
|
137
|
+
add_stored_credentials(xml, options)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def commit_recurring_billing_sale(money, card_or_token, options)
|
142
|
+
commit('RecurringBilling') do |xml|
|
143
|
+
add_amount(xml, money)
|
144
|
+
add_allow_dup(xml)
|
145
|
+
add_card_or_token_customer_data(xml, card_or_token, options)
|
146
|
+
add_details(xml, options)
|
147
|
+
add_descriptor_name(xml, options)
|
148
|
+
add_card_or_token_payment(xml, card_or_token, options)
|
149
|
+
add_three_d_secure(xml, card_or_token, options)
|
150
|
+
add_stored_credentials(xml, options)
|
151
|
+
add_stored_credentials_for_recurring_billing(xml, options)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
100
155
|
def add_reference(xml, transaction_id)
|
101
|
-
|
156
|
+
reference = transaction_id.to_s.include?('|') ? transaction_id.split('|').first : transaction_id
|
157
|
+
xml.hps :GatewayTxnId, reference
|
102
158
|
end
|
103
159
|
|
104
160
|
def add_amount(xml, money)
|
105
161
|
xml.hps :Amt, amount(money) if money
|
106
162
|
end
|
107
163
|
|
108
|
-
def
|
164
|
+
def add_card_or_token_customer_data(xml, credit_card, options)
|
109
165
|
xml.hps :CardHolderData do
|
110
166
|
if credit_card.respond_to?(:number)
|
111
167
|
xml.hps :CardHolderFirstName, credit_card.first_name if credit_card.first_name
|
@@ -115,20 +171,28 @@ module ActiveMerchant #:nodoc:
|
|
115
171
|
xml.hps :CardHolderEmail, options[:email] if options[:email]
|
116
172
|
xml.hps :CardHolderPhone, options[:phone] if options[:phone]
|
117
173
|
|
118
|
-
if(billing_address = (options[:billing_address] || options[:address]))
|
174
|
+
if (billing_address = (options[:billing_address] || options[:address]))
|
119
175
|
xml.hps :CardHolderAddr, billing_address[:address1] if billing_address[:address1]
|
120
176
|
xml.hps :CardHolderCity, billing_address[:city] if billing_address[:city]
|
121
177
|
xml.hps :CardHolderState, billing_address[:state] if billing_address[:state]
|
122
|
-
xml.hps :CardHolderZip, billing_address[:zip] if billing_address[:zip]
|
178
|
+
xml.hps :CardHolderZip, alphanumeric_zip(billing_address[:zip]) if billing_address[:zip]
|
123
179
|
end
|
124
180
|
end
|
125
181
|
end
|
126
182
|
|
127
|
-
def
|
183
|
+
def add_check_customer_data(xml, check, options)
|
184
|
+
xml.hps :ConsumerInfo do
|
185
|
+
xml.hps :FirstName, check.first_name
|
186
|
+
xml.hps :LastName, check.last_name
|
187
|
+
xml.hps :CheckName, options[:company_name] if options[:company_name]
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def add_card_or_token_payment(xml, card_or_token, options)
|
128
192
|
xml.hps :CardData do
|
129
193
|
if card_or_token.respond_to?(:number)
|
130
194
|
if card_or_token.track_data
|
131
|
-
xml.tag!('hps:TrackData', 'method'=>'swipe') do
|
195
|
+
xml.tag!('hps:TrackData', 'method' => 'swipe') do
|
132
196
|
xml.text! card_or_token.track_data
|
133
197
|
end
|
134
198
|
if options[:encryption_type]
|
@@ -159,14 +223,29 @@ module ActiveMerchant #:nodoc:
|
|
159
223
|
end
|
160
224
|
end
|
161
225
|
|
226
|
+
def add_check_payment(xml, check, options)
|
227
|
+
xml.hps :CheckAction, 'SALE'
|
228
|
+
xml.hps :AccountInfo do
|
229
|
+
xml.hps :RoutingNumber, check.routing_number
|
230
|
+
xml.hps :AccountNumber, check.account_number
|
231
|
+
xml.hps :CheckNumber, check.number
|
232
|
+
xml.hps :AccountType, check.account_type&.upcase
|
233
|
+
end
|
234
|
+
xml.hps :CheckType, check.account_holder_type&.upcase
|
235
|
+
end
|
236
|
+
|
162
237
|
def add_details(xml, options)
|
163
238
|
xml.hps :AdditionalTxnFields do
|
164
239
|
xml.hps :Description, options[:description] if options[:description]
|
165
|
-
xml.hps :InvoiceNbr, options[:order_id] if options[:order_id]
|
240
|
+
xml.hps :InvoiceNbr, options[:order_id][0..59] if options[:order_id]
|
166
241
|
xml.hps :CustomerID, options[:customer_id] if options[:customer_id]
|
167
242
|
end
|
168
243
|
end
|
169
244
|
|
245
|
+
def add_sec_code(xml, options)
|
246
|
+
xml.hps :SECCode, options[:sec_code] || 'WEB'
|
247
|
+
end
|
248
|
+
|
170
249
|
def add_allow_dup(xml)
|
171
250
|
xml.hps :AllowDup, 'Y'
|
172
251
|
end
|
@@ -181,7 +260,7 @@ module ActiveMerchant #:nodoc:
|
|
181
260
|
source: card_or_token.source,
|
182
261
|
cavv: card_or_token.payment_cryptogram,
|
183
262
|
eci: card_or_token.eci,
|
184
|
-
xid: card_or_token.transaction_id
|
263
|
+
xid: card_or_token.transaction_id
|
185
264
|
})
|
186
265
|
elsif options[:three_d_secure]
|
187
266
|
options[:three_d_secure][:source] ||= card_brand(card_or_token)
|
@@ -204,8 +283,41 @@ module ActiveMerchant #:nodoc:
|
|
204
283
|
end
|
205
284
|
end
|
206
285
|
|
286
|
+
# We do not currently support installments on this gateway.
|
287
|
+
# The HPS gateway treats recurring transactions as a seperate transaction type
|
288
|
+
def add_stored_credentials(xml, options)
|
289
|
+
return unless options[:stored_credential]
|
290
|
+
|
291
|
+
xml.hps :CardOnFileData do
|
292
|
+
if options[:stored_credential][:initiator] == 'customer'
|
293
|
+
xml.hps :CardOnFile, 'C'
|
294
|
+
elsif options[:stored_credential][:initiator] == 'merchant'
|
295
|
+
xml.hps :CardOnFile, 'M'
|
296
|
+
else
|
297
|
+
return
|
298
|
+
end
|
299
|
+
|
300
|
+
if options[:stored_credential][:network_transaction_id]
|
301
|
+
xml.hps :CardBrandTxnId, options[:stored_credential][:network_transaction_id]
|
302
|
+
else
|
303
|
+
return
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
def add_stored_credentials_for_recurring_billing(xml, options)
|
309
|
+
xml.hps :RecurringData do
|
310
|
+
if options[:stored_credential][:reason_type] = 'recurring'
|
311
|
+
xml.hps :OneTime, 'N'
|
312
|
+
else
|
313
|
+
xml.hps :OneTime, 'Y'
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
207
318
|
def strip_leading_zero(value)
|
208
319
|
return value unless value[0] == '0'
|
320
|
+
|
209
321
|
value[1, 1]
|
210
322
|
end
|
211
323
|
|
@@ -213,8 +325,8 @@ module ActiveMerchant #:nodoc:
|
|
213
325
|
xml = Builder::XmlMarkup.new(encoding: 'UTF-8')
|
214
326
|
xml.instruct!(:xml, encoding: 'UTF-8')
|
215
327
|
xml.SOAP :Envelope, {
|
216
|
-
|
217
|
-
|
328
|
+
'xmlns:SOAP' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
329
|
+
'xmlns:hps' => 'http://Hps.Exchange.PosGateway'
|
218
330
|
} do
|
219
331
|
xml.SOAP :Body do
|
220
332
|
xml.hps :PosRequest do
|
@@ -248,7 +360,7 @@ module ActiveMerchant #:nodoc:
|
|
248
360
|
|
249
361
|
doc = Nokogiri::XML(raw)
|
250
362
|
doc.remove_namespaces!
|
251
|
-
if(header = doc.xpath('//Header').first)
|
363
|
+
if (header = doc.xpath('//Header').first)
|
252
364
|
header.elements.each do |node|
|
253
365
|
if node.elements.size == 0
|
254
366
|
response[node.name] = node.text
|
@@ -259,33 +371,34 @@ module ActiveMerchant #:nodoc:
|
|
259
371
|
end
|
260
372
|
end
|
261
373
|
end
|
262
|
-
if(transaction = doc.xpath('//Transaction/*[1]').first)
|
374
|
+
if (transaction = doc.xpath('//Transaction/*[1]').first)
|
263
375
|
transaction.elements.each do |node|
|
264
376
|
response[node.name] = node.text
|
265
377
|
end
|
266
378
|
end
|
267
|
-
if(fault = doc.xpath('//Fault/Reason/Text').first)
|
379
|
+
if (fault = doc.xpath('//Fault/Reason/Text').first)
|
268
380
|
response['Fault'] = fault.text
|
269
381
|
end
|
270
382
|
|
271
383
|
response
|
272
384
|
end
|
273
385
|
|
274
|
-
def commit(action, &request)
|
386
|
+
def commit(action, reference = nil, &request)
|
275
387
|
data = build_request(action, &request)
|
276
388
|
|
277
|
-
response =
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
389
|
+
response =
|
390
|
+
begin
|
391
|
+
parse(ssl_post((test? ? test_url : live_url), data, 'Content-Type' => 'text/xml'))
|
392
|
+
rescue ResponseError => e
|
393
|
+
parse(e.response.body)
|
394
|
+
end
|
282
395
|
|
283
396
|
ActiveMerchant::Billing::Response.new(
|
284
397
|
successful?(response),
|
285
398
|
message_from(response),
|
286
399
|
response,
|
287
400
|
test: test?,
|
288
|
-
authorization: authorization_from(response),
|
401
|
+
authorization: authorization_from(response, reference),
|
289
402
|
avs_result: {
|
290
403
|
code: response['AVSRsltCode'],
|
291
404
|
message: response['AVSRsltText']
|
@@ -294,28 +407,31 @@ module ActiveMerchant #:nodoc:
|
|
294
407
|
)
|
295
408
|
end
|
296
409
|
|
410
|
+
SUCCESSFUL_RESPONSE_CODES = %w(0 00 85)
|
297
411
|
def successful?(response)
|
298
412
|
(
|
299
413
|
(response['GatewayRspCode'] == '0') &&
|
300
|
-
((response['RspCode']
|
414
|
+
((SUCCESSFUL_RESPONSE_CODES.include? response['RspCode']) || !response['RspCode'])
|
301
415
|
)
|
302
416
|
end
|
303
417
|
|
304
418
|
def message_from(response)
|
305
|
-
if
|
419
|
+
if response['Fault']
|
306
420
|
response['Fault']
|
307
|
-
elsif
|
308
|
-
if
|
309
|
-
issuer_message(response['RspCode'])
|
310
|
-
else
|
421
|
+
elsif response['GatewayRspCode'] == '0'
|
422
|
+
if SUCCESSFUL_RESPONSE_CODES.include? response['RspCode']
|
311
423
|
response['GatewayRspMsg']
|
424
|
+
else
|
425
|
+
issuer_message(response['RspCode'])
|
312
426
|
end
|
313
427
|
else
|
314
428
|
(GATEWAY_MESSAGES[response['GatewayRspCode']] || response['GatewayRspMsg'])
|
315
429
|
end
|
316
430
|
end
|
317
431
|
|
318
|
-
def authorization_from(response)
|
432
|
+
def authorization_from(response, reference)
|
433
|
+
return [reference, response['GatewayTxnId']].join('|') if reference
|
434
|
+
|
319
435
|
response['GatewayTxnId']
|
320
436
|
end
|
321
437
|
|
@@ -323,6 +439,10 @@ module ActiveMerchant #:nodoc:
|
|
323
439
|
@options[:secret_api_key]&.include?('_cert_')
|
324
440
|
end
|
325
441
|
|
442
|
+
def alphanumeric_zip(zip)
|
443
|
+
zip.gsub(/[^0-9a-z]/i, '')
|
444
|
+
end
|
445
|
+
|
326
446
|
ISSUER_MESSAGES = {
|
327
447
|
'13' => 'Must be greater than or equal 0.',
|
328
448
|
'14' => 'The card number is incorrect.',
|
@@ -336,6 +456,7 @@ module ActiveMerchant #:nodoc:
|
|
336
456
|
return 'The card was declined.' if %w(02 03 04 05 41 43 44 51 56 61 62 63 65 78).include?(code)
|
337
457
|
return 'An error occurred while processing the card.' if %w(06 07 12 15 19 12 52 53 57 58 76 77 91 96 EC).include?(code)
|
338
458
|
return "The card's security code is incorrect." if %w(EB N7).include?(code)
|
459
|
+
|
339
460
|
ISSUER_MESSAGES[code]
|
340
461
|
end
|
341
462
|
|