activemerchant 1.45.0 → 1.126.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +2167 -2
- data/CONTRIBUTORS +57 -0
- data/README.md +62 -41
- data/lib/active_merchant/billing/avs_result.rb +25 -28
- data/lib/active_merchant/billing/base.rb +11 -35
- data/lib/active_merchant/billing/check.rb +28 -24
- data/lib/active_merchant/billing/compatibility.rb +10 -12
- data/lib/active_merchant/billing/credit_card.rb +141 -69
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +348 -52
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +125 -61
- data/lib/active_merchant/billing/gateways/adyen.rb +633 -127
- data/lib/active_merchant/billing/gateways/airwallex.rb +341 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +883 -195
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +104 -103
- data/lib/active_merchant/billing/gateways/axcessms.rb +179 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
- data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
- data/lib/active_merchant/billing/gateways/banwire.rb +24 -13
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +397 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
- data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +143 -62
- data/lib/active_merchant/billing/gateways/beanstream.rb +45 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +13 -10
- data/lib/active_merchant/billing/gateways/blue_pay.rb +549 -506
- data/lib/active_merchant/billing/gateways/blue_snap.rb +623 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +82 -36
- data/lib/active_merchant/billing/gateways/borgun.rb +61 -40
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +21 -2
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +3 -3
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +592 -203
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +116 -61
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +320 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +248 -97
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +256 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +70 -26
- data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
- data/lib/active_merchant/billing/gateways/cecabank.rb +73 -53
- data/lib/active_merchant/billing/gateways/cenpos.rb +328 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +32 -33
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +340 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +21 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +219 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
- data/lib/active_merchant/billing/gateways/conekta.rb +55 -34
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +506 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +637 -221
- data/lib/active_merchant/billing/gateways/d_local.rb +303 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +57 -355
- data/lib/active_merchant/billing/gateways/decidir.rb +347 -0
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +295 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +334 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
- data/lib/active_merchant/billing/gateways/elavon.rb +377 -250
- data/lib/active_merchant/billing/gateways/element.rb +386 -0
- data/lib/active_merchant/billing/gateways/epay.rb +92 -71
- data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
- data/lib/active_merchant/billing/gateways/eway.rb +85 -73
- data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +134 -80
- data/lib/active_merchant/billing/gateways/exact.rb +37 -36
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +124 -74
- data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
- data/lib/active_merchant/billing/gateways/finansbank.rb +4 -5
- data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
- data/lib/active_merchant/billing/gateways/first_pay.rb +45 -23
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +184 -87
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +286 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +31 -32
- data/lib/active_merchant/billing/gateways/global_collect.rb +507 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +25 -15
- data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
- data/lib/active_merchant/billing/gateways/hps.rb +252 -68
- data/lib/active_merchant/billing/gateways/iats_payments.rb +99 -38
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +48 -48
- data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
- data/lib/active_merchant/billing/gateways/ipg.rb +415 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +176 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +254 -244
- data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
- data/lib/active_merchant/billing/gateways/iveri.rb +254 -0
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +200 -80
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +432 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +277 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +412 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +95 -85
- data/lib/active_merchant/billing/gateways/litle.rb +371 -94
- data/lib/active_merchant/billing/gateways/mastercard.rb +293 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +146 -123
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +331 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +47 -23
- data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +60 -44
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +76 -23
- data/lib/active_merchant/billing/gateways/mercury.rb +73 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +33 -43
- data/lib/active_merchant/billing/gateways/micropayment.rb +182 -0
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +101 -37
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +30 -34
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +422 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +236 -72
- data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
- data/lib/active_merchant/billing/gateways/mundipagg.rb +363 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +87 -68
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +163 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
- data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
- data/lib/active_merchant/billing/gateways/netbanx.rb +376 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +82 -43
- data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
- data/lib/active_merchant/billing/gateways/nmi.rb +279 -174
- data/lib/active_merchant/billing/gateways/ogone.rb +96 -50
- data/lib/active_merchant/billing/gateways/omise.rb +323 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +58 -23
- data/lib/active_merchant/billing/gateways/opp.rb +394 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +87 -69
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
- data/lib/active_merchant/billing/gateways/orbital.rb +771 -328
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +31 -32
- data/lib/active_merchant/billing/gateways/pagarme.rb +239 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +84 -68
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +206 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
- data/lib/active_merchant/billing/gateways/pay_trace.rb +404 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +85 -49
- data/lib/active_merchant/billing/gateways/payeezy.rb +458 -0
- data/lib/active_merchant/billing/gateways/payex.rb +39 -42
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +67 -41
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +215 -46
- data/lib/active_merchant/billing/gateways/payflow_express.rb +64 -68
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +78 -58
- data/lib/active_merchant/billing/gateways/paymentez.rb +353 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +163 -75
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal.rb +37 -18
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal_express.rb +12 -6
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/paysafe.rb +412 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -91
- data/lib/active_merchant/billing/gateways/payu_in.rb +249 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +479 -0
- data/lib/active_merchant/billing/gateways/payway.rb +27 -27
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +113 -37
- data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
- data/lib/active_merchant/billing/gateways/priority.rb +369 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +325 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +55 -44
- data/lib/active_merchant/billing/gateways/psl_card.rb +32 -40
- data/lib/active_merchant/billing/gateways/qbms.rb +86 -76
- data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
- data/lib/active_merchant/billing/gateways/quickbooks.rb +377 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +297 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -353
- data/lib/active_merchant/billing/gateways/qvalent.rb +305 -0
- data/lib/active_merchant/billing/gateways/rapyd.rb +258 -0
- data/lib/active_merchant/billing/gateways/realex.rb +154 -52
- data/lib/active_merchant/billing/gateways/redsys.rb +488 -161
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +298 -0
- data/lib/active_merchant/billing/gateways/sage.rb +404 -133
- data/lib/active_merchant/billing/gateways/sage_pay.rb +145 -109
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
- data/lib/active_merchant/billing/gateways/secure_net.rb +62 -54
- data/lib/active_merchant/billing/gateways/secure_pay.rb +32 -42
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +36 -27
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
- data/lib/active_merchant/billing/gateways/securion_pay.rb +265 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +362 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -54
- data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +108 -43
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -120
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +516 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +19 -25
- data/lib/active_merchant/billing/gateways/telr.rb +273 -0
- data/lib/active_merchant/billing/gateways/tns.rb +16 -217
- data/lib/active_merchant/billing/gateways/trans_first.rb +148 -34
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +612 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +222 -0
- data/lib/active_merchant/billing/gateways/transax.rb +6 -8
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +221 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +162 -89
- data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +332 -236
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +185 -72
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
- data/lib/active_merchant/billing/gateways/viaklix.rb +19 -31
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +250 -0
- data/lib/active_merchant/billing/gateways/vpos.rb +220 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +108 -62
- data/lib/active_merchant/billing/gateways/wirecard.rb +52 -43
- data/lib/active_merchant/billing/gateways/wompi.rb +193 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +345 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +725 -121
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +208 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +79 -39
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +1 -1
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/billing/response.rb +19 -13
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +3 -0
- data/lib/active_merchant/connection.rb +196 -0
- data/lib/active_merchant/country.rb +13 -8
- data/lib/active_merchant/errors.rb +6 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +11 -0
- data/lib/active_merchant/network_connection_retries.rb +78 -0
- data/lib/active_merchant/post_data.rb +26 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +14 -59
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3214 -0
- data/lib/support/gateway_support.rb +8 -10
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +9 -14
- data/lib/support/ssl_version.rb +86 -0
- metadata +136 -94
- checksums.yaml.gz.sig +0 -1
- data/lib/active_merchant/billing/gateways/app55.rb +0 -176
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -278
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -291
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -87
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_vault.rb +0 -149
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -385
- data/lib/active_merchant/offsite_payments_shim.rb +0 -19
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
@@ -1,14 +1,17 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class JetpayGateway < Gateway
|
4
|
+
class_attribute :live_us_url, :live_ca_url
|
5
|
+
|
4
6
|
self.test_url = 'https://test1.jetpay.com/jetpay'
|
5
|
-
self.
|
7
|
+
self.live_us_url = 'https://gateway17.jetpay.com/jetpay'
|
8
|
+
self.live_ca_url = 'https://gateway17.jetpay.com/canada-bb'
|
6
9
|
|
7
10
|
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
8
|
-
self.supported_countries = [
|
11
|
+
self.supported_countries = %w[US CA]
|
9
12
|
|
10
13
|
# The card types supported by the payment gateway
|
11
|
-
self.supported_cardtypes = [
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
12
15
|
|
13
16
|
# The homepage URL of the gateway
|
14
17
|
self.homepage_url = 'http://www.jetpay.com/'
|
@@ -20,46 +23,132 @@ module ActiveMerchant #:nodoc:
|
|
20
23
|
self.money_format = :cents
|
21
24
|
|
22
25
|
ACTION_CODE_MESSAGES = {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
26
|
+
'000' => 'Approved.',
|
27
|
+
'001' => 'Refer to card issuer.',
|
28
|
+
'002' => 'Refer to card issuer, special condition.',
|
29
|
+
'003' => 'Invalid merchant or service provider.',
|
30
|
+
'004' => 'Pick up card.',
|
31
|
+
'005' => 'Do not honor.',
|
32
|
+
'006' => 'Error.',
|
33
|
+
'007' => 'Pick up card, special condition.',
|
34
|
+
'008' => 'Honor with ID (Show ID).',
|
35
|
+
'010' => 'Partial approval.',
|
36
|
+
'011' => 'VIP approval.',
|
37
|
+
'012' => 'Invalid transaction.',
|
38
|
+
'013' => 'Invalid amount or exceeds maximum for card program.',
|
39
|
+
'014' => 'Invalid account number (no such number).',
|
40
|
+
'015' => 'No such issuer.',
|
41
|
+
'019' => 'Re-enter Transaction.',
|
42
|
+
'021' => 'No action taken (unable to back out prior transaction).',
|
43
|
+
'025' => 'Transaction Not Found.',
|
44
|
+
'027' => 'File update field edit error.',
|
45
|
+
'028' => 'File is temporarily unavailable.',
|
46
|
+
'030' => 'Format error.',
|
47
|
+
'039' => 'No credit account.',
|
48
|
+
'041' => 'Pick up card (lost card).',
|
49
|
+
'043' => 'Pick up card (stolen card).',
|
50
|
+
'051' => 'Insufficient funds.',
|
51
|
+
'052' => 'No checking account.',
|
52
|
+
'053' => 'No savings account.',
|
53
|
+
'054' => 'Expired Card.',
|
54
|
+
'055' => 'Incorrect PIN.',
|
55
|
+
'057' => 'Transaction not permitted to cardholder.',
|
56
|
+
'058' => 'Transaction not allowed at terminal.',
|
57
|
+
'061' => 'Exceeds withdrawal limit.',
|
58
|
+
'062' => 'Restricted card (eg, Country Exclusion).',
|
59
|
+
'063' => 'Security violation.',
|
60
|
+
'065' => 'Activity count limit exceeded.',
|
61
|
+
'068' => 'Response late.',
|
62
|
+
'070' => 'Contact card issuer.',
|
63
|
+
'071' => 'PIN not changed.',
|
64
|
+
'075' => 'Allowable number of PIN-entry tries exceeded.',
|
65
|
+
'076' => 'Unable to locate previous message (no matching retrieval reference number).',
|
66
|
+
'077' => 'Repeat or reversal data are inconsistent with original message.',
|
67
|
+
'078' => 'Blocked (first use), or non-existent account.',
|
68
|
+
'079' => 'Key exchange validation failed.',
|
69
|
+
'080' => 'Credit issuer unavailable or invalid date.',
|
70
|
+
'081' => 'PIN cryptographic error found.',
|
71
|
+
'082' => 'Negative online CVV results.',
|
72
|
+
'084' => 'Invalid auth life cycle.',
|
73
|
+
'085' => 'No reason to decline - CVV or AVS approved.',
|
74
|
+
'086' => 'Cannot verify PIN.',
|
75
|
+
'087' => 'Cashback not allowed.',
|
76
|
+
'089' => 'Issuer Down.',
|
77
|
+
'091' => 'Issuer Down.',
|
78
|
+
'092' => 'Unable to route transaction.',
|
79
|
+
'093' => 'Transaction cannot be completed - violation of law.',
|
80
|
+
'094' => 'Duplicate transmission.',
|
81
|
+
'096' => 'System error.',
|
82
|
+
'100' => 'Deny.',
|
83
|
+
'101' => 'Expired Card.',
|
84
|
+
'103' => 'Deny - Invalid manual Entry 4DBC.',
|
85
|
+
'104' => 'Deny - New card issued.',
|
86
|
+
'105' => 'Deny - Account Cancelled.',
|
87
|
+
'106' => 'Exceeded PIN Attempts.',
|
88
|
+
'107' => 'Please Call Issuer.',
|
89
|
+
'109' => 'Invalid merchant.',
|
90
|
+
'110' => 'Invalid amount.',
|
91
|
+
'111' => 'Invalid account.',
|
92
|
+
'115' => 'Service not permitted.',
|
93
|
+
'122' => 'Invalid card (CID) security code.',
|
94
|
+
'125' => 'Invalid effective date.',
|
95
|
+
'181' => 'Format error.',
|
96
|
+
'182' => 'Please wait.',
|
97
|
+
'183' => 'Invalid currency code.',
|
98
|
+
'187' => 'Deny - new card issued.',
|
99
|
+
'188' => 'Deny - Expiration date required.',
|
100
|
+
'189' => 'Deny - Cancelled or Closed Merchant/SE.',
|
101
|
+
'200' => 'Deny - Pick up card.',
|
102
|
+
'400' => 'Reversal accepted.',
|
103
|
+
'601' => 'Reject - EMV Chip Declined Transaction.',
|
104
|
+
'602' => 'Reject - Suspected Fraud.',
|
105
|
+
'603' => 'Reject - Communications Error.',
|
106
|
+
'604' => 'Reject - Insufficient Approval.',
|
107
|
+
'750' => 'Velocity Check Fail.',
|
108
|
+
'899' => 'Misc Decline.',
|
109
|
+
'900' => 'Invalid Message Type.',
|
110
|
+
'901' => 'Invalid Merchant ID.',
|
111
|
+
'903' => 'Debit not supported.',
|
112
|
+
'904' => 'Private label not supported.',
|
113
|
+
'905' => 'Invalid card type.',
|
114
|
+
'906' => 'Unit not active.',
|
115
|
+
'908' => 'Manual card entry invalid.',
|
116
|
+
'909' => 'Invalid track information.',
|
117
|
+
'911' => 'Master merchant not found.',
|
118
|
+
'912' => 'Invalid card format.',
|
119
|
+
'913' => 'Invalid card type.',
|
120
|
+
'914' => 'Invalid card length.',
|
121
|
+
'917' => 'Expired card.',
|
122
|
+
'919' => 'Invalid entry type.',
|
123
|
+
'920' => 'Invalid amount.',
|
124
|
+
'921' => 'Invalid messge format.',
|
125
|
+
'923' => 'Invalid ABA.',
|
126
|
+
'924' => 'Invalid DDA.',
|
127
|
+
'925' => 'Invalid TID.',
|
128
|
+
'926' => 'Invalid Password.',
|
129
|
+
'930' => 'Invalid zipcode.',
|
130
|
+
'931' => 'Invalid Address.',
|
131
|
+
'932' => 'Invalid ZIP and Address.',
|
132
|
+
'933' => 'Invalid CVV2.',
|
133
|
+
'934' => 'Program Not Allowed.',
|
134
|
+
'940' => 'Record Not Found.',
|
135
|
+
'941' => 'Merchant ID error.',
|
136
|
+
'942' => 'Refund Not Allowed.',
|
137
|
+
'943' => 'Refund denied.',
|
138
|
+
'955' => 'Invalid PIN block.',
|
139
|
+
'956' => 'Invalid KSN.',
|
140
|
+
'958' => 'Bad Status.',
|
141
|
+
'959' => 'Seek Record limit exceeded.',
|
142
|
+
'962' => 'Invalid PIN key (Unknown KSN).',
|
143
|
+
'981' => 'Invalid AVS.',
|
144
|
+
'987' => 'Issuer Unavailable.',
|
145
|
+
'988' => 'System error SD.',
|
146
|
+
'989' => 'Database Error.',
|
147
|
+
'992' => 'Transaction Timeout.',
|
148
|
+
'996' => 'Bad Terminal ID.',
|
149
|
+
'997' => 'Message rejected by association.',
|
150
|
+
'999' => 'Communication failure',
|
151
|
+
nil => 'No response returned (missing credentials?).'
|
63
152
|
}
|
64
153
|
|
65
154
|
def initialize(options = {})
|
@@ -76,12 +165,15 @@ module ActiveMerchant #:nodoc:
|
|
76
165
|
end
|
77
166
|
|
78
167
|
def capture(money, reference, options = {})
|
79
|
-
|
168
|
+
split_authorization = reference.split(';')
|
169
|
+
transaction_id = split_authorization[0]
|
170
|
+
token = split_authorization[3]
|
171
|
+
commit(money, build_capture_request(transaction_id, money, options), token)
|
80
172
|
end
|
81
173
|
|
82
174
|
def void(reference, options = {})
|
83
|
-
transaction_id, approval, amount = reference.split(
|
84
|
-
commit(amount.to_i, build_void_request(amount.to_i, transaction_id, approval))
|
175
|
+
transaction_id, approval, amount, token = reference.split(';')
|
176
|
+
commit(amount.to_i, build_void_request(amount.to_i, transaction_id, approval, token, options), token)
|
85
177
|
end
|
86
178
|
|
87
179
|
def credit(money, transaction_id_or_card, options = {})
|
@@ -89,26 +181,39 @@ module ActiveMerchant #:nodoc:
|
|
89
181
|
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
90
182
|
refund(money, transaction_id_or_card, options)
|
91
183
|
else
|
92
|
-
commit(money, build_credit_request('CREDIT', money, nil, transaction_id_or_card))
|
184
|
+
commit(money, build_credit_request('CREDIT', money, nil, transaction_id_or_card, nil, options))
|
93
185
|
end
|
94
186
|
end
|
95
187
|
|
96
188
|
def refund(money, reference, options = {})
|
97
|
-
|
189
|
+
split_authorization = reference.split(';')
|
190
|
+
transaction_id = split_authorization[0]
|
191
|
+
token = split_authorization[3]
|
98
192
|
credit_card = options[:credit_card]
|
99
|
-
commit(money, build_credit_request('CREDIT', money, transaction_id, credit_card))
|
193
|
+
commit(money, build_credit_request('CREDIT', money, transaction_id, credit_card, token, options))
|
100
194
|
end
|
101
195
|
|
196
|
+
def supports_scrubbing
|
197
|
+
true
|
198
|
+
end
|
199
|
+
|
200
|
+
def scrub(transcript)
|
201
|
+
transcript.
|
202
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
203
|
+
gsub(%r((>)\d+(</CardNum>)), '\1[FILTERED]\2').
|
204
|
+
gsub(%r((<CVV2>)\d+(</CVV2>)), '\1[FILTERED]\2')
|
205
|
+
end
|
102
206
|
|
103
207
|
private
|
104
208
|
|
105
|
-
def build_xml_request(transaction_type, transaction_id = nil, &block)
|
209
|
+
def build_xml_request(transaction_type, options = {}, transaction_id = nil, &block)
|
106
210
|
xml = Builder::XmlMarkup.new
|
107
211
|
xml.tag! 'JetPay' do
|
108
212
|
# The basic values needed for any request
|
109
213
|
xml.tag! 'TerminalID', @options[:login]
|
110
214
|
xml.tag! 'TransactionType', transaction_type
|
111
215
|
xml.tag! 'TransactionID', transaction_id.nil? ? generate_unique_id.slice(0, 18) : transaction_id
|
216
|
+
xml.tag! 'Origin', options[:origin] if options && options[:origin]
|
112
217
|
|
113
218
|
if block_given?
|
114
219
|
yield xml
|
@@ -119,11 +224,12 @@ module ActiveMerchant #:nodoc:
|
|
119
224
|
end
|
120
225
|
|
121
226
|
def build_sale_request(money, credit_card, options)
|
122
|
-
build_xml_request('SALE') do |xml|
|
227
|
+
build_xml_request('SALE', options) do |xml|
|
123
228
|
add_credit_card(xml, credit_card)
|
124
229
|
add_addresses(xml, options)
|
125
230
|
add_customer_data(xml, options)
|
126
231
|
add_invoice_data(xml, options)
|
232
|
+
add_user_defined_fields(xml, options)
|
127
233
|
xml.tag! 'TotalAmount', amount(money)
|
128
234
|
|
129
235
|
xml.target!
|
@@ -136,47 +242,60 @@ module ActiveMerchant #:nodoc:
|
|
136
242
|
add_addresses(xml, options)
|
137
243
|
add_customer_data(xml, options)
|
138
244
|
add_invoice_data(xml, options)
|
245
|
+
add_user_defined_fields(xml, options)
|
139
246
|
xml.tag! 'TotalAmount', amount(money)
|
140
247
|
|
141
248
|
xml.target!
|
142
249
|
end
|
143
250
|
end
|
144
251
|
|
145
|
-
def build_capture_request(
|
146
|
-
build_xml_request(
|
252
|
+
def build_capture_request(transaction_id, money, options)
|
253
|
+
build_xml_request('CAPT', options, transaction_id) do |xml|
|
254
|
+
xml.tag! 'TotalAmount', amount(money)
|
255
|
+
add_user_defined_fields(xml, options)
|
256
|
+
end
|
147
257
|
end
|
148
258
|
|
149
|
-
def build_void_request(money, transaction_id, approval)
|
150
|
-
build_xml_request('VOID', transaction_id) do |xml|
|
259
|
+
def build_void_request(money, transaction_id, approval, token, options)
|
260
|
+
build_xml_request('VOID', options, transaction_id) do |xml|
|
151
261
|
xml.tag! 'Approval', approval
|
152
262
|
xml.tag! 'TotalAmount', amount(money)
|
153
|
-
|
263
|
+
xml.tag! 'Token', token if token
|
154
264
|
xml.target!
|
155
265
|
end
|
156
266
|
end
|
157
267
|
|
158
268
|
# `transaction_id` may be nil for unlinked credit transactions.
|
159
|
-
def build_credit_request(transaction_type, money, transaction_id, card)
|
160
|
-
build_xml_request(transaction_type, transaction_id) do |xml|
|
269
|
+
def build_credit_request(transaction_type, money, transaction_id, card, token, options)
|
270
|
+
build_xml_request(transaction_type, options, transaction_id) do |xml|
|
161
271
|
add_credit_card(xml, card) if card
|
272
|
+
add_invoice_data(xml, options)
|
273
|
+
add_addresses(xml, options)
|
274
|
+
add_customer_data(xml, options)
|
275
|
+
add_user_defined_fields(xml, options)
|
162
276
|
xml.tag! 'TotalAmount', amount(money)
|
277
|
+
xml.tag! 'Token', token if token
|
163
278
|
|
164
279
|
xml.target!
|
165
280
|
end
|
166
281
|
end
|
167
282
|
|
168
|
-
def commit(money, request)
|
169
|
-
response = parse(ssl_post(
|
283
|
+
def commit(money, request, token = nil)
|
284
|
+
response = parse(ssl_post(url, request))
|
170
285
|
|
171
286
|
success = success?(response)
|
172
287
|
Response.new(success,
|
173
288
|
success ? 'APPROVED' : message_from(response),
|
174
289
|
response,
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
179
|
-
|
290
|
+
test: test?,
|
291
|
+
authorization: authorization_from(response, money, token),
|
292
|
+
avs_result: { code: response[:avs] },
|
293
|
+
cvv_result: response[:cvv2])
|
294
|
+
end
|
295
|
+
|
296
|
+
def url
|
297
|
+
live_url = @options[:region] == 'CA' ? live_ca_url : live_us_url
|
298
|
+
test? ? test_url : live_url
|
180
299
|
end
|
181
300
|
|
182
301
|
def parse(body)
|
@@ -193,7 +312,7 @@ module ActiveMerchant #:nodoc:
|
|
193
312
|
|
194
313
|
def parse_element(response, node)
|
195
314
|
if node.has_elements?
|
196
|
-
node.elements.each{|element| parse_element(response, element) }
|
315
|
+
node.elements.each { |element| parse_element(response, element) }
|
197
316
|
else
|
198
317
|
response[node.name.underscore.to_sym] = node.text
|
199
318
|
end
|
@@ -204,35 +323,31 @@ module ActiveMerchant #:nodoc:
|
|
204
323
|
end
|
205
324
|
|
206
325
|
def success?(response)
|
207
|
-
response[:action_code] ==
|
326
|
+
response[:action_code] == '000'
|
208
327
|
end
|
209
328
|
|
210
329
|
def message_from(response)
|
211
330
|
ACTION_CODE_MESSAGES[response[:action_code]]
|
212
331
|
end
|
213
332
|
|
214
|
-
def authorization_from(response, money)
|
333
|
+
def authorization_from(response, money, previous_token)
|
215
334
|
original_amount = amount(money) if money
|
216
|
-
[
|
335
|
+
[response[:transaction_id], response[:approval], original_amount, (response[:token] || previous_token)].join(';')
|
217
336
|
end
|
218
337
|
|
219
338
|
def add_credit_card(xml, credit_card)
|
220
|
-
xml.tag! 'CardNum', credit_card.number
|
339
|
+
xml.tag! 'CardNum', credit_card.number, 'Tokenize' => true
|
221
340
|
xml.tag! 'CardExpMonth', format_exp(credit_card.month)
|
222
341
|
xml.tag! 'CardExpYear', format_exp(credit_card.year)
|
223
342
|
|
224
|
-
if credit_card.first_name || credit_card.last_name
|
225
|
-
xml.tag! 'CardName', [credit_card.first_name,credit_card.last_name].compact.join(' ')
|
226
|
-
end
|
343
|
+
xml.tag! 'CardName', [credit_card.first_name, credit_card.last_name].compact.join(' ') if credit_card.first_name || credit_card.last_name
|
227
344
|
|
228
|
-
unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
|
229
|
-
xml.tag! 'CVV2', credit_card.verification_value
|
230
|
-
end
|
345
|
+
xml.tag! 'CVV2', credit_card.verification_value unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
|
231
346
|
end
|
232
347
|
|
233
348
|
def add_addresses(xml, options)
|
234
349
|
if billing_address = options[:billing_address] || options[:address]
|
235
|
-
xml.tag! 'BillingAddress', [billing_address[:address1], billing_address[:address2]].compact.join(
|
350
|
+
xml.tag! 'BillingAddress', [billing_address[:address1], billing_address[:address2]].compact.join(' ')
|
236
351
|
xml.tag! 'BillingCity', billing_address[:city]
|
237
352
|
xml.tag! 'BillingStateProv', billing_address[:state]
|
238
353
|
xml.tag! 'BillingPostalCode', billing_address[:zip]
|
@@ -245,7 +360,7 @@ module ActiveMerchant #:nodoc:
|
|
245
360
|
xml.tag! 'ShippingName', shipping_address[:name]
|
246
361
|
|
247
362
|
xml.tag! 'ShippingAddr' do
|
248
|
-
xml.tag! 'Address', [shipping_address[:address1], shipping_address[:address2]].compact.join(
|
363
|
+
xml.tag! 'Address', [shipping_address[:address1], shipping_address[:address2]].compact.join(' ')
|
249
364
|
xml.tag! 'City', shipping_address[:city]
|
250
365
|
xml.tag! 'StateProv', shipping_address[:state]
|
251
366
|
xml.tag! 'PostalCode', shipping_address[:zip]
|
@@ -265,11 +380,16 @@ module ActiveMerchant #:nodoc:
|
|
265
380
|
xml.tag! 'TaxAmount', amount(options[:tax]) if options[:tax]
|
266
381
|
end
|
267
382
|
|
383
|
+
def add_user_defined_fields(xml, options)
|
384
|
+
xml.tag! 'UDField1', options[:ud_field_1] if options[:ud_field_1]
|
385
|
+
xml.tag! 'UDField2', options[:ud_field_2] if options[:ud_field_2]
|
386
|
+
xml.tag! 'UDField3', options[:ud_field_3] if options[:ud_field_3]
|
387
|
+
end
|
388
|
+
|
268
389
|
def lookup_country_code(code)
|
269
390
|
country = Country.find(code) rescue nil
|
270
|
-
country
|
391
|
+
country&.code(:alpha3)
|
271
392
|
end
|
272
393
|
end
|
273
394
|
end
|
274
395
|
end
|
275
|
-
|