activemerchant 1.42.6 → 1.90.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 +5 -13
- data/CHANGELOG +1420 -2
- data/CONTRIBUTORS +106 -0
- data/README.md +107 -103
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/avs_result.rb +12 -13
- data/lib/active_merchant/billing/base.rb +13 -16
- data/lib/active_merchant/billing/check.rb +35 -24
- data/lib/active_merchant/billing/compatibility.rb +117 -0
- data/lib/active_merchant/billing/credit_card.rb +196 -81
- data/lib/active_merchant/billing/credit_card_formatting.rb +6 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +199 -75
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +171 -39
- data/lib/active_merchant/billing/gateways/adyen.rb +380 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +933 -604
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +74 -54
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +130 -370
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +23 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +351 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +109 -32
- data/lib/active_merchant/billing/gateways/beanstream.rb +59 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -9
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -498
- data/lib/active_merchant/billing/gateways/blue_snap.rb +347 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +80 -46
- data/lib/active_merchant/billing/gateways/borgun.rb +220 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +15 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +311 -121
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +244 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +311 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +6 -7
- data/lib/active_merchant/billing/gateways/card_stream.rb +235 -89
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +50 -8
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -14
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +22 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +142 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +91 -97
- data/lib/active_merchant/billing/gateways/creditcall.rb +271 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +356 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +268 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +294 -158
- data/lib/active_merchant/billing/gateways/d_local.rb +226 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +59 -347
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +24 -39
- data/lib/active_merchant/billing/gateways/elavon.rb +146 -147
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +41 -31
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +79 -78
- data/lib/active_merchant/billing/gateways/eway_managed.rb +35 -36
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +369 -228
- data/lib/active_merchant/billing/gateways/exact.rb +32 -26
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +90 -64
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -14
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +142 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +128 -122
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +190 -64
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +446 -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 +270 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +29 -27
- data/lib/active_merchant/billing/gateways/global_collect.rb +340 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +35 -36
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +29 -32
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -6
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +247 -41
- data/lib/active_merchant/billing/gateways/itransact.rb +4 -5
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +198 -71
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +219 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +411 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +45 -43
- data/lib/active_merchant/billing/gateways/litle.rb +328 -444
- data/lib/active_merchant/billing/gateways/mastercard.rb +267 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +145 -115
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +277 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +37 -19
- data/lib/active_merchant/billing/gateways/merchant_one.rb +13 -15
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +57 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +59 -48
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +38 -19
- data/lib/active_merchant/billing/gateways/mercury.rb +77 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +11 -30
- data/lib/active_merchant/billing/gateways/micropayment.rb +183 -0
- data/lib/active_merchant/billing/gateways/migs.rb +81 -22
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +23 -25
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +146 -64
- data/lib/active_merchant/billing/gateways/moneris_us.rb +197 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -15
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +86 -64
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +11 -5
- data/lib/active_merchant/billing/gateways/netaxept.rb +21 -22
- data/lib/active_merchant/billing/gateways/netbanx.rb +290 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +70 -35
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -6
- data/lib/active_merchant/billing/gateways/network_merchants.rb +241 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +274 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +90 -47
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +48 -20
- data/lib/active_merchant/billing/gateways/opp.rb +369 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +79 -44
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -102
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +48 -29
- data/lib/active_merchant/billing/gateways/pagarme.rb +246 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +67 -48
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +20 -26
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +188 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +7 -15
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +40 -36
- data/lib/active_merchant/billing/gateways/payeezy.rb +410 -0
- data/lib/active_merchant/billing/gateways/payex.rb +38 -30
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +62 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +74 -27
- data/lib/active_merchant/billing/gateways/payflow_express.rb +77 -81
- 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 +54 -45
- data/lib/active_merchant/billing/gateways/paymentez.rb +304 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +160 -66
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +54 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +17 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +36 -27
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +7 -6
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -88
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +445 -0
- data/lib/active_merchant/billing/gateways/payway.rb +8 -8
- data/lib/active_merchant/billing/gateways/pin.rb +74 -18
- data/lib/active_merchant/billing/gateways/plugnpay.rb +66 -76
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +30 -30
- data/lib/active_merchant/billing/gateways/psl_card.rb +27 -34
- data/lib/active_merchant/billing/gateways/qbms.rb +65 -54
- data/lib/active_merchant/billing/gateways/quantum.rb +18 -18
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +295 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -350
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +78 -48
- data/lib/active_merchant/billing/gateways/redsys.rb +310 -170
- data/lib/active_merchant/billing/gateways/s5.rb +246 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +415 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +195 -90
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -12
- data/lib/active_merchant/billing/gateways/secure_net.rb +51 -43
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -10
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -14
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +10 -18
- data/lib/active_merchant/billing/gateways/securion_pay.rb +264 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +35 -38
- data/lib/active_merchant/billing/gateways/smart_ps.rb +50 -42
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +9 -9
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +62 -12
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -103
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +12 -18
- data/lib/active_merchant/billing/gateways/telr.rb +274 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +143 -30
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transax.rb +5 -6
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -232
- data/lib/active_merchant/billing/gateways/trexle.rb +218 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +86 -57
- data/lib/active_merchant/billing/gateways/usa_epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +196 -89
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +157 -32
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +42 -49
- data/lib/active_merchant/billing/gateways/viaklix.rb +11 -24
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +233 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +26 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +237 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +153 -31
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +207 -63
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +215 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +31 -24
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +195 -0
- data/lib/active_merchant/country.rb +335 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +10 -0
- data/lib/active_merchant/network_connection_retries.rb +80 -0
- data/lib/active_merchant/post_data.rb +25 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +23 -27
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3988 -0
- data/lib/support/gateway_support.rb +7 -9
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +6 -7
- data/lib/support/ssl_version.rb +87 -0
- metadata +148 -323
- checksums.yaml.gz.sig +0 -0
- data/gem-public_cert.pem +0 -21
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/app55.rb +0 -185
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -249
- 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/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/alipay/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/alipay/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/alipay.rb +0 -18
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -64
- data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +0 -74
- data/lib/active_merchant/billing/integrations/bit_pay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus/notification.rb +0 -133
- data/lib/active_merchant/billing/integrations/citrus/return.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus.rb +0 -51
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/doku/helper.rb +0 -102
- data/lib/active_merchant/billing/integrations/doku/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/doku/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/doku.rb +0 -24
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -118
- data/lib/active_merchant/billing/integrations/ipay88/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -29
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -23
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -60
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -154
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +0 -19
- data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +0 -16
- data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +0 -30
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -107
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -171
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -58
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/common.rb +0 -104
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/helper.rb +0 -145
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb +0 -35
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page.rb +0 -39
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require File.dirname(__FILE__) + '/orbital/cvv_result'
|
|
4
|
-
require "rexml/document"
|
|
1
|
+
require 'active_merchant/billing/gateways/orbital/orbital_soft_descriptors'
|
|
2
|
+
require 'rexml/document'
|
|
5
3
|
|
|
6
4
|
module ActiveMerchant #:nodoc:
|
|
7
5
|
module Billing #:nodoc:
|
|
@@ -30,15 +28,17 @@ module ActiveMerchant #:nodoc:
|
|
|
30
28
|
# Company will automatically be affiliated.
|
|
31
29
|
|
|
32
30
|
class OrbitalGateway < Gateway
|
|
33
|
-
|
|
31
|
+
include Empty
|
|
32
|
+
|
|
33
|
+
API_VERSION = '7.1'
|
|
34
34
|
|
|
35
35
|
POST_HEADERS = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
'MIME-Version' => '1.1',
|
|
37
|
+
'Content-Type' => "application/PTI#{API_VERSION.gsub(/\./, '')}",
|
|
38
|
+
'Content-transfer-encoding' => 'text',
|
|
39
|
+
'Request-number' => '1',
|
|
40
|
+
'Document-type' => 'Request',
|
|
41
|
+
'Interface-Version' => 'Ruby|ActiveMerchant|Proprietary Gateway'
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
SUCCESS = '0'
|
|
@@ -65,14 +65,14 @@ module ActiveMerchant #:nodoc:
|
|
|
65
65
|
|
|
66
66
|
class_attribute :secondary_test_url, :secondary_live_url
|
|
67
67
|
|
|
68
|
-
self.test_url =
|
|
69
|
-
self.secondary_test_url =
|
|
68
|
+
self.test_url = 'https://orbitalvar1.chasepaymentech.com/authorize'
|
|
69
|
+
self.secondary_test_url = 'https://orbitalvar2.chasepaymentech.com/authorize'
|
|
70
70
|
|
|
71
|
-
self.live_url =
|
|
72
|
-
self.secondary_live_url =
|
|
71
|
+
self.live_url = 'https://orbital1.chasepaymentech.com/authorize'
|
|
72
|
+
self.secondary_live_url = 'https://orbital2.chasepaymentech.com/authorize'
|
|
73
73
|
|
|
74
|
-
self.supported_countries = [
|
|
75
|
-
self.default_currency =
|
|
74
|
+
self.supported_countries = ['US', 'CA']
|
|
75
|
+
self.default_currency = 'CAD'
|
|
76
76
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
|
|
77
77
|
|
|
78
78
|
self.display_name = 'Orbital Paymentech'
|
|
@@ -83,41 +83,45 @@ module ActiveMerchant #:nodoc:
|
|
|
83
83
|
AVS_SUPPORTED_COUNTRIES = ['US', 'CA', 'UK', 'GB']
|
|
84
84
|
|
|
85
85
|
CURRENCY_CODES = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
'AUD' => '036',
|
|
87
|
+
'BRL' => '986',
|
|
88
|
+
'CAD' => '124',
|
|
89
|
+
'CLP' => '152',
|
|
90
|
+
'CZK' => '203',
|
|
91
|
+
'DKK' => '208',
|
|
92
|
+
'HKD' => '344',
|
|
93
|
+
'ICK' => '352',
|
|
94
|
+
'JPY' => '392',
|
|
95
|
+
'MXN' => '484',
|
|
96
|
+
'NZD' => '554',
|
|
97
|
+
'NOK' => '578',
|
|
98
|
+
'SGD' => '702',
|
|
99
|
+
'SEK' => '752',
|
|
100
|
+
'CHF' => '756',
|
|
101
|
+
'GBP' => '826',
|
|
102
|
+
'USD' => '840',
|
|
103
|
+
'EUR' => '978'
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
CURRENCY_EXPONENTS = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
'AUD' => '2',
|
|
108
|
+
'BRL' => '2',
|
|
109
|
+
'CAD' => '2',
|
|
110
|
+
'CLP' => '2',
|
|
111
|
+
'CZK' => '2',
|
|
112
|
+
'DKK' => '2',
|
|
113
|
+
'HKD' => '2',
|
|
114
|
+
'ICK' => '2',
|
|
115
|
+
'JPY' => '0',
|
|
116
|
+
'MXN' => '2',
|
|
117
|
+
'NZD' => '2',
|
|
118
|
+
'NOK' => '2',
|
|
119
|
+
'SGD' => '2',
|
|
120
|
+
'SEK' => '2',
|
|
121
|
+
'CHF' => '2',
|
|
122
|
+
'GBP' => '2',
|
|
123
|
+
'USD' => '2',
|
|
124
|
+
'EUR' => '2'
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
# INDUSTRY TYPES
|
|
@@ -177,32 +181,42 @@ module ActiveMerchant #:nodoc:
|
|
|
177
181
|
USE_ORDER_ID = 'O' # Use OrderID field
|
|
178
182
|
USE_COMMENTS = 'D' # Use Comments field
|
|
179
183
|
|
|
184
|
+
SENSITIVE_FIELDS = [:account_num, :cc_account_num]
|
|
185
|
+
|
|
180
186
|
def initialize(options = {})
|
|
181
187
|
requires!(options, :merchant_id)
|
|
182
188
|
requires!(options, :login, :password) unless options[:ip_authentication]
|
|
183
189
|
super
|
|
190
|
+
@options[:merchant_id] = @options[:merchant_id].to_s
|
|
184
191
|
end
|
|
185
192
|
|
|
186
193
|
# A – Authorization request
|
|
187
194
|
def authorize(money, creditcard, options = {})
|
|
188
|
-
order = build_new_order_xml(AUTH_ONLY, money, options) do |xml|
|
|
195
|
+
order = build_new_order_xml(AUTH_ONLY, money, creditcard, options) do |xml|
|
|
189
196
|
add_creditcard(xml, creditcard, options[:currency])
|
|
190
197
|
add_address(xml, creditcard, options)
|
|
191
198
|
if @options[:customer_profiles]
|
|
192
|
-
add_customer_data(xml, options)
|
|
199
|
+
add_customer_data(xml, creditcard, options)
|
|
193
200
|
add_managed_billing(xml, options)
|
|
194
201
|
end
|
|
195
202
|
end
|
|
196
203
|
commit(order, :authorize, options[:trace_number])
|
|
197
204
|
end
|
|
198
205
|
|
|
206
|
+
def verify(creditcard, options = {})
|
|
207
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
208
|
+
r.process { authorize(100, creditcard, options) }
|
|
209
|
+
r.process(:ignore_result) { void(r.authorization) }
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
199
213
|
# AC – Authorization and Capture
|
|
200
214
|
def purchase(money, creditcard, options = {})
|
|
201
|
-
order = build_new_order_xml(AUTH_AND_CAPTURE, money, options) do |xml|
|
|
215
|
+
order = build_new_order_xml(AUTH_AND_CAPTURE, money, creditcard, options) do |xml|
|
|
202
216
|
add_creditcard(xml, creditcard, options[:currency])
|
|
203
217
|
add_address(xml, creditcard, options)
|
|
204
218
|
if @options[:customer_profiles]
|
|
205
|
-
add_customer_data(xml, options)
|
|
219
|
+
add_customer_data(xml, creditcard, options)
|
|
206
220
|
add_managed_billing(xml, options)
|
|
207
221
|
end
|
|
208
222
|
end
|
|
@@ -216,7 +230,7 @@ module ActiveMerchant #:nodoc:
|
|
|
216
230
|
|
|
217
231
|
# R – Refund request
|
|
218
232
|
def refund(money, authorization, options = {})
|
|
219
|
-
order = build_new_order_xml(REFUND, money, options.merge(:authorization => authorization)) do |xml|
|
|
233
|
+
order = build_new_order_xml(REFUND, money, nil, options.merge(:authorization => authorization)) do |xml|
|
|
220
234
|
add_refund(xml, options[:currency])
|
|
221
235
|
xml.tag! :CustomerRefNum, options[:customer_ref_num] if @options[:customer_profiles] && options[:profile_txn]
|
|
222
236
|
end
|
|
@@ -224,13 +238,13 @@ module ActiveMerchant #:nodoc:
|
|
|
224
238
|
end
|
|
225
239
|
|
|
226
240
|
def credit(money, authorization, options= {})
|
|
227
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
241
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
228
242
|
refund(money, authorization, options)
|
|
229
243
|
end
|
|
230
244
|
|
|
231
245
|
def void(authorization, options = {}, deprecated = {})
|
|
232
246
|
if(!options.kind_of?(Hash))
|
|
233
|
-
deprecated(
|
|
247
|
+
ActiveMerchant.deprecated('Calling the void method with an amount parameter is deprecated and will be removed in a future version.')
|
|
234
248
|
return void(options, deprecated.merge(:amount => authorization))
|
|
235
249
|
end
|
|
236
250
|
|
|
@@ -238,9 +252,8 @@ module ActiveMerchant #:nodoc:
|
|
|
238
252
|
commit(order, :void, options[:trace_number])
|
|
239
253
|
end
|
|
240
254
|
|
|
241
|
-
|
|
242
255
|
# ==== Customer Profiles
|
|
243
|
-
# :customer_ref_num should be set unless
|
|
256
|
+
# :customer_ref_num should be set unless you're happy with Orbital providing one
|
|
244
257
|
#
|
|
245
258
|
# :customer_profile_order_override_ind can be set to map
|
|
246
259
|
# the CustomerRefNum to OrderID or Comments. Defaults to 'NO' - no mapping
|
|
@@ -261,13 +274,13 @@ module ActiveMerchant #:nodoc:
|
|
|
261
274
|
# 'MS' - Manual Suspend
|
|
262
275
|
|
|
263
276
|
def add_customer_profile(creditcard, options = {})
|
|
264
|
-
options
|
|
277
|
+
options[:customer_profile_action] = CREATE
|
|
265
278
|
order = build_customer_request_xml(creditcard, options)
|
|
266
279
|
commit(order, :add_customer_profile)
|
|
267
280
|
end
|
|
268
281
|
|
|
269
282
|
def update_customer_profile(creditcard, options = {})
|
|
270
|
-
options
|
|
283
|
+
options[:customer_profile_action] = UPDATE
|
|
271
284
|
order = build_customer_request_xml(creditcard, options)
|
|
272
285
|
commit(order, :update_customer_profile)
|
|
273
286
|
end
|
|
@@ -284,22 +297,39 @@ module ActiveMerchant #:nodoc:
|
|
|
284
297
|
commit(order, :delete_customer_profile)
|
|
285
298
|
end
|
|
286
299
|
|
|
300
|
+
def supports_scrubbing?
|
|
301
|
+
true
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
def scrub(transcript)
|
|
305
|
+
transcript.
|
|
306
|
+
gsub(%r((<OrbitalConnectionUsername>).+(</OrbitalConnectionUsername>)), '\1[FILTERED]\2').
|
|
307
|
+
gsub(%r((<OrbitalConnectionPassword>).+(</OrbitalConnectionPassword>)), '\1[FILTERED]\2').
|
|
308
|
+
gsub(%r((<AccountNum>).+(</AccountNum>)), '\1[FILTERED]\2').
|
|
309
|
+
gsub(%r((<CCAccountNum>).+(</CCAccountNum>)), '\1[FILTERED]\2').
|
|
310
|
+
gsub(%r((<CardSecVal>).+(</CardSecVal>)), '\1[FILTERED]\2').
|
|
311
|
+
gsub(%r((<MerchantID>).+(</MerchantID>)), '\1[FILTERED]\2').
|
|
312
|
+
gsub(%r((<CustomerMerchantID>).+(</CustomerMerchantID>)), '\1[FILTERED]\2')
|
|
313
|
+
end
|
|
314
|
+
|
|
287
315
|
private
|
|
288
316
|
|
|
289
317
|
def authorization_string(*args)
|
|
290
|
-
args.compact.join(
|
|
318
|
+
args.compact.join(';')
|
|
291
319
|
end
|
|
292
320
|
|
|
293
321
|
def split_authorization(authorization)
|
|
294
322
|
authorization.split(';')
|
|
295
323
|
end
|
|
296
324
|
|
|
297
|
-
def add_customer_data(xml, options)
|
|
325
|
+
def add_customer_data(xml, creditcard, options)
|
|
298
326
|
if options[:profile_txn]
|
|
299
327
|
xml.tag! :CustomerRefNum, options[:customer_ref_num]
|
|
300
328
|
else
|
|
301
329
|
if options[:customer_ref_num]
|
|
302
|
-
|
|
330
|
+
if creditcard
|
|
331
|
+
xml.tag! :CustomerProfileFromOrderInd, USE_CUSTOMER_REF_NUM
|
|
332
|
+
end
|
|
303
333
|
xml.tag! :CustomerRefNum, options[:customer_ref_num]
|
|
304
334
|
else
|
|
305
335
|
xml.tag! :CustomerProfileFromOrderInd, AUTO_GENERATE
|
|
@@ -317,21 +347,58 @@ module ActiveMerchant #:nodoc:
|
|
|
317
347
|
xml.tag! :SDMerchantEmail, soft_desc.merchant_email if soft_desc.merchant_email
|
|
318
348
|
end
|
|
319
349
|
|
|
350
|
+
def add_soft_descriptors_from_hash(xml, soft_desc)
|
|
351
|
+
xml.tag! :SDMerchantName, soft_desc[:merchant_name] || nil
|
|
352
|
+
xml.tag! :SDProductDescription, soft_desc[:product_description] || nil
|
|
353
|
+
xml.tag! :SDMerchantCity, soft_desc[:merchant_city] || nil
|
|
354
|
+
xml.tag! :SDMerchantPhone, soft_desc[:merchant_phone] || nil
|
|
355
|
+
xml.tag! :SDMerchantURL, soft_desc[:merchant_url] || nil
|
|
356
|
+
xml.tag! :SDMerchantEmail, soft_desc[:merchant_email] || nil
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
def add_level_2_tax(xml, options={})
|
|
360
|
+
if (level_2 = options[:level_2_data])
|
|
361
|
+
xml.tag! :TaxInd, level_2[:tax_indicator] if [TAX_NOT_PROVIDED, TAX_INCLUDED, NON_TAXABLE_TRANSACTION].include?(level_2[:tax_indicator].to_i)
|
|
362
|
+
xml.tag! :Tax, level_2[:tax].to_i if level_2[:tax]
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
def add_level_2_advice_addendum(xml, options={})
|
|
367
|
+
if (level_2 = options[:level_2_data])
|
|
368
|
+
xml.tag! :AMEXTranAdvAddn1, byte_limit(level_2[:advice_addendum_1], 40) if level_2[:advice_addendum_1]
|
|
369
|
+
xml.tag! :AMEXTranAdvAddn2, byte_limit(level_2[:advice_addendum_2], 40) if level_2[:advice_addendum_2]
|
|
370
|
+
xml.tag! :AMEXTranAdvAddn3, byte_limit(level_2[:advice_addendum_3], 40) if level_2[:advice_addendum_3]
|
|
371
|
+
xml.tag! :AMEXTranAdvAddn4, byte_limit(level_2[:advice_addendum_4], 40) if level_2[:advice_addendum_4]
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
def add_level_2_purchase(xml, options={})
|
|
376
|
+
if (level_2 = options[:level_2_data])
|
|
377
|
+
xml.tag! :PCOrderNum, byte_limit(level_2[:purchase_order], 17) if level_2[:purchase_order]
|
|
378
|
+
xml.tag! :PCDestZip, byte_limit(format_address_field(level_2[:zip]), 10) if level_2[:zip]
|
|
379
|
+
xml.tag! :PCDestName, byte_limit(format_address_field(level_2[:name]), 30) if level_2[:name]
|
|
380
|
+
xml.tag! :PCDestAddress1, byte_limit(format_address_field(level_2[:address1]), 30) if level_2[:address1]
|
|
381
|
+
xml.tag! :PCDestAddress2, byte_limit(format_address_field(level_2[:address2]), 30) if level_2[:address2]
|
|
382
|
+
xml.tag! :PCDestCity, byte_limit(format_address_field(level_2[:city]), 20) if level_2[:city]
|
|
383
|
+
xml.tag! :PCDestState, byte_limit(format_address_field(level_2[:state]), 2) if level_2[:state]
|
|
384
|
+
end
|
|
385
|
+
end
|
|
386
|
+
|
|
320
387
|
def add_address(xml, creditcard, options)
|
|
321
388
|
if(address = (options[:billing_address] || options[:address]))
|
|
322
|
-
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s)
|
|
389
|
+
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s) || empty?(address[:country])
|
|
323
390
|
|
|
324
391
|
if avs_supported
|
|
325
|
-
xml.tag! :AVSzip,
|
|
326
|
-
xml.tag! :AVSaddress1,
|
|
327
|
-
xml.tag! :AVSaddress2,
|
|
328
|
-
xml.tag! :AVScity,
|
|
329
|
-
xml.tag! :AVSstate,
|
|
330
|
-
xml.tag! :AVSphoneNum,
|
|
392
|
+
xml.tag! :AVSzip, byte_limit(format_address_field(address[:zip]), 10)
|
|
393
|
+
xml.tag! :AVSaddress1, byte_limit(format_address_field(address[:address1]), 30)
|
|
394
|
+
xml.tag! :AVSaddress2, byte_limit(format_address_field(address[:address2]), 30)
|
|
395
|
+
xml.tag! :AVScity, byte_limit(format_address_field(address[:city]), 20)
|
|
396
|
+
xml.tag! :AVSstate, byte_limit(format_address_field(address[:state]), 2)
|
|
397
|
+
xml.tag! :AVSphoneNum, (address[:phone] ? address[:phone].scan(/\d/).join.to_s[0..13] : nil)
|
|
331
398
|
end
|
|
332
|
-
|
|
333
|
-
xml.tag! :AVSname, (
|
|
334
|
-
xml.tag! :AVScountryCode, (avs_supported ? address[:country] : '')
|
|
399
|
+
|
|
400
|
+
xml.tag! :AVSname, (creditcard&.name ? creditcard.name[0..29] : nil)
|
|
401
|
+
xml.tag! :AVScountryCode, (avs_supported ? byte_limit(format_address_field(address[:country]), 2) : '')
|
|
335
402
|
|
|
336
403
|
# Needs to come after AVScountryCode
|
|
337
404
|
add_destination_address(xml, address) if avs_supported
|
|
@@ -340,29 +407,33 @@ module ActiveMerchant #:nodoc:
|
|
|
340
407
|
|
|
341
408
|
def add_destination_address(xml, address)
|
|
342
409
|
if address[:dest_zip]
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
xml.tag! :
|
|
346
|
-
xml.tag! :
|
|
347
|
-
xml.tag! :
|
|
410
|
+
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:dest_country].to_s)
|
|
411
|
+
|
|
412
|
+
xml.tag! :AVSDestzip, byte_limit(format_address_field(address[:dest_zip]), 10)
|
|
413
|
+
xml.tag! :AVSDestaddress1, byte_limit(format_address_field(address[:dest_address1]), 30)
|
|
414
|
+
xml.tag! :AVSDestaddress2, byte_limit(format_address_field(address[:dest_address2]), 30)
|
|
415
|
+
xml.tag! :AVSDestcity, byte_limit(format_address_field(address[:dest_city]), 20)
|
|
416
|
+
xml.tag! :AVSDeststate, byte_limit(format_address_field(address[:dest_state]), 2)
|
|
348
417
|
xml.tag! :AVSDestphoneNum, (address[:dest_phone] ? address[:dest_phone].scan(/\d/).join.to_s[0..13] : nil)
|
|
349
418
|
|
|
350
|
-
xml.tag! :AVSDestname, (address[:dest_name]
|
|
351
|
-
xml.tag! :AVSDestcountryCode, address[:dest_country]
|
|
419
|
+
xml.tag! :AVSDestname, byte_limit(address[:dest_name], 30)
|
|
420
|
+
xml.tag! :AVSDestcountryCode, (avs_supported ? address[:dest_country] : '')
|
|
352
421
|
end
|
|
353
422
|
end
|
|
354
423
|
|
|
355
424
|
# For Profile requests
|
|
356
425
|
def add_customer_address(xml, options)
|
|
357
426
|
if(address = (options[:billing_address] || options[:address]))
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
xml.tag! :
|
|
361
|
-
xml.tag! :
|
|
362
|
-
xml.tag! :
|
|
363
|
-
xml.tag! :
|
|
427
|
+
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s)
|
|
428
|
+
|
|
429
|
+
xml.tag! :CustomerAddress1, byte_limit(format_address_field(address[:address1]), 30)
|
|
430
|
+
xml.tag! :CustomerAddress2, byte_limit(format_address_field(address[:address2]), 30)
|
|
431
|
+
xml.tag! :CustomerCity, byte_limit(format_address_field(address[:city]), 20)
|
|
432
|
+
xml.tag! :CustomerState, byte_limit(format_address_field(address[:state]), 2)
|
|
433
|
+
xml.tag! :CustomerZIP, byte_limit(format_address_field(address[:zip]), 10)
|
|
434
|
+
xml.tag! :CustomerEmail, byte_limit(address[:email], 50) if address[:email]
|
|
364
435
|
xml.tag! :CustomerPhone, (address[:phone] ? address[:phone].scan(/\d/).join.to_s : nil)
|
|
365
|
-
xml.tag! :CustomerCountryCode, (
|
|
436
|
+
xml.tag! :CustomerCountryCode, (avs_supported ? address[:country] : '')
|
|
366
437
|
end
|
|
367
438
|
end
|
|
368
439
|
|
|
@@ -385,13 +456,25 @@ module ActiveMerchant #:nodoc:
|
|
|
385
456
|
# Do not submit the attribute at all.
|
|
386
457
|
# - http://download.chasepaymentech.com/docs/orbital/orbital_gateway_xml_specification.pdf
|
|
387
458
|
unless creditcard.nil?
|
|
388
|
-
if
|
|
389
|
-
|
|
459
|
+
if creditcard.verification_value?
|
|
460
|
+
if %w( visa discover ).include?(creditcard.brand)
|
|
461
|
+
xml.tag! :CardSecValInd, '1'
|
|
462
|
+
end
|
|
463
|
+
xml.tag! :CardSecVal, creditcard.verification_value
|
|
390
464
|
end
|
|
391
|
-
xml.tag! :CardSecVal, creditcard.verification_value if creditcard.verification_value?
|
|
392
465
|
end
|
|
393
466
|
end
|
|
394
467
|
|
|
468
|
+
def add_cdpt_eci_and_xid(xml, creditcard)
|
|
469
|
+
xml.tag! :AuthenticationECIInd, creditcard.eci
|
|
470
|
+
xml.tag! :XID, creditcard.transaction_id if creditcard.transaction_id
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
def add_cdpt_payment_cryptogram(xml, creditcard)
|
|
474
|
+
xml.tag! :DPANInd, 'Y'
|
|
475
|
+
xml.tag! :DigitalTokenCryptogram, creditcard.payment_cryptogram
|
|
476
|
+
end
|
|
477
|
+
|
|
395
478
|
def add_refund(xml, currency=nil)
|
|
396
479
|
xml.tag! :AccountNum, nil
|
|
397
480
|
|
|
@@ -401,6 +484,8 @@ module ActiveMerchant #:nodoc:
|
|
|
401
484
|
|
|
402
485
|
def add_managed_billing(xml, options)
|
|
403
486
|
if mb = options[:managed_billing]
|
|
487
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
488
|
+
|
|
404
489
|
# default to recurring (R). Other option is deferred (D).
|
|
405
490
|
xml.tag! :MBType, mb[:type] || RECURRING
|
|
406
491
|
# default to Customer Reference Number
|
|
@@ -424,29 +509,32 @@ module ActiveMerchant #:nodoc:
|
|
|
424
509
|
def parse(body)
|
|
425
510
|
response = {}
|
|
426
511
|
xml = REXML::Document.new(body)
|
|
427
|
-
root = REXML::XPath.first(xml,
|
|
428
|
-
REXML::XPath.first(xml,
|
|
512
|
+
root = REXML::XPath.first(xml, '//Response') ||
|
|
513
|
+
REXML::XPath.first(xml, '//ErrorResponse')
|
|
429
514
|
if root
|
|
430
515
|
root.elements.to_a.each do |node|
|
|
431
516
|
recurring_parse_element(response, node)
|
|
432
517
|
end
|
|
433
518
|
end
|
|
434
|
-
|
|
519
|
+
|
|
520
|
+
response.delete_if { |k, _| SENSITIVE_FIELDS.include?(k) }
|
|
435
521
|
end
|
|
436
522
|
|
|
437
523
|
def recurring_parse_element(response, node)
|
|
438
524
|
if node.has_elements?
|
|
439
|
-
node.elements.each{|e| recurring_parse_element(response, e) }
|
|
525
|
+
node.elements.each { |e| recurring_parse_element(response, e) }
|
|
440
526
|
else
|
|
441
527
|
response[node.name.underscore.to_sym] = node.text
|
|
442
528
|
end
|
|
443
529
|
end
|
|
444
530
|
|
|
445
531
|
def commit(order, message_type, trace_number=nil)
|
|
446
|
-
headers = POST_HEADERS.merge(
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
532
|
+
headers = POST_HEADERS.merge('Content-length' => order.size.to_s)
|
|
533
|
+
if @options[:retry_logic] && trace_number
|
|
534
|
+
headers['Trace-number'] = trace_number.to_s
|
|
535
|
+
headers['Merchant-Id'] = @options[:merchant_id]
|
|
536
|
+
end
|
|
537
|
+
request = ->(url) { parse(ssl_post(url, order, headers)) }
|
|
450
538
|
|
|
451
539
|
# Failover URL will be attempted in the event of a connection error
|
|
452
540
|
response = begin
|
|
@@ -492,7 +580,7 @@ module ActiveMerchant #:nodoc:
|
|
|
492
580
|
@options[:ip_authentication] == true
|
|
493
581
|
end
|
|
494
582
|
|
|
495
|
-
def build_new_order_xml(action, money, parameters = {})
|
|
583
|
+
def build_new_order_xml(action, money, creditcard, parameters = {})
|
|
496
584
|
requires!(parameters, :order_id)
|
|
497
585
|
xml = xml_envelope
|
|
498
586
|
xml.tag! :Request do
|
|
@@ -515,14 +603,27 @@ module ActiveMerchant #:nodoc:
|
|
|
515
603
|
|
|
516
604
|
yield xml if block_given?
|
|
517
605
|
|
|
606
|
+
if creditcard.is_a?(NetworkTokenizationCreditCard)
|
|
607
|
+
add_cdpt_eci_and_xid(xml, creditcard)
|
|
608
|
+
end
|
|
609
|
+
|
|
518
610
|
xml.tag! :OrderID, format_order_id(parameters[:order_id])
|
|
519
611
|
xml.tag! :Amount, amount(money)
|
|
520
612
|
xml.tag! :Comments, parameters[:comments] if parameters[:comments]
|
|
521
613
|
|
|
614
|
+
add_level_2_tax(xml, parameters)
|
|
615
|
+
add_level_2_advice_addendum(xml, parameters)
|
|
616
|
+
|
|
522
617
|
# CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
|
|
523
618
|
|
|
619
|
+
if creditcard.is_a?(NetworkTokenizationCreditCard)
|
|
620
|
+
add_cdpt_payment_cryptogram(xml, creditcard)
|
|
621
|
+
end
|
|
622
|
+
|
|
524
623
|
if parameters[:soft_descriptors].is_a?(OrbitalSoftDescriptors)
|
|
525
624
|
add_soft_descriptors(xml, parameters[:soft_descriptors])
|
|
625
|
+
elsif parameters[:soft_descriptors].is_a?(Hash)
|
|
626
|
+
add_soft_descriptors_from_hash(xml, parameters[:soft_descriptors])
|
|
526
627
|
end
|
|
527
628
|
|
|
528
629
|
set_recurring_ind(xml, parameters)
|
|
@@ -532,6 +633,8 @@ module ActiveMerchant #:nodoc:
|
|
|
532
633
|
tx_ref_num, _ = split_authorization(parameters[:authorization])
|
|
533
634
|
xml.tag! :TxRefNum, tx_ref_num
|
|
534
635
|
end
|
|
636
|
+
|
|
637
|
+
add_level_2_purchase(xml, parameters)
|
|
535
638
|
end
|
|
536
639
|
end
|
|
537
640
|
xml.target!
|
|
@@ -542,7 +645,7 @@ module ActiveMerchant #:nodoc:
|
|
|
542
645
|
# RS - Subsequent Recurring Transactions
|
|
543
646
|
def set_recurring_ind(xml, parameters)
|
|
544
647
|
if parameters[:recurring_ind]
|
|
545
|
-
raise
|
|
648
|
+
raise 'RecurringInd must be set to either "RF" or "RS"' unless %w(RF RS).include?(parameters[:recurring_ind])
|
|
546
649
|
xml.tag! :RecurringInd, parameters[:recurring_ind]
|
|
547
650
|
end
|
|
548
651
|
end
|
|
@@ -555,8 +658,11 @@ module ActiveMerchant #:nodoc:
|
|
|
555
658
|
add_xml_credentials(xml)
|
|
556
659
|
xml.tag! :OrderID, format_order_id(order_id)
|
|
557
660
|
xml.tag! :Amount, amount(money)
|
|
661
|
+
add_level_2_tax(xml, parameters)
|
|
558
662
|
add_bin_merchant_and_terminal(xml, parameters)
|
|
559
663
|
xml.tag! :TxRefNum, tx_ref_num
|
|
664
|
+
add_level_2_purchase(xml, parameters)
|
|
665
|
+
add_level_2_advice_addendum(xml, parameters)
|
|
560
666
|
end
|
|
561
667
|
end
|
|
562
668
|
xml.target!
|
|
@@ -625,13 +731,34 @@ module ActiveMerchant #:nodoc:
|
|
|
625
731
|
# 2. - , $ @ & and a space character, though the space character cannot be the leading character
|
|
626
732
|
# 3. PINless Debit transactions can only use uppercase and lowercase alpha (A-Z, a-z) and numeric (0-9)
|
|
627
733
|
def format_order_id(order_id)
|
|
628
|
-
illegal_characters = /[
|
|
734
|
+
illegal_characters = /[^,$@&\- \w]/
|
|
629
735
|
order_id = order_id.to_s.gsub(/\./, '-')
|
|
630
736
|
order_id.gsub!(illegal_characters, '')
|
|
737
|
+
order_id.lstrip!
|
|
631
738
|
order_id[0...22]
|
|
632
739
|
end
|
|
633
740
|
|
|
741
|
+
# Address-related fields cannot contain % | ^ \ /
|
|
742
|
+
# Returns the value with these characters removed, or nil
|
|
743
|
+
def format_address_field(value)
|
|
744
|
+
value.gsub(/[%\|\^\\\/]/, '') if value.respond_to?(:gsub)
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
# Field lengths should be limited by byte count instead of character count
|
|
748
|
+
# Returns the truncated value or nil
|
|
749
|
+
def byte_limit(value, byte_length)
|
|
750
|
+
limited_value = ''
|
|
751
|
+
|
|
752
|
+
value.to_s.each_char do |c|
|
|
753
|
+
break if((limited_value.bytesize + c.bytesize) > byte_length)
|
|
754
|
+
limited_value << c
|
|
755
|
+
end
|
|
756
|
+
|
|
757
|
+
limited_value
|
|
758
|
+
end
|
|
759
|
+
|
|
634
760
|
def build_customer_request_xml(creditcard, options = {})
|
|
761
|
+
ActiveMerchant.deprecated 'Customer Profile support in Orbital is non-conformant to the ActiveMerchant API and will be removed in its current form in a future version. Please contact the ActiveMerchant maintainers if you have an interest in modifying it to conform to the store/unstore/update API.'
|
|
635
762
|
xml = xml_envelope
|
|
636
763
|
xml.tag! :Request do
|
|
637
764
|
xml.tag! :Profile do
|
|
@@ -668,7 +795,7 @@ module ActiveMerchant #:nodoc:
|
|
|
668
795
|
end
|
|
669
796
|
|
|
670
797
|
xml.tag! :CCAccountNum, creditcard.number if creditcard
|
|
671
|
-
xml.tag! :CCExpireDate, creditcard.expiry_date.expiration.strftime(
|
|
798
|
+
xml.tag! :CCExpireDate, creditcard.expiry_date.expiration.strftime('%m%y') if creditcard
|
|
672
799
|
|
|
673
800
|
# This has to come after CCExpireDate.
|
|
674
801
|
add_managed_billing(xml, options)
|
|
@@ -676,6 +803,123 @@ module ActiveMerchant #:nodoc:
|
|
|
676
803
|
end
|
|
677
804
|
xml.target!
|
|
678
805
|
end
|
|
806
|
+
|
|
807
|
+
# Unfortunately, Orbital uses their own special codes for AVS responses
|
|
808
|
+
# that are different than the standard codes defined in
|
|
809
|
+
# <tt>ActiveMerchant::Billing::AVSResult</tt>.
|
|
810
|
+
#
|
|
811
|
+
# This class encapsulates the response codes shown on page 240 of their spec:
|
|
812
|
+
# http://download.chasepaymentech.com/docs/orbital/orbital_gateway_xml_specification.pdf
|
|
813
|
+
#
|
|
814
|
+
class AVSResult < ActiveMerchant::Billing::AVSResult
|
|
815
|
+
CODES = {
|
|
816
|
+
'1' => 'No address supplied',
|
|
817
|
+
'2' => 'Bill-to address did not pass Auth Host edit checks',
|
|
818
|
+
'3' => 'AVS not performed',
|
|
819
|
+
'4' => 'Issuer does not participate in AVS',
|
|
820
|
+
'5' => 'Edit-error - AVS data is invalid',
|
|
821
|
+
'6' => 'System unavailable or time-out',
|
|
822
|
+
'7' => 'Address information unavailable',
|
|
823
|
+
'8' => 'Transaction Ineligible for AVS',
|
|
824
|
+
'9' => 'Zip Match/Zip 4 Match/Locale match',
|
|
825
|
+
'A' => 'Zip Match/Zip 4 Match/Locale no match',
|
|
826
|
+
'B' => 'Zip Match/Zip 4 no Match/Locale match',
|
|
827
|
+
'C' => 'Zip Match/Zip 4 no Match/Locale no match',
|
|
828
|
+
'D' => 'Zip No Match/Zip 4 Match/Locale match',
|
|
829
|
+
'E' => 'Zip No Match/Zip 4 Match/Locale no match',
|
|
830
|
+
'F' => 'Zip No Match/Zip 4 No Match/Locale match',
|
|
831
|
+
'G' => 'No match at all',
|
|
832
|
+
'H' => 'Zip Match/Locale match',
|
|
833
|
+
'J' => 'Issuer does not participate in Global AVS',
|
|
834
|
+
'JA' => 'International street address and postal match',
|
|
835
|
+
'JB' => 'International street address match. Postal code not verified',
|
|
836
|
+
'JC' => 'International street address and postal code not verified',
|
|
837
|
+
'JD' => 'International postal code match. Street address not verified',
|
|
838
|
+
'M1' => 'Cardholder name matches',
|
|
839
|
+
'M2' => 'Cardholder name, billing address, and postal code matches',
|
|
840
|
+
'M3' => 'Cardholder name and billing code matches',
|
|
841
|
+
'M4' => 'Cardholder name and billing address match',
|
|
842
|
+
'M5' => 'Cardholder name incorrect, billing address and postal code match',
|
|
843
|
+
'M6' => 'Cardholder name incorrect, billing postal code matches',
|
|
844
|
+
'M7' => 'Cardholder name incorrect, billing address matches',
|
|
845
|
+
'M8' => 'Cardholder name, billing address and postal code are all incorrect',
|
|
846
|
+
'N3' => 'Address matches, ZIP not verified',
|
|
847
|
+
'N4' => 'Address and ZIP code not verified due to incompatible formats',
|
|
848
|
+
'N5' => 'Address and ZIP code match (International only)',
|
|
849
|
+
'N6' => 'Address not verified (International only)',
|
|
850
|
+
'N7' => 'ZIP matches, address not verified',
|
|
851
|
+
'N8' => 'Address and ZIP code match (International only)',
|
|
852
|
+
'N9' => 'Address and ZIP code match (UK only)',
|
|
853
|
+
'R' => 'Issuer does not participate in AVS',
|
|
854
|
+
'UK' => 'Unknown',
|
|
855
|
+
'X' => 'Zip Match/Zip 4 Match/Address Match',
|
|
856
|
+
'Z' => 'Zip Match/Locale no match',
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
# Map vendor's AVS result code to a postal match code
|
|
860
|
+
ORBITAL_POSTAL_MATCH_CODE = {
|
|
861
|
+
'Y' => %w( 9 A B C H JA JD M2 M3 M5 N5 N8 N9 X Z ),
|
|
862
|
+
'N' => %w( D E F G M8 ),
|
|
863
|
+
'X' => %w( 4 J R ),
|
|
864
|
+
nil => %w( 1 2 3 5 6 7 8 JB JC M1 M4 M6 M7 N3 N4 N6 N7 UK )
|
|
865
|
+
}.inject({}) do |map, (type, codes)|
|
|
866
|
+
codes.each { |code| map[code] = type }
|
|
867
|
+
map
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
# Map vendor's AVS result code to a street match code
|
|
871
|
+
ORBITAL_STREET_MATCH_CODE = {
|
|
872
|
+
'Y' => %w( 9 B D F H JA JB M2 M4 M5 M6 M7 N3 N5 N7 N8 N9 X ),
|
|
873
|
+
'N' => %w( A C E G M8 Z ),
|
|
874
|
+
'X' => %w( 4 J R ),
|
|
875
|
+
nil => %w( 1 2 3 5 6 7 8 JC JD M1 M3 N4 N6 UK )
|
|
876
|
+
}.inject({}) do |map, (type, codes)|
|
|
877
|
+
codes.each { |code| map[code] = type }
|
|
878
|
+
map
|
|
879
|
+
end
|
|
880
|
+
|
|
881
|
+
def self.messages
|
|
882
|
+
CODES
|
|
883
|
+
end
|
|
884
|
+
|
|
885
|
+
def initialize(code)
|
|
886
|
+
@code = (code.blank? ? nil : code.to_s.strip.upcase)
|
|
887
|
+
if @code
|
|
888
|
+
@message = CODES[@code]
|
|
889
|
+
@postal_match = ORBITAL_POSTAL_MATCH_CODE[@code]
|
|
890
|
+
@street_match = ORBITAL_STREET_MATCH_CODE[@code]
|
|
891
|
+
end
|
|
892
|
+
end
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
# Unfortunately, Orbital uses their own special codes for CVV responses
|
|
896
|
+
# that are different than the standard codes defined in
|
|
897
|
+
# <tt>ActiveMerchant::Billing::CVVResult</tt>.
|
|
898
|
+
#
|
|
899
|
+
# This class encapsulates the response codes shown on page 255 of their spec:
|
|
900
|
+
# http://download.chasepaymentech.com/docs/orbital/orbital_gateway_xml_specification.pdf
|
|
901
|
+
#
|
|
902
|
+
class CVVResult < ActiveMerchant::Billing::CVVResult
|
|
903
|
+
MESSAGES = {
|
|
904
|
+
'M' => 'Match',
|
|
905
|
+
'N' => 'No match',
|
|
906
|
+
'P' => 'Not processed',
|
|
907
|
+
'S' => 'Should have been present',
|
|
908
|
+
'U' => 'Unsupported by issuer/Issuer unable to process request',
|
|
909
|
+
'I' => 'Invalid',
|
|
910
|
+
'Y' => 'Invalid',
|
|
911
|
+
'' => 'Not applicable'
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
def self.messages
|
|
915
|
+
MESSAGES
|
|
916
|
+
end
|
|
917
|
+
|
|
918
|
+
def initialize(code)
|
|
919
|
+
@code = code.blank? ? '' : code.upcase
|
|
920
|
+
@message = MESSAGES[@code]
|
|
921
|
+
end
|
|
922
|
+
end
|
|
679
923
|
end
|
|
680
924
|
end
|
|
681
925
|
end
|