activemerchant 1.38.0 → 1.78.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1344 -3
- data/CONTRIBUTORS +154 -0
- data/README.md +157 -144
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/base.rb +21 -17
- data/lib/active_merchant/billing/check.rb +32 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +215 -67
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +149 -52
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +170 -24
- data/lib/active_merchant/billing/gateways/adyen.rb +284 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +899 -606
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +43 -18
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +134 -346
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +13 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +325 -0
- data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +96 -15
- data/lib/active_merchant/billing/gateways/beanstream.rb +52 -9
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -8
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -501
- data/lib/active_merchant/billing/gateways/blue_snap.rb +343 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +94 -50
- data/lib/active_merchant/billing/gateways/borgun.rb +222 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +14 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +372 -137
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +245 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +269 -118
- data/lib/active_merchant/billing/gateways/cardknox.rb +328 -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 +45 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +239 -0
- 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 +226 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +23 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +222 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +224 -0
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +345 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +228 -98
- data/lib/active_merchant/billing/gateways/data_cash.rb +41 -314
- data/lib/active_merchant/billing/gateways/dibs.rb +205 -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 +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +143 -142
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +23 -12
- data/lib/active_merchant/billing/gateways/eway.rb +12 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +417 -204
- data/lib/active_merchant/billing/gateways/exact.rb +10 -1
- data/lib/active_merchant/billing/gateways/ezic.rb +196 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +65 -37
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +109 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +155 -29
- 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 +256 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +11 -5
- data/lib/active_merchant/billing/gateways/global_collect.rb +334 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- 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/ideal/ideal_base.rb +2 -5
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +1 -1
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -10
- data/lib/active_merchant/billing/gateways/instapay.rb +0 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +210 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +176 -49
- 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 +227 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +17 -13
- data/lib/active_merchant/billing/gateways/litle.rb +329 -439
- data/lib/active_merchant/billing/gateways/mastercard.rb +268 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +15 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -15
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +24 -13
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +74 -29
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -21
- data/lib/active_merchant/billing/gateways/micropayment.rb +185 -0
- data/lib/active_merchant/billing/gateways/migs.rb +74 -13
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -3
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +119 -36
- data/lib/active_merchant/billing/gateways/moneris_us.rb +146 -45
- data/lib/active_merchant/billing/gateways/money_movers.rb +152 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +78 -53
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +289 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +61 -26
- data/lib/active_merchant/billing/gateways/netpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/network_merchants.rb +242 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +265 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +85 -27
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +227 -0
- data/lib/active_merchant/billing/gateways/opp.rb +372 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +59 -28
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -56
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +207 -0
- data/lib/active_merchant/billing/gateways/pagarme.rb +248 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +246 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -14
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +19 -25
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +16 -12
- data/lib/active_merchant/billing/gateways/payeezy.rb +386 -0
- data/lib/active_merchant/billing/gateways/payex.rb +412 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +38 -17
- data/lib/active_merchant/billing/gateways/payflow.rb +100 -19
- data/lib/active_merchant/billing/gateways/payflow_express.rb +22 -22
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +6 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +15 -3
- data/lib/active_merchant/billing/gateways/paymentez.rb +283 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +41 -8
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +18 -4
- data/lib/active_merchant/billing/gateways/paypal.rb +49 -20
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +6 -5
- 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 +162 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +22 -24
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +440 -0
- data/lib/active_merchant/billing/gateways/pin.rb +68 -13
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +3 -14
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +299 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -319
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +27 -25
- data/lib/active_merchant/billing/gateways/redsys.rb +212 -80
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +258 -0
- data/lib/active_merchant/billing/gateways/sage.rb +412 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +176 -59
- data/lib/active_merchant/billing/gateways/secure_net.rb +35 -29
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -9
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +21 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/securion_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +13 -2
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +36 -11
- data/lib/active_merchant/billing/gateways/stripe.rb +461 -82
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +156 -0
- data/lib/active_merchant/billing/gateways/telr.rb +275 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +142 -28
- 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/transnational.rb +2 -231
- data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +17 -11
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +193 -75
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +150 -63
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -15
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +209 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +45 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +238 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +167 -49
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +131 -36
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +218 -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 +24 -17
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +177 -0
- data/lib/active_merchant/country.rb +334 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/network_connection_retries.rb +79 -0
- data/lib/active_merchant/post_data.rb +24 -0
- data/lib/active_merchant/posts_data.rb +84 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +24 -21
- data/lib/certs/cacert.pem +3951 -0
- data/lib/support/gateway_support.rb +16 -10
- data/lib/support/outbound_hosts.rb +13 -10
- metadata +161 -306
- data/gem-public_cert.pem +0 -20
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -155
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- 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 -73
- 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/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/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/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 -114
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -95
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -19
- 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 -129
- 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/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 -28
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -165
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -43
- 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 -74
- 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 -91
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -139
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -17
- 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/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 -0
@@ -1,5 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require File.dirname(__FILE__) + '/orbital/avs_result'
|
1
|
+
require 'active_merchant/billing/gateways/orbital/orbital_soft_descriptors'
|
3
2
|
require "rexml/document"
|
4
3
|
|
5
4
|
module ActiveMerchant #:nodoc:
|
@@ -29,26 +28,48 @@ module ActiveMerchant #:nodoc:
|
|
29
28
|
# Company will automatically be affiliated.
|
30
29
|
|
31
30
|
class OrbitalGateway < Gateway
|
32
|
-
|
31
|
+
include Empty
|
32
|
+
|
33
|
+
API_VERSION = "7.1"
|
33
34
|
|
34
35
|
POST_HEADERS = {
|
35
36
|
"MIME-Version" => "1.1",
|
36
|
-
"Content-Type" => "application/
|
37
|
+
"Content-Type" => "application/PTI#{API_VERSION.gsub(/\./, '')}",
|
37
38
|
"Content-transfer-encoding" => "text",
|
38
39
|
"Request-number" => '1',
|
39
40
|
"Document-type" => "Request",
|
40
41
|
"Interface-Version" => "Ruby|ActiveMerchant|Proprietary Gateway"
|
41
42
|
}
|
42
43
|
|
43
|
-
SUCCESS
|
44
|
+
SUCCESS = '0'
|
45
|
+
|
46
|
+
APPROVED = [
|
47
|
+
'00', # Approved
|
48
|
+
'08', # Approved authorization, honor with ID
|
49
|
+
'11', # Approved authorization, VIP approval
|
50
|
+
'24', # Validated
|
51
|
+
'26', # Pre-noted
|
52
|
+
'27', # No reason to decline
|
53
|
+
'28', # Received and stored
|
54
|
+
'29', # Provided authorization
|
55
|
+
'31', # Request received
|
56
|
+
'32', # BIN alert
|
57
|
+
'34', # Approved for partial
|
58
|
+
'91', # Approved low fraud
|
59
|
+
'92', # Approved medium fraud
|
60
|
+
'93', # Approved high fraud
|
61
|
+
'94', # Approved fraud service unavailable
|
62
|
+
'E7', # Stored
|
63
|
+
'PA' # Partial approval
|
64
|
+
]
|
44
65
|
|
45
66
|
class_attribute :secondary_test_url, :secondary_live_url
|
46
67
|
|
47
|
-
self.test_url = "https://orbitalvar1.
|
48
|
-
self.secondary_test_url = "https://orbitalvar2.
|
68
|
+
self.test_url = "https://orbitalvar1.chasepaymentech.com/authorize"
|
69
|
+
self.secondary_test_url = "https://orbitalvar2.chasepaymentech.com/authorize"
|
49
70
|
|
50
|
-
self.live_url = "https://orbital1.
|
51
|
-
self.secondary_live_url = "https://orbital2.
|
71
|
+
self.live_url = "https://orbital1.chasepaymentech.com/authorize"
|
72
|
+
self.secondary_live_url = "https://orbital2.chasepaymentech.com/authorize"
|
52
73
|
|
53
74
|
self.supported_countries = ["US", "CA"]
|
54
75
|
self.default_currency = "CAD"
|
@@ -63,7 +84,9 @@ module ActiveMerchant #:nodoc:
|
|
63
84
|
|
64
85
|
CURRENCY_CODES = {
|
65
86
|
"AUD" => '036',
|
87
|
+
"BRL" => '986',
|
66
88
|
"CAD" => '124',
|
89
|
+
"CLP" => '152',
|
67
90
|
"CZK" => '203',
|
68
91
|
"DKK" => '208',
|
69
92
|
"HKD" => '344',
|
@@ -80,6 +103,27 @@ module ActiveMerchant #:nodoc:
|
|
80
103
|
"EUR" => '978'
|
81
104
|
}
|
82
105
|
|
106
|
+
CURRENCY_EXPONENTS = {
|
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'
|
125
|
+
}
|
126
|
+
|
83
127
|
# INDUSTRY TYPES
|
84
128
|
ECOMMERCE_TRANSACTION = 'EC'
|
85
129
|
RECURRING_PAYMENT_TRANSACTION = 'RC'
|
@@ -137,6 +181,8 @@ module ActiveMerchant #:nodoc:
|
|
137
181
|
USE_ORDER_ID = 'O' # Use OrderID field
|
138
182
|
USE_COMMENTS = 'D' # Use Comments field
|
139
183
|
|
184
|
+
SENSITIVE_FIELDS = [:account_num, :cc_account_num]
|
185
|
+
|
140
186
|
def initialize(options = {})
|
141
187
|
requires!(options, :merchant_id)
|
142
188
|
requires!(options, :login, :password) unless options[:ip_authentication]
|
@@ -145,24 +191,31 @@ module ActiveMerchant #:nodoc:
|
|
145
191
|
|
146
192
|
# A – Authorization request
|
147
193
|
def authorize(money, creditcard, options = {})
|
148
|
-
order = build_new_order_xml(AUTH_ONLY, money, options) do |xml|
|
149
|
-
add_creditcard(xml, creditcard, options[:currency])
|
194
|
+
order = build_new_order_xml(AUTH_ONLY, money, creditcard, options) do |xml|
|
195
|
+
add_creditcard(xml, creditcard, options[:currency])
|
150
196
|
add_address(xml, creditcard, options)
|
151
197
|
if @options[:customer_profiles]
|
152
|
-
add_customer_data(xml, options)
|
198
|
+
add_customer_data(xml, creditcard, options)
|
153
199
|
add_managed_billing(xml, options)
|
154
200
|
end
|
155
201
|
end
|
156
202
|
commit(order, :authorize, options[:trace_number])
|
157
203
|
end
|
158
204
|
|
205
|
+
def verify(creditcard, options = {})
|
206
|
+
MultiResponse.run(:use_first_response) do |r|
|
207
|
+
r.process { authorize(100, creditcard, options) }
|
208
|
+
r.process(:ignore_result) { void(r.authorization) }
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
159
212
|
# AC – Authorization and Capture
|
160
213
|
def purchase(money, creditcard, options = {})
|
161
|
-
order = build_new_order_xml(AUTH_AND_CAPTURE, money, options) do |xml|
|
162
|
-
add_creditcard(xml, creditcard, options[:currency])
|
214
|
+
order = build_new_order_xml(AUTH_AND_CAPTURE, money, creditcard, options) do |xml|
|
215
|
+
add_creditcard(xml, creditcard, options[:currency])
|
163
216
|
add_address(xml, creditcard, options)
|
164
217
|
if @options[:customer_profiles]
|
165
|
-
add_customer_data(xml, options)
|
218
|
+
add_customer_data(xml, creditcard, options)
|
166
219
|
add_managed_billing(xml, options)
|
167
220
|
end
|
168
221
|
end
|
@@ -176,7 +229,7 @@ module ActiveMerchant #:nodoc:
|
|
176
229
|
|
177
230
|
# R – Refund request
|
178
231
|
def refund(money, authorization, options = {})
|
179
|
-
order = build_new_order_xml(REFUND, money, options.merge(:authorization => authorization)) do |xml|
|
232
|
+
order = build_new_order_xml(REFUND, money, nil, options.merge(:authorization => authorization)) do |xml|
|
180
233
|
add_refund(xml, options[:currency])
|
181
234
|
xml.tag! :CustomerRefNum, options[:customer_ref_num] if @options[:customer_profiles] && options[:profile_txn]
|
182
235
|
end
|
@@ -184,13 +237,13 @@ module ActiveMerchant #:nodoc:
|
|
184
237
|
end
|
185
238
|
|
186
239
|
def credit(money, authorization, options= {})
|
187
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
240
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
188
241
|
refund(money, authorization, options)
|
189
242
|
end
|
190
243
|
|
191
244
|
def void(authorization, options = {}, deprecated = {})
|
192
245
|
if(!options.kind_of?(Hash))
|
193
|
-
deprecated("Calling the void method with an amount parameter is deprecated and will be removed in a future version.")
|
246
|
+
ActiveMerchant.deprecated("Calling the void method with an amount parameter is deprecated and will be removed in a future version.")
|
194
247
|
return void(options, deprecated.merge(:amount => authorization))
|
195
248
|
end
|
196
249
|
|
@@ -200,7 +253,7 @@ module ActiveMerchant #:nodoc:
|
|
200
253
|
|
201
254
|
|
202
255
|
# ==== Customer Profiles
|
203
|
-
# :customer_ref_num should be set unless
|
256
|
+
# :customer_ref_num should be set unless you're happy with Orbital providing one
|
204
257
|
#
|
205
258
|
# :customer_profile_order_override_ind can be set to map
|
206
259
|
# the CustomerRefNum to OrderID or Comments. Defaults to 'NO' - no mapping
|
@@ -244,6 +297,21 @@ module ActiveMerchant #:nodoc:
|
|
244
297
|
commit(order, :delete_customer_profile)
|
245
298
|
end
|
246
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
|
+
|
247
315
|
private
|
248
316
|
|
249
317
|
def authorization_string(*args)
|
@@ -254,12 +322,14 @@ module ActiveMerchant #:nodoc:
|
|
254
322
|
authorization.split(';')
|
255
323
|
end
|
256
324
|
|
257
|
-
def add_customer_data(xml, options)
|
325
|
+
def add_customer_data(xml, creditcard, options)
|
258
326
|
if options[:profile_txn]
|
259
327
|
xml.tag! :CustomerRefNum, options[:customer_ref_num]
|
260
328
|
else
|
261
329
|
if options[:customer_ref_num]
|
262
|
-
|
330
|
+
if creditcard
|
331
|
+
xml.tag! :CustomerProfileFromOrderInd, USE_CUSTOMER_REF_NUM
|
332
|
+
end
|
263
333
|
xml.tag! :CustomerRefNum, options[:customer_ref_num]
|
264
334
|
else
|
265
335
|
xml.tag! :CustomerProfileFromOrderInd, AUTO_GENERATE
|
@@ -277,21 +347,58 @@ module ActiveMerchant #:nodoc:
|
|
277
347
|
xml.tag! :SDMerchantEmail, soft_desc.merchant_email if soft_desc.merchant_email
|
278
348
|
end
|
279
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
|
+
|
280
387
|
def add_address(xml, creditcard, options)
|
281
388
|
if(address = (options[:billing_address] || options[:address]))
|
282
|
-
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s)
|
389
|
+
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s) || empty?(address[:country])
|
283
390
|
|
284
391
|
if avs_supported
|
285
|
-
xml.tag! :AVSzip,
|
286
|
-
xml.tag! :AVSaddress1,
|
287
|
-
xml.tag! :AVSaddress2,
|
288
|
-
xml.tag! :AVScity,
|
289
|
-
xml.tag! :AVSstate,
|
290
|
-
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)
|
291
398
|
end
|
292
|
-
|
399
|
+
|
293
400
|
xml.tag! :AVSname, ((creditcard && creditcard.name) ? creditcard.name[0..29] : nil)
|
294
|
-
xml.tag! :AVScountryCode, (avs_supported ? address[:country] : '')
|
401
|
+
xml.tag! :AVScountryCode, (avs_supported ? (byte_limit(format_address_field(address[:country]), 2)) : '')
|
295
402
|
|
296
403
|
# Needs to come after AVScountryCode
|
297
404
|
add_destination_address(xml, address) if avs_supported
|
@@ -300,38 +407,44 @@ module ActiveMerchant #:nodoc:
|
|
300
407
|
|
301
408
|
def add_destination_address(xml, address)
|
302
409
|
if address[:dest_zip]
|
303
|
-
|
304
|
-
|
305
|
-
xml.tag! :
|
306
|
-
xml.tag! :
|
307
|
-
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)
|
308
417
|
xml.tag! :AVSDestphoneNum, (address[:dest_phone] ? address[:dest_phone].scan(/\d/).join.to_s[0..13] : nil)
|
309
418
|
|
310
|
-
xml.tag! :AVSDestname, (address[:dest_name]
|
311
|
-
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] : '')
|
312
421
|
end
|
313
422
|
end
|
314
423
|
|
315
424
|
# For Profile requests
|
316
425
|
def add_customer_address(xml, options)
|
317
426
|
if(address = (options[:billing_address] || options[:address]))
|
318
|
-
|
319
|
-
|
320
|
-
xml.tag! :
|
321
|
-
xml.tag! :
|
322
|
-
xml.tag! :
|
323
|
-
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]
|
324
435
|
xml.tag! :CustomerPhone, (address[:phone] ? address[:phone].scan(/\d/).join.to_s : nil)
|
325
|
-
xml.tag! :CustomerCountryCode, (
|
436
|
+
xml.tag! :CustomerCountryCode, (avs_supported ? address[:country] : '')
|
326
437
|
end
|
327
438
|
end
|
328
439
|
|
329
440
|
def add_creditcard(xml, creditcard, currency=nil)
|
330
|
-
|
331
|
-
|
441
|
+
unless creditcard.nil?
|
442
|
+
xml.tag! :AccountNum, creditcard.number
|
443
|
+
xml.tag! :Exp, expiry_date(creditcard)
|
444
|
+
end
|
332
445
|
|
333
446
|
xml.tag! :CurrencyCode, currency_code(currency)
|
334
|
-
xml.tag! :CurrencyExponent,
|
447
|
+
xml.tag! :CurrencyExponent, currency_exponents(currency)
|
335
448
|
|
336
449
|
# If you are trying to collect a Card Verification Number
|
337
450
|
# (CardSecVal) for a Visa or Discover transaction, pass one of these values:
|
@@ -342,21 +455,37 @@ module ActiveMerchant #:nodoc:
|
|
342
455
|
# Null-fill this attribute OR
|
343
456
|
# Do not submit the attribute at all.
|
344
457
|
# - http://download.chasepaymentech.com/docs/orbital/orbital_gateway_xml_specification.pdf
|
345
|
-
|
346
|
-
|
458
|
+
unless creditcard.nil?
|
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
|
464
|
+
end
|
347
465
|
end
|
348
|
-
|
466
|
+
end
|
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
|
349
476
|
end
|
350
477
|
|
351
478
|
def add_refund(xml, currency=nil)
|
352
479
|
xml.tag! :AccountNum, nil
|
353
480
|
|
354
481
|
xml.tag! :CurrencyCode, currency_code(currency)
|
355
|
-
xml.tag! :CurrencyExponent,
|
482
|
+
xml.tag! :CurrencyExponent, currency_exponents(currency)
|
356
483
|
end
|
357
484
|
|
358
485
|
def add_managed_billing(xml, options)
|
359
486
|
if mb = options[:managed_billing]
|
487
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
488
|
+
|
360
489
|
# default to recurring (R). Other option is deferred (D).
|
361
490
|
xml.tag! :MBType, mb[:type] || RECURRING
|
362
491
|
# default to Customer Reference Number
|
@@ -387,7 +516,8 @@ module ActiveMerchant #:nodoc:
|
|
387
516
|
recurring_parse_element(response, node)
|
388
517
|
end
|
389
518
|
end
|
390
|
-
|
519
|
+
|
520
|
+
response.delete_if { |k,_| SENSITIVE_FIELDS.include?(k) }
|
391
521
|
end
|
392
522
|
|
393
523
|
def recurring_parse_element(response, node)
|
@@ -416,7 +546,7 @@ module ActiveMerchant #:nodoc:
|
|
416
546
|
:authorization => authorization_string(response[:tx_ref_num], response[:order_id]),
|
417
547
|
:test => self.test?,
|
418
548
|
:avs_result => OrbitalGateway::AVSResult.new(response[:avs_resp_code]),
|
419
|
-
:cvv_result => response[:cvv2_resp_code]
|
549
|
+
:cvv_result => OrbitalGateway::CVVResult.new(response[:cvv2_resp_code])
|
420
550
|
}
|
421
551
|
)
|
422
552
|
end
|
@@ -436,7 +566,7 @@ module ActiveMerchant #:nodoc:
|
|
436
566
|
response[:profile_proc_status] == SUCCESS
|
437
567
|
else
|
438
568
|
response[:proc_status] == SUCCESS &&
|
439
|
-
response[:resp_code]
|
569
|
+
APPROVED.include?(response[:resp_code])
|
440
570
|
end
|
441
571
|
end
|
442
572
|
|
@@ -448,7 +578,7 @@ module ActiveMerchant #:nodoc:
|
|
448
578
|
@options[:ip_authentication] == true
|
449
579
|
end
|
450
580
|
|
451
|
-
def build_new_order_xml(action, money, parameters = {})
|
581
|
+
def build_new_order_xml(action, money, creditcard, parameters = {})
|
452
582
|
requires!(parameters, :order_id)
|
453
583
|
xml = xml_envelope
|
454
584
|
xml.tag! :Request do
|
@@ -471,14 +601,27 @@ module ActiveMerchant #:nodoc:
|
|
471
601
|
|
472
602
|
yield xml if block_given?
|
473
603
|
|
604
|
+
if creditcard.is_a?(NetworkTokenizationCreditCard)
|
605
|
+
add_cdpt_eci_and_xid(xml, creditcard)
|
606
|
+
end
|
607
|
+
|
474
608
|
xml.tag! :OrderID, format_order_id(parameters[:order_id])
|
475
609
|
xml.tag! :Amount, amount(money)
|
476
610
|
xml.tag! :Comments, parameters[:comments] if parameters[:comments]
|
477
611
|
|
612
|
+
add_level_2_tax(xml, parameters)
|
613
|
+
add_level_2_advice_addendum(xml, parameters)
|
614
|
+
|
478
615
|
# CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
|
479
616
|
|
617
|
+
if creditcard.is_a?(NetworkTokenizationCreditCard)
|
618
|
+
add_cdpt_payment_cryptogram(xml, creditcard)
|
619
|
+
end
|
620
|
+
|
480
621
|
if parameters[:soft_descriptors].is_a?(OrbitalSoftDescriptors)
|
481
622
|
add_soft_descriptors(xml, parameters[:soft_descriptors])
|
623
|
+
elsif parameters[:soft_descriptors].is_a?(Hash)
|
624
|
+
add_soft_descriptors_from_hash(xml, parameters[:soft_descriptors])
|
482
625
|
end
|
483
626
|
|
484
627
|
set_recurring_ind(xml, parameters)
|
@@ -488,6 +631,8 @@ module ActiveMerchant #:nodoc:
|
|
488
631
|
tx_ref_num, _ = split_authorization(parameters[:authorization])
|
489
632
|
xml.tag! :TxRefNum, tx_ref_num
|
490
633
|
end
|
634
|
+
|
635
|
+
add_level_2_purchase(xml, parameters)
|
491
636
|
end
|
492
637
|
end
|
493
638
|
xml.target!
|
@@ -511,8 +656,11 @@ module ActiveMerchant #:nodoc:
|
|
511
656
|
add_xml_credentials(xml)
|
512
657
|
xml.tag! :OrderID, format_order_id(order_id)
|
513
658
|
xml.tag! :Amount, amount(money)
|
659
|
+
add_level_2_tax(xml, parameters)
|
514
660
|
add_bin_merchant_and_terminal(xml, parameters)
|
515
661
|
xml.tag! :TxRefNum, tx_ref_num
|
662
|
+
add_level_2_purchase(xml, parameters)
|
663
|
+
add_level_2_advice_addendum(xml, parameters)
|
516
664
|
end
|
517
665
|
end
|
518
666
|
xml.target!
|
@@ -540,6 +688,10 @@ module ActiveMerchant #:nodoc:
|
|
540
688
|
CURRENCY_CODES[(currency || self.default_currency)].to_s
|
541
689
|
end
|
542
690
|
|
691
|
+
def currency_exponents(currency)
|
692
|
+
CURRENCY_EXPONENTS[(currency || self.default_currency)].to_s
|
693
|
+
end
|
694
|
+
|
543
695
|
def expiry_date(credit_card)
|
544
696
|
"#{format(credit_card.month, :two_digits)}#{format(credit_card.year, :two_digits)}"
|
545
697
|
end
|
@@ -577,13 +729,34 @@ module ActiveMerchant #:nodoc:
|
|
577
729
|
# 2. - , $ @ & and a space character, though the space character cannot be the leading character
|
578
730
|
# 3. PINless Debit transactions can only use uppercase and lowercase alpha (A-Z, a-z) and numeric (0-9)
|
579
731
|
def format_order_id(order_id)
|
580
|
-
illegal_characters = /[
|
732
|
+
illegal_characters = /[^,$@&\- \w]/
|
581
733
|
order_id = order_id.to_s.gsub(/\./, '-')
|
582
734
|
order_id.gsub!(illegal_characters, '')
|
735
|
+
order_id.lstrip!
|
583
736
|
order_id[0...22]
|
584
737
|
end
|
585
738
|
|
739
|
+
# Address-related fields cannot contain % | ^ \ /
|
740
|
+
# Returns the value with these characters removed, or nil
|
741
|
+
def format_address_field(value)
|
742
|
+
value.gsub(/[%\|\^\\\/]/, '') if value.respond_to?(:gsub)
|
743
|
+
end
|
744
|
+
|
745
|
+
# Field lengths should be limited by byte count instead of character count
|
746
|
+
# Returns the truncated value or nil
|
747
|
+
def byte_limit(value, byte_length)
|
748
|
+
limited_value = ""
|
749
|
+
|
750
|
+
value.to_s.each_char do |c|
|
751
|
+
break if((limited_value.bytesize + c.bytesize) > byte_length)
|
752
|
+
limited_value << c
|
753
|
+
end
|
754
|
+
|
755
|
+
limited_value
|
756
|
+
end
|
757
|
+
|
586
758
|
def build_customer_request_xml(creditcard, options = {})
|
759
|
+
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."
|
587
760
|
xml = xml_envelope
|
588
761
|
xml.tag! :Request do
|
589
762
|
xml.tag! :Profile do
|
@@ -628,6 +801,123 @@ module ActiveMerchant #:nodoc:
|
|
628
801
|
end
|
629
802
|
xml.target!
|
630
803
|
end
|
804
|
+
|
805
|
+
# Unfortunately, Orbital uses their own special codes for AVS responses
|
806
|
+
# that are different than the standard codes defined in
|
807
|
+
# <tt>ActiveMerchant::Billing::AVSResult</tt>.
|
808
|
+
#
|
809
|
+
# This class encapsulates the response codes shown on page 240 of their spec:
|
810
|
+
# http://download.chasepaymentech.com/docs/orbital/orbital_gateway_xml_specification.pdf
|
811
|
+
#
|
812
|
+
class AVSResult < ActiveMerchant::Billing::AVSResult
|
813
|
+
CODES = {
|
814
|
+
'1' => 'No address supplied',
|
815
|
+
'2' => 'Bill-to address did not pass Auth Host edit checks',
|
816
|
+
'3' => 'AVS not performed',
|
817
|
+
'4' => 'Issuer does not participate in AVS',
|
818
|
+
'5' => 'Edit-error - AVS data is invalid',
|
819
|
+
'6' => 'System unavailable or time-out',
|
820
|
+
'7' => 'Address information unavailable',
|
821
|
+
'8' => 'Transaction Ineligible for AVS',
|
822
|
+
'9' => 'Zip Match/Zip 4 Match/Locale match',
|
823
|
+
'A' => 'Zip Match/Zip 4 Match/Locale no match',
|
824
|
+
'B' => 'Zip Match/Zip 4 no Match/Locale match',
|
825
|
+
'C' => 'Zip Match/Zip 4 no Match/Locale no match',
|
826
|
+
'D' => 'Zip No Match/Zip 4 Match/Locale match',
|
827
|
+
'E' => 'Zip No Match/Zip 4 Match/Locale no match',
|
828
|
+
'F' => 'Zip No Match/Zip 4 No Match/Locale match',
|
829
|
+
'G' => 'No match at all',
|
830
|
+
'H' => 'Zip Match/Locale match',
|
831
|
+
'J' => 'Issuer does not participate in Global AVS',
|
832
|
+
'JA' => 'International street address and postal match',
|
833
|
+
'JB' => 'International street address match. Postal code not verified',
|
834
|
+
'JC' => 'International street address and postal code not verified',
|
835
|
+
'JD' => 'International postal code match. Street address not verified',
|
836
|
+
'M1' => 'Cardholder name matches',
|
837
|
+
'M2' => 'Cardholder name, billing address, and postal code matches',
|
838
|
+
'M3' => 'Cardholder name and billing code matches',
|
839
|
+
'M4' => 'Cardholder name and billing address match',
|
840
|
+
'M5' => 'Cardholder name incorrect, billing address and postal code match',
|
841
|
+
'M6' => 'Cardholder name incorrect, billing postal code matches',
|
842
|
+
'M7' => 'Cardholder name incorrect, billing address matches',
|
843
|
+
'M8' => 'Cardholder name, billing address and postal code are all incorrect',
|
844
|
+
'N3' => 'Address matches, ZIP not verified',
|
845
|
+
'N4' => 'Address and ZIP code not verified due to incompatible formats',
|
846
|
+
'N5' => 'Address and ZIP code match (International only)',
|
847
|
+
'N6' => 'Address not verified (International only)',
|
848
|
+
'N7' => 'ZIP matches, address not verified',
|
849
|
+
'N8' => 'Address and ZIP code match (International only)',
|
850
|
+
'N9' => 'Address and ZIP code match (UK only)',
|
851
|
+
'R' => 'Issuer does not participate in AVS',
|
852
|
+
'UK' => 'Unknown',
|
853
|
+
'X' => 'Zip Match/Zip 4 Match/Address Match',
|
854
|
+
'Z' => 'Zip Match/Locale no match',
|
855
|
+
}
|
856
|
+
|
857
|
+
# Map vendor's AVS result code to a postal match code
|
858
|
+
ORBITAL_POSTAL_MATCH_CODE = {
|
859
|
+
'Y' => %w( 9 A B C H JA JD M2 M3 M5 N5 N8 N9 X Z ),
|
860
|
+
'N' => %w( D E F G M8 ),
|
861
|
+
'X' => %w( 4 J R ),
|
862
|
+
nil => %w( 1 2 3 5 6 7 8 JB JC M1 M4 M6 M7 N3 N4 N6 N7 UK )
|
863
|
+
}.inject({}) do |map, (type, codes)|
|
864
|
+
codes.each { |code| map[code] = type }
|
865
|
+
map
|
866
|
+
end
|
867
|
+
|
868
|
+
# Map vendor's AVS result code to a street match code
|
869
|
+
ORBITAL_STREET_MATCH_CODE = {
|
870
|
+
'Y' => %w( 9 B D F H JA JB M2 M4 M5 M6 M7 N3 N5 N7 N8 N9 X ),
|
871
|
+
'N' => %w( A C E G M8 Z ),
|
872
|
+
'X' => %w( 4 J R ),
|
873
|
+
nil => %w( 1 2 3 5 6 7 8 JC JD M1 M3 N4 N6 UK )
|
874
|
+
}.inject({}) do |map, (type, codes)|
|
875
|
+
codes.each { |code| map[code] = type }
|
876
|
+
map
|
877
|
+
end
|
878
|
+
|
879
|
+
def self.messages
|
880
|
+
CODES
|
881
|
+
end
|
882
|
+
|
883
|
+
def initialize(code)
|
884
|
+
@code = (code.blank? ? nil : code.to_s.strip.upcase)
|
885
|
+
if @code
|
886
|
+
@message = CODES[@code]
|
887
|
+
@postal_match = ORBITAL_POSTAL_MATCH_CODE[@code]
|
888
|
+
@street_match = ORBITAL_STREET_MATCH_CODE[@code]
|
889
|
+
end
|
890
|
+
end
|
891
|
+
end
|
892
|
+
|
893
|
+
# Unfortunately, Orbital uses their own special codes for CVV responses
|
894
|
+
# that are different than the standard codes defined in
|
895
|
+
# <tt>ActiveMerchant::Billing::CVVResult</tt>.
|
896
|
+
#
|
897
|
+
# This class encapsulates the response codes shown on page 255 of their spec:
|
898
|
+
# http://download.chasepaymentech.com/docs/orbital/orbital_gateway_xml_specification.pdf
|
899
|
+
#
|
900
|
+
class CVVResult < ActiveMerchant::Billing::CVVResult
|
901
|
+
MESSAGES = {
|
902
|
+
'M' => 'Match',
|
903
|
+
'N' => 'No match',
|
904
|
+
'P' => 'Not processed',
|
905
|
+
'S' => 'Should have been present',
|
906
|
+
'U' => 'Unsupported by issuer/Issuer unable to process request',
|
907
|
+
'I' => 'Invalid',
|
908
|
+
'Y' => 'Invalid',
|
909
|
+
'' => 'Not applicable'
|
910
|
+
}
|
911
|
+
|
912
|
+
def self.messages
|
913
|
+
MESSAGES
|
914
|
+
end
|
915
|
+
|
916
|
+
def initialize(code)
|
917
|
+
@code = code.blank? ? '' : code.upcase
|
918
|
+
@message = MESSAGES[@code]
|
919
|
+
end
|
920
|
+
end
|
631
921
|
end
|
632
922
|
end
|
633
923
|
end
|