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
|
@@ -2,26 +2,26 @@ module ActiveMerchant #:nodoc:
|
|
|
2
2
|
module Billing #:nodoc:
|
|
3
3
|
class MerchantWareVersionFourGateway < Gateway
|
|
4
4
|
self.live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
|
5
|
-
self.test_url = 'https://
|
|
5
|
+
self.test_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
|
6
6
|
|
|
7
7
|
self.supported_countries = ['US']
|
|
8
8
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
|
9
9
|
self.homepage_url = 'http://merchantwarehouse.com/merchantware'
|
|
10
10
|
self.display_name = 'MerchantWARE'
|
|
11
11
|
|
|
12
|
-
ENV_NAMESPACES = {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
ENV_NAMESPACES = { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
|
13
|
+
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
|
14
|
+
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' }
|
|
15
15
|
|
|
16
|
-
TX_NAMESPACE =
|
|
16
|
+
TX_NAMESPACE = 'http://schemas.merchantwarehouse.com/merchantware/40/Credit/'
|
|
17
17
|
|
|
18
18
|
ACTIONS = {
|
|
19
|
-
:purchase =>
|
|
19
|
+
:purchase => 'SaleKeyed',
|
|
20
20
|
:reference_purchase => 'RepeatSale',
|
|
21
|
-
:authorize =>
|
|
22
|
-
:capture =>
|
|
23
|
-
:void =>
|
|
24
|
-
:refund =>
|
|
21
|
+
:authorize => 'PreAuthorizationKeyed',
|
|
22
|
+
:capture => 'PostAuthorization',
|
|
23
|
+
:void => 'Void',
|
|
24
|
+
:refund => 'Refund'
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
# Creates a new MerchantWareVersionFourGateway
|
|
@@ -102,23 +102,41 @@ module ActiveMerchant #:nodoc:
|
|
|
102
102
|
request = soap_request(:refund) do |xml|
|
|
103
103
|
add_reference_token(xml, reference)
|
|
104
104
|
add_invoice(xml, options)
|
|
105
|
-
add_amount(xml, money,
|
|
105
|
+
add_amount(xml, money, 'overrideAmount')
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
commit(:refund, request)
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
+
def verify(credit_card, options={})
|
|
112
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
113
|
+
r.process { authorize(100, credit_card, options) }
|
|
114
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def supports_scrubbing?
|
|
119
|
+
true
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def scrub(transcript)
|
|
123
|
+
transcript.
|
|
124
|
+
gsub(%r((<merchantKey>).+?(</merchantKey>))i, '\1[FILTERED]\2').
|
|
125
|
+
gsub(%r((<cardNumber>).+?(</cardNumber>))i, '\1[FILTERED]\2').
|
|
126
|
+
gsub(%r((<cardSecurityCode>).+?(</cardSecurityCode>))i, '\1[FILTERED]\2')
|
|
127
|
+
end
|
|
128
|
+
|
|
111
129
|
private
|
|
112
130
|
|
|
113
131
|
def soap_request(action)
|
|
114
132
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
115
133
|
xml.instruct!
|
|
116
|
-
xml.tag!
|
|
117
|
-
xml.tag!
|
|
118
|
-
xml.tag! ACTIONS[action],
|
|
119
|
-
xml.tag!
|
|
120
|
-
xml.tag!
|
|
121
|
-
xml.tag!
|
|
134
|
+
xml.tag! 'soap:Envelope', ENV_NAMESPACES do
|
|
135
|
+
xml.tag! 'soap:Body' do
|
|
136
|
+
xml.tag! ACTIONS[action], 'xmlns' => TX_NAMESPACE do
|
|
137
|
+
xml.tag! 'merchantName', @options[:name]
|
|
138
|
+
xml.tag! 'merchantSiteId', @options[:login]
|
|
139
|
+
xml.tag! 'merchantKey', @options[:password]
|
|
122
140
|
yield xml
|
|
123
141
|
end
|
|
124
142
|
end
|
|
@@ -129,7 +147,7 @@ module ActiveMerchant #:nodoc:
|
|
|
129
147
|
def build_purchase_request(action, money, payment_source, options)
|
|
130
148
|
requires!(options, :order_id)
|
|
131
149
|
|
|
132
|
-
|
|
150
|
+
soap_request(action) do |xml|
|
|
133
151
|
add_invoice(xml, options)
|
|
134
152
|
add_amount(xml, money)
|
|
135
153
|
add_payment_source(xml, payment_source)
|
|
@@ -140,36 +158,29 @@ module ActiveMerchant #:nodoc:
|
|
|
140
158
|
def build_capture_request(action, money, identification, options)
|
|
141
159
|
reference, options[:order_id] = split_reference(identification)
|
|
142
160
|
|
|
143
|
-
|
|
161
|
+
soap_request(action) do |xml|
|
|
144
162
|
add_reference_token(xml, reference)
|
|
145
163
|
add_invoice(xml, options)
|
|
146
164
|
add_amount(xml, money)
|
|
147
165
|
end
|
|
148
166
|
end
|
|
149
167
|
|
|
150
|
-
def expdate(credit_card)
|
|
151
|
-
year = sprintf("%.4i", credit_card.year)
|
|
152
|
-
month = sprintf("%.2i", credit_card.month)
|
|
153
|
-
|
|
154
|
-
"#{month}#{year[-2..-1]}"
|
|
155
|
-
end
|
|
156
|
-
|
|
157
168
|
def add_invoice(xml, options)
|
|
158
|
-
xml.tag!
|
|
169
|
+
xml.tag! 'invoiceNumber', truncate(options[:order_id].to_s.gsub(/[^\w]/, ''), 8)
|
|
159
170
|
end
|
|
160
171
|
|
|
161
|
-
def add_amount(xml, money, tag =
|
|
172
|
+
def add_amount(xml, money, tag = 'amount')
|
|
162
173
|
xml.tag! tag, amount(money)
|
|
163
174
|
end
|
|
164
175
|
|
|
165
176
|
def add_reference_token(xml, reference)
|
|
166
|
-
xml.tag!
|
|
177
|
+
xml.tag! 'token', reference
|
|
167
178
|
end
|
|
168
179
|
|
|
169
180
|
def add_address(xml, options)
|
|
170
181
|
address = options[:billing_address] || options[:address] || {}
|
|
171
|
-
xml.tag!
|
|
172
|
-
xml.tag!
|
|
182
|
+
xml.tag! 'avsStreetAddress', address[:address1]
|
|
183
|
+
xml.tag! 'avsStreetZipCode', address[:zip]
|
|
173
184
|
end
|
|
174
185
|
|
|
175
186
|
def add_payment_source(xml, source)
|
|
@@ -181,14 +192,14 @@ module ActiveMerchant #:nodoc:
|
|
|
181
192
|
end
|
|
182
193
|
|
|
183
194
|
def add_credit_card(xml, credit_card)
|
|
184
|
-
xml.tag!
|
|
185
|
-
xml.tag!
|
|
186
|
-
xml.tag!
|
|
187
|
-
xml.tag!
|
|
195
|
+
xml.tag! 'cardNumber', credit_card.number
|
|
196
|
+
xml.tag! 'expirationDate', expdate(credit_card)
|
|
197
|
+
xml.tag! 'cardholder', credit_card.name
|
|
198
|
+
xml.tag! 'cardSecurityCode', credit_card.verification_value if credit_card.verification_value?
|
|
188
199
|
end
|
|
189
200
|
|
|
190
201
|
def split_reference(reference)
|
|
191
|
-
reference.to_s.split(
|
|
202
|
+
reference.to_s.split(';')
|
|
192
203
|
end
|
|
193
204
|
|
|
194
205
|
def parse(action, data)
|
|
@@ -201,14 +212,14 @@ module ActiveMerchant #:nodoc:
|
|
|
201
212
|
response[element.name] = element.text
|
|
202
213
|
end
|
|
203
214
|
|
|
204
|
-
if response[
|
|
205
|
-
response[:message] = response[
|
|
215
|
+
if response['ErrorMessage'].present?
|
|
216
|
+
response[:message] = response['ErrorMessage']
|
|
206
217
|
response[:success] = false
|
|
207
218
|
else
|
|
208
|
-
status, code, message = response[
|
|
219
|
+
status, code, message = response['ApprovalStatus'].split(';')
|
|
209
220
|
response[:status] = status
|
|
210
221
|
|
|
211
|
-
if response[:success] = status ==
|
|
222
|
+
if response[:success] = status == 'APPROVED'
|
|
212
223
|
response[:message] = status
|
|
213
224
|
else
|
|
214
225
|
response[:message] = message
|
|
@@ -232,11 +243,11 @@ module ActiveMerchant #:nodoc:
|
|
|
232
243
|
response[element.name] = element.text
|
|
233
244
|
end
|
|
234
245
|
|
|
235
|
-
response[:message] = response[
|
|
246
|
+
response[:message] = response['ErrorMessage'].to_s.gsub("\n", ' ')
|
|
236
247
|
response
|
|
237
|
-
rescue REXML::ParseException
|
|
248
|
+
rescue REXML::ParseException
|
|
238
249
|
response[:http_body] = http_response.body
|
|
239
|
-
response[:message] =
|
|
250
|
+
response[:message] = 'Failed to parse the failed response'
|
|
240
251
|
response
|
|
241
252
|
end
|
|
242
253
|
|
|
@@ -251,9 +262,9 @@ module ActiveMerchant #:nodoc:
|
|
|
251
262
|
def commit(action, request)
|
|
252
263
|
begin
|
|
253
264
|
data = ssl_post(url, request,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
265
|
+
'Content-Type' => 'text/xml; charset=utf-8',
|
|
266
|
+
'SOAPAction' => soap_action(action)
|
|
267
|
+
)
|
|
257
268
|
response = parse(action, data)
|
|
258
269
|
rescue ActiveMerchant::ResponseError => e
|
|
259
270
|
response = parse_error(e.response, action)
|
|
@@ -262,8 +273,8 @@ module ActiveMerchant #:nodoc:
|
|
|
262
273
|
Response.new(response[:success], response[:message], response,
|
|
263
274
|
:test => test?,
|
|
264
275
|
:authorization => authorization_from(response),
|
|
265
|
-
:avs_result => { :code => response[
|
|
266
|
-
:cvv_result => response[
|
|
276
|
+
:avs_result => { :code => response['AvsResponse'] },
|
|
277
|
+
:cvv_result => response['CvResponse']
|
|
267
278
|
)
|
|
268
279
|
end
|
|
269
280
|
|
|
@@ -12,9 +12,9 @@ module ActiveMerchant #:nodoc:
|
|
|
12
12
|
|
|
13
13
|
self.supported_countries = ['AU']
|
|
14
14
|
self.supported_cardtypes = [:visa, :master, :american_express,
|
|
15
|
-
:diners_club, :discover]
|
|
16
|
-
self.homepage_url = '
|
|
17
|
-
self.display_name = '
|
|
15
|
+
:diners_club, :discover, :jcb]
|
|
16
|
+
self.homepage_url = 'https://www.merchantwarrior.com/'
|
|
17
|
+
self.display_name = 'Merchant Warrior'
|
|
18
18
|
|
|
19
19
|
self.money_format = :dollars
|
|
20
20
|
self.default_currency = 'AUD'
|
|
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
|
|
|
27
27
|
def authorize(money, payment_method, options = {})
|
|
28
28
|
post = {}
|
|
29
29
|
add_amount(post, money, options)
|
|
30
|
-
|
|
30
|
+
add_order_id(post, options)
|
|
31
31
|
add_address(post, options)
|
|
32
32
|
add_payment_method(post, payment_method)
|
|
33
33
|
commit('processAuth', post)
|
|
@@ -36,21 +36,21 @@ module ActiveMerchant #:nodoc:
|
|
|
36
36
|
def purchase(money, payment_method, options = {})
|
|
37
37
|
post = {}
|
|
38
38
|
add_amount(post, money, options)
|
|
39
|
-
|
|
39
|
+
add_order_id(post, options)
|
|
40
40
|
add_address(post, options)
|
|
41
41
|
add_payment_method(post, payment_method)
|
|
42
42
|
commit('processCard', post)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
def capture(money, identification)
|
|
45
|
+
def capture(money, identification, options = {})
|
|
46
46
|
post = {}
|
|
47
47
|
add_amount(post, money, options)
|
|
48
48
|
add_transaction(post, identification)
|
|
49
|
-
post
|
|
49
|
+
post['captureAmount'] = amount(money)
|
|
50
50
|
commit('processCapture', post)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
def refund(money, identification)
|
|
53
|
+
def refund(money, identification, options = {})
|
|
54
54
|
post = {}
|
|
55
55
|
add_amount(post, money, options)
|
|
56
56
|
add_transaction(post, identification)
|
|
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
|
|
|
60
60
|
|
|
61
61
|
def store(creditcard, options = {})
|
|
62
62
|
post = {
|
|
63
|
-
'cardName' => creditcard.name,
|
|
63
|
+
'cardName' => scrub_name(creditcard.name),
|
|
64
64
|
'cardNumber' => creditcard.number,
|
|
65
65
|
'cardExpiryMonth' => format(creditcard.month, :two_digits),
|
|
66
66
|
'cardExpiryYear' => format(creditcard.year, :two_digits)
|
|
@@ -68,6 +68,18 @@ module ActiveMerchant #:nodoc:
|
|
|
68
68
|
commit('addCard', post)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
def supports_scrubbing?
|
|
72
|
+
true
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def scrub(transcript)
|
|
76
|
+
transcript.
|
|
77
|
+
gsub(%r((&?paymentCardNumber=)[^&]*)i, '\1[FILTERED]').
|
|
78
|
+
gsub(%r((CardNumber=)[^&]*)i, '\1[FILTERED]').
|
|
79
|
+
gsub(%r((&?paymentCardCSC=)[^&]*)i, '\1[FILTERED]').
|
|
80
|
+
gsub(%r((&?apiKey=)[^&]*)i, '\1[FILTERED]')
|
|
81
|
+
end
|
|
82
|
+
|
|
71
83
|
private
|
|
72
84
|
|
|
73
85
|
def add_transaction(post, identification)
|
|
@@ -77,16 +89,19 @@ module ActiveMerchant #:nodoc:
|
|
|
77
89
|
def add_address(post, options)
|
|
78
90
|
return unless(address = (options[:billing_address] || options[:address]))
|
|
79
91
|
|
|
80
|
-
post['customerName'] = address[:name]
|
|
92
|
+
post['customerName'] = scrub_name(address[:name])
|
|
81
93
|
post['customerCountry'] = address[:country]
|
|
82
|
-
post['customerState'] = address[:state]
|
|
94
|
+
post['customerState'] = address[:state] || 'N/A'
|
|
83
95
|
post['customerCity'] = address[:city]
|
|
84
96
|
post['customerAddress'] = address[:address1]
|
|
85
97
|
post['customerPostCode'] = address[:zip]
|
|
98
|
+
post['customerIP'] = address[:ip]
|
|
99
|
+
post['customerPhone'] = address[:phone]
|
|
100
|
+
post['customerEmail'] = address[:email]
|
|
86
101
|
end
|
|
87
102
|
|
|
88
|
-
def
|
|
89
|
-
post['transactionProduct'] = options[:
|
|
103
|
+
def add_order_id(post, options)
|
|
104
|
+
post['transactionProduct'] = truncate(options[:order_id], 34) || SecureRandom.hex(15)
|
|
90
105
|
end
|
|
91
106
|
|
|
92
107
|
def add_payment_method(post, payment_method)
|
|
@@ -103,11 +118,15 @@ module ActiveMerchant #:nodoc:
|
|
|
103
118
|
|
|
104
119
|
def add_creditcard(post, creditcard)
|
|
105
120
|
post['paymentCardNumber'] = creditcard.number
|
|
106
|
-
post['paymentCardName'] = creditcard.name
|
|
107
|
-
post['paymentCardExpiry'] = creditcard.expiry_date.expiration.strftime(
|
|
121
|
+
post['paymentCardName'] = scrub_name(creditcard.name)
|
|
122
|
+
post['paymentCardExpiry'] = creditcard.expiry_date.expiration.strftime('%m%y')
|
|
108
123
|
post['paymentCardCSC'] = creditcard.verification_value if creditcard.verification_value?
|
|
109
124
|
end
|
|
110
125
|
|
|
126
|
+
def scrub_name(name)
|
|
127
|
+
name.gsub(/[^a-zA-Z\. -]/, '')
|
|
128
|
+
end
|
|
129
|
+
|
|
111
130
|
def add_amount(post, money, options)
|
|
112
131
|
currency = (options[:currency] || currency(money))
|
|
113
132
|
|
|
@@ -139,7 +158,7 @@ module ActiveMerchant #:nodoc:
|
|
|
139
158
|
|
|
140
159
|
def parse_element(response, node)
|
|
141
160
|
if node.has_elements?
|
|
142
|
-
node.elements.each{|element| parse_element(response, element)}
|
|
161
|
+
node.elements.each { |element| parse_element(response, element) }
|
|
143
162
|
else
|
|
144
163
|
response[node.name.underscore.to_sym] = node.text
|
|
145
164
|
end
|
|
@@ -169,14 +188,14 @@ module ActiveMerchant #:nodoc:
|
|
|
169
188
|
|
|
170
189
|
def url_for(action, post)
|
|
171
190
|
if token?(post)
|
|
172
|
-
[(test? ? TOKEN_TEST_URL : TOKEN_LIVE_URL), action].join(
|
|
191
|
+
[(test? ? TOKEN_TEST_URL : TOKEN_LIVE_URL), action].join('/')
|
|
173
192
|
else
|
|
174
193
|
(test? ? POST_TEST_URL : POST_LIVE_URL)
|
|
175
194
|
end
|
|
176
195
|
end
|
|
177
196
|
|
|
178
197
|
def token?(post)
|
|
179
|
-
(post[
|
|
198
|
+
(post['cardID'] || post['cardName'])
|
|
180
199
|
end
|
|
181
200
|
|
|
182
201
|
def success?(response)
|
|
@@ -184,7 +203,7 @@ module ActiveMerchant #:nodoc:
|
|
|
184
203
|
end
|
|
185
204
|
|
|
186
205
|
def post_data(post)
|
|
187
|
-
post.collect{|k,v| "#{k}=#{CGI.escape(v.to_s)}" }.join(
|
|
206
|
+
post.collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
|
188
207
|
end
|
|
189
208
|
end
|
|
190
209
|
end
|
|
@@ -12,16 +12,22 @@ module ActiveMerchant #:nodoc:
|
|
|
12
12
|
# and +refund+ will become mandatory.
|
|
13
13
|
class MercuryGateway < Gateway
|
|
14
14
|
URLS = {
|
|
15
|
-
:test => 'https://w1.
|
|
15
|
+
:test => 'https://w1.mercurycert.net/ws/ws.asmx',
|
|
16
16
|
:live => 'https://w1.mercurypay.com/ws/ws.asmx'
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
self.homepage_url = 'http://www.mercurypay.com'
|
|
20
20
|
self.display_name = 'Mercury'
|
|
21
|
-
self.supported_countries = ['US']
|
|
21
|
+
self.supported_countries = ['US', 'CA']
|
|
22
22
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
|
|
23
23
|
self.default_currency = 'USD'
|
|
24
24
|
|
|
25
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
|
26
|
+
'100204' => STANDARD_ERROR_CODE[:invalid_number],
|
|
27
|
+
'100205' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
|
28
|
+
'000000' => STANDARD_ERROR_CODE[:card_declined]
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
def initialize(options = {})
|
|
26
32
|
requires!(options, :login, :password)
|
|
27
33
|
@use_tokenization = (!options.has_key?(:tokenization) || options[:tokenization])
|
|
@@ -66,13 +72,6 @@ module ActiveMerchant #:nodoc:
|
|
|
66
72
|
def void(authorization, options={})
|
|
67
73
|
requires!(options, :credit_card) unless @use_tokenization
|
|
68
74
|
|
|
69
|
-
if options[:try_reversal]
|
|
70
|
-
request = build_authorized_request('VoidSale', nil, authorization, options[:credit_card], options.merge(:reversal => true))
|
|
71
|
-
response = commit('VoidSale', request)
|
|
72
|
-
|
|
73
|
-
return response if response.success?
|
|
74
|
-
end
|
|
75
|
-
|
|
76
75
|
request = build_authorized_request('VoidSale', nil, authorization, options[:credit_card], options)
|
|
77
76
|
commit('VoidSale', request)
|
|
78
77
|
end
|
|
@@ -82,24 +81,37 @@ module ActiveMerchant #:nodoc:
|
|
|
82
81
|
commit('CardLookup', request)
|
|
83
82
|
end
|
|
84
83
|
|
|
84
|
+
def supports_scrubbing?
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def scrub(transcript)
|
|
89
|
+
transcript.
|
|
90
|
+
gsub(%r(<), '<').
|
|
91
|
+
gsub(%r(>), '>').
|
|
92
|
+
gsub(%r((<pw>).*(</pw>))i, '\1[FILTERED]\2').
|
|
93
|
+
gsub(%r((<AcctNo>)(\d|x)*(</AcctNo>))i, '\1[FILTERED]\3').
|
|
94
|
+
gsub(%r((<CVVData>)\d*(</CVVData>))i, '\1[FILTERED]\2')
|
|
95
|
+
end
|
|
96
|
+
|
|
85
97
|
private
|
|
86
98
|
|
|
87
99
|
def build_non_authorized_request(action, money, credit_card, options)
|
|
88
100
|
xml = Builder::XmlMarkup.new
|
|
89
101
|
|
|
90
|
-
xml.tag!
|
|
91
|
-
xml.tag!
|
|
102
|
+
xml.tag! 'TStream' do
|
|
103
|
+
xml.tag! 'Transaction' do
|
|
92
104
|
xml.tag! 'TranType', 'Credit'
|
|
93
105
|
xml.tag! 'TranCode', action
|
|
94
|
-
if
|
|
95
|
-
xml.tag!
|
|
106
|
+
if options[:allow_partial_auth] && ['PreAuth', 'Sale'].include?(action)
|
|
107
|
+
xml.tag! 'PartialAuth', 'Allow'
|
|
96
108
|
end
|
|
97
109
|
add_invoice(xml, options[:order_id], nil, options)
|
|
98
|
-
add_reference(xml,
|
|
110
|
+
add_reference(xml, 'RecordNumberRequested')
|
|
99
111
|
add_customer_data(xml, options)
|
|
100
112
|
add_amount(xml, money, options)
|
|
101
113
|
add_credit_card(xml, credit_card, action)
|
|
102
|
-
add_address(xml, options)
|
|
114
|
+
add_address(xml, options) unless credit_card.track_data.present?
|
|
103
115
|
end
|
|
104
116
|
end
|
|
105
117
|
xml = xml.target!
|
|
@@ -109,15 +121,15 @@ module ActiveMerchant #:nodoc:
|
|
|
109
121
|
xml = Builder::XmlMarkup.new
|
|
110
122
|
|
|
111
123
|
invoice_no, ref_no, auth_code, acq_ref_data, process_data, record_no, amount = split_authorization(authorization)
|
|
112
|
-
ref_no =
|
|
124
|
+
ref_no = '1' if ref_no.blank?
|
|
113
125
|
|
|
114
|
-
xml.tag!
|
|
115
|
-
xml.tag!
|
|
126
|
+
xml.tag! 'TStream' do
|
|
127
|
+
xml.tag! 'Transaction' do
|
|
116
128
|
xml.tag! 'TranType', 'Credit'
|
|
117
|
-
if action == 'PreAuthCapture'
|
|
118
|
-
xml.tag!
|
|
129
|
+
if options[:allow_partial_auth] && (action == 'PreAuthCapture')
|
|
130
|
+
xml.tag! 'PartialAuth', 'Allow'
|
|
119
131
|
end
|
|
120
|
-
xml.tag! 'TranCode', (@use_tokenization ? (action +
|
|
132
|
+
xml.tag! 'TranCode', (@use_tokenization ? (action + 'ByRecordNo') : action)
|
|
121
133
|
add_invoice(xml, invoice_no, ref_no, options)
|
|
122
134
|
add_reference(xml, record_no)
|
|
123
135
|
add_customer_data(xml, options)
|
|
@@ -125,9 +137,9 @@ module ActiveMerchant #:nodoc:
|
|
|
125
137
|
add_credit_card(xml, credit_card, action) if credit_card
|
|
126
138
|
add_address(xml, options)
|
|
127
139
|
xml.tag! 'TranInfo' do
|
|
128
|
-
xml.tag!
|
|
129
|
-
xml.tag!
|
|
130
|
-
xml.tag!
|
|
140
|
+
xml.tag! 'AuthCode', auth_code
|
|
141
|
+
xml.tag! 'AcqRefData', acq_ref_data
|
|
142
|
+
xml.tag! 'ProcessData', process_data
|
|
131
143
|
end
|
|
132
144
|
end
|
|
133
145
|
end
|
|
@@ -137,8 +149,8 @@ module ActiveMerchant #:nodoc:
|
|
|
137
149
|
def build_card_lookup_request(credit_card, options)
|
|
138
150
|
xml = Builder::XmlMarkup.new
|
|
139
151
|
|
|
140
|
-
xml.tag!
|
|
141
|
-
xml.tag!
|
|
152
|
+
xml.tag! 'TStream' do
|
|
153
|
+
xml.tag! 'Transaction' do
|
|
142
154
|
xml.tag! 'TranType', 'CardLookup'
|
|
143
155
|
xml.tag! 'RecordNo', 'RecordNumberRequested'
|
|
144
156
|
xml.tag! 'Frequency', 'OneTime'
|
|
@@ -152,10 +164,6 @@ module ActiveMerchant #:nodoc:
|
|
|
152
164
|
end
|
|
153
165
|
|
|
154
166
|
def add_invoice(xml, invoice_no, ref_no, options)
|
|
155
|
-
if /^\d+$/ !~ invoice_no.to_s
|
|
156
|
-
raise ArgumentError.new("order_id '#{invoice_no}' is not numeric as required by Mercury")
|
|
157
|
-
end
|
|
158
|
-
|
|
159
167
|
xml.tag! 'InvoiceNo', invoice_no
|
|
160
168
|
xml.tag! 'RefNo', (ref_no || invoice_no)
|
|
161
169
|
xml.tag! 'OperatorID', options[:merchant] if options[:merchant]
|
|
@@ -164,15 +172,15 @@ module ActiveMerchant #:nodoc:
|
|
|
164
172
|
|
|
165
173
|
def add_reference(xml, record_no)
|
|
166
174
|
if @use_tokenization
|
|
167
|
-
xml.tag!
|
|
168
|
-
xml.tag!
|
|
175
|
+
xml.tag! 'Frequency', 'OneTime'
|
|
176
|
+
xml.tag! 'RecordNo', record_no
|
|
169
177
|
end
|
|
170
178
|
end
|
|
171
179
|
|
|
172
180
|
def add_customer_data(xml, options)
|
|
173
181
|
xml.tag! 'IpAddress', options[:ip] if options[:ip]
|
|
174
182
|
if options[:customer]
|
|
175
|
-
xml.tag!
|
|
183
|
+
xml.tag! 'TranInfo' do
|
|
176
184
|
xml.tag! 'CustomerCode', options[:customer]
|
|
177
185
|
end
|
|
178
186
|
end
|
|
@@ -199,22 +207,36 @@ module ActiveMerchant #:nodoc:
|
|
|
199
207
|
|
|
200
208
|
def add_credit_card(xml, credit_card, action)
|
|
201
209
|
xml.tag! 'Account' do
|
|
202
|
-
|
|
203
|
-
|
|
210
|
+
if credit_card.track_data.present?
|
|
211
|
+
# Track 1 has a start sentinel (STX) of '%' and track 2 is ';'
|
|
212
|
+
# Track 1 and 2 have identical end sentinels (ETX) of '?'
|
|
213
|
+
# Tracks may or may not have checksum (LRC) after the ETX
|
|
214
|
+
# If the track has no STX or is corrupt, we send it as track 1, to let Mercury
|
|
215
|
+
# handle with the validation error as it sees fit.
|
|
216
|
+
# Track 2 requires having the STX and ETX stripped. Track 1 does not.
|
|
217
|
+
# Max-length track 1s require having the STX and ETX stripped. Max is 79 bytes including LRC.
|
|
218
|
+
is_track_2 = credit_card.track_data[0] == ';'
|
|
219
|
+
etx_index = credit_card.track_data.rindex('?') || credit_card.track_data.length
|
|
220
|
+
is_max_track1 = etx_index >= 77
|
|
221
|
+
|
|
222
|
+
if is_track_2
|
|
223
|
+
xml.tag! 'Track2', credit_card.track_data[1...etx_index]
|
|
224
|
+
elsif is_max_track1
|
|
225
|
+
xml.tag! 'Track1', credit_card.track_data[1...etx_index]
|
|
226
|
+
else
|
|
227
|
+
xml.tag! 'Track1', credit_card.track_data
|
|
228
|
+
end
|
|
229
|
+
else
|
|
230
|
+
xml.tag! 'AcctNo', credit_card.number
|
|
231
|
+
xml.tag! 'ExpDate', expdate(credit_card)
|
|
232
|
+
end
|
|
204
233
|
end
|
|
205
234
|
xml.tag! 'CardType', CARD_CODES[credit_card.brand] if credit_card.brand
|
|
206
235
|
|
|
207
|
-
include_cvv = !%w(Return PreAuthCapture).include?(action)
|
|
236
|
+
include_cvv = !%w(Return PreAuthCapture).include?(action) && !credit_card.track_data.present?
|
|
208
237
|
xml.tag! 'CVVData', credit_card.verification_value if(include_cvv && credit_card.verification_value)
|
|
209
238
|
end
|
|
210
239
|
|
|
211
|
-
def expdate(credit_card)
|
|
212
|
-
year = sprintf("%.4i", credit_card.year)
|
|
213
|
-
month = sprintf("%.2i", credit_card.month)
|
|
214
|
-
|
|
215
|
-
"#{month}#{year[-2..-1]}"
|
|
216
|
-
end
|
|
217
|
-
|
|
218
240
|
def add_address(xml, options)
|
|
219
241
|
if billing_address = options[:billing_address] || options[:address]
|
|
220
242
|
xml.tag! 'AVS' do
|
|
@@ -233,12 +255,12 @@ module ActiveMerchant #:nodoc:
|
|
|
233
255
|
def hashify_xml!(xml, response)
|
|
234
256
|
xml = REXML::Document.new(xml)
|
|
235
257
|
|
|
236
|
-
xml.elements.each(
|
|
258
|
+
xml.elements.each('//CmdResponse/*') do |node|
|
|
237
259
|
response[node.name.underscore.to_sym] = node.text
|
|
238
260
|
end
|
|
239
261
|
|
|
240
|
-
xml.elements.each(
|
|
241
|
-
if node.name.to_s ==
|
|
262
|
+
xml.elements.each('//TranResponse/*') do |node|
|
|
263
|
+
if node.name.to_s == 'Amount'
|
|
242
264
|
node.elements.each do |amt|
|
|
243
265
|
response[amt.name.underscore.to_sym] = amt.text
|
|
244
266
|
end
|
|
@@ -271,8 +293,8 @@ module ActiveMerchant #:nodoc:
|
|
|
271
293
|
|
|
272
294
|
def build_header
|
|
273
295
|
{
|
|
274
|
-
|
|
275
|
-
|
|
296
|
+
'SOAPAction' => 'http://www.mercurypay.com/CreditTransaction',
|
|
297
|
+
'Content-Type' => 'text/xml; charset=utf-8'
|
|
276
298
|
}
|
|
277
299
|
end
|
|
278
300
|
|
|
@@ -288,7 +310,8 @@ module ActiveMerchant #:nodoc:
|
|
|
288
310
|
:test => test?,
|
|
289
311
|
:authorization => authorization_from(response),
|
|
290
312
|
:avs_result => { :code => response[:avs_result] },
|
|
291
|
-
:cvv_result => response[:cvv_result]
|
|
313
|
+
:cvv_result => response[:cvv_result],
|
|
314
|
+
:error_code => success ? nil : STANDARD_ERROR_CODE_MAPPING[response[:dsix_return_code]])
|
|
292
315
|
end
|
|
293
316
|
|
|
294
317
|
def message_from(response)
|
|
@@ -296,7 +319,7 @@ module ActiveMerchant #:nodoc:
|
|
|
296
319
|
end
|
|
297
320
|
|
|
298
321
|
def authorization_from(response)
|
|
299
|
-
dollars, cents = (response[:purchase] ||
|
|
322
|
+
dollars, cents = (response[:purchase] || '').split('.').collect(&:to_i)
|
|
300
323
|
dollars ||= 0
|
|
301
324
|
cents ||= 0
|
|
302
325
|
[
|
|
@@ -307,17 +330,17 @@ module ActiveMerchant #:nodoc:
|
|
|
307
330
|
response[:process_data],
|
|
308
331
|
response[:record_no],
|
|
309
332
|
((dollars * 100) + cents).to_s
|
|
310
|
-
].join(
|
|
333
|
+
].join(';')
|
|
311
334
|
end
|
|
312
335
|
|
|
313
336
|
def split_authorization(authorization)
|
|
314
|
-
invoice_no, ref_no, auth_code, acq_ref_data, process_data, record_no, amount = authorization.split(
|
|
337
|
+
invoice_no, ref_no, auth_code, acq_ref_data, process_data, record_no, amount = authorization.split(';')
|
|
315
338
|
[invoice_no, ref_no, auth_code, acq_ref_data, process_data, record_no, amount]
|
|
316
339
|
end
|
|
317
340
|
|
|
318
341
|
ENVELOPE_NAMESPACES = {
|
|
319
342
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
|
320
|
-
'xmlns:soap' =>
|
|
343
|
+
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
|
321
344
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
|
|
322
345
|
}
|
|
323
346
|
|
|
@@ -326,7 +349,7 @@ module ActiveMerchant #:nodoc:
|
|
|
326
349
|
end
|
|
327
350
|
|
|
328
351
|
def unescape_xml(escaped_xml)
|
|
329
|
-
escaped_xml.gsub(/\>/,'>').gsub(/\</,'<')
|
|
352
|
+
escaped_xml.gsub(/\>/, '>').gsub(/\</, '<')
|
|
330
353
|
end
|
|
331
354
|
end
|
|
332
355
|
end
|