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
@@ -18,10 +18,22 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
self.homepage_url = 'http://www.moneris.com/'
|
19
19
|
self.display_name = 'Moneris'
|
20
20
|
|
21
|
-
#
|
22
|
-
#
|
21
|
+
# Initialize the Gateway
|
22
|
+
#
|
23
|
+
# The gateway requires that a valid login and password be passed
|
24
|
+
# in the +options+ hash.
|
25
|
+
#
|
26
|
+
# ==== Options
|
27
|
+
#
|
28
|
+
# * <tt>:login</tt> -- Your Store ID
|
29
|
+
# * <tt>:password</tt> -- Your API Token
|
30
|
+
# * <tt>:cvv_enabled</tt> -- Specify that you would like the CVV passed to the gateway.
|
31
|
+
# Only particular account types at Moneris will allow this.
|
32
|
+
# Defaults to false. (optional)
|
23
33
|
def initialize(options = {})
|
24
34
|
requires!(options, :login, :password)
|
35
|
+
@cvv_enabled = options[:cvv_enabled]
|
36
|
+
@avs_enabled = options[:avs_enabled]
|
25
37
|
options = { :crypt_type => 7 }.merge(options)
|
26
38
|
super
|
27
39
|
end
|
@@ -34,12 +46,18 @@ module ActiveMerchant #:nodoc:
|
|
34
46
|
def authorize(money, creditcard_or_datakey, options = {})
|
35
47
|
requires!(options, :order_id)
|
36
48
|
post = {}
|
37
|
-
add_payment_source(post, creditcard_or_datakey)
|
49
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
38
50
|
post[:amount] = amount(money)
|
39
51
|
post[:order_id] = options[:order_id]
|
40
|
-
post[:
|
52
|
+
post[:address] = options[:billing_address] || options[:address]
|
41
53
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
42
|
-
action =
|
54
|
+
action = if post[:cavv]
|
55
|
+
'cavv_preauth'
|
56
|
+
elsif post[:data_key].blank?
|
57
|
+
'preauth'
|
58
|
+
else
|
59
|
+
'res_preauth_cc'
|
60
|
+
end
|
43
61
|
commit(action, post)
|
44
62
|
end
|
45
63
|
|
@@ -50,12 +68,18 @@ module ActiveMerchant #:nodoc:
|
|
50
68
|
def purchase(money, creditcard_or_datakey, options = {})
|
51
69
|
requires!(options, :order_id)
|
52
70
|
post = {}
|
53
|
-
add_payment_source(post, creditcard_or_datakey)
|
71
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
54
72
|
post[:amount] = amount(money)
|
55
73
|
post[:order_id] = options[:order_id]
|
56
|
-
post[:
|
74
|
+
post[:address] = options[:billing_address] || options[:address]
|
57
75
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
58
|
-
action =
|
76
|
+
action = if post[:cavv]
|
77
|
+
'cavv_purchase'
|
78
|
+
elsif post[:data_key].blank?
|
79
|
+
'purchase'
|
80
|
+
else
|
81
|
+
'res_purchase_cc'
|
82
|
+
end
|
59
83
|
commit(action, post)
|
60
84
|
end
|
61
85
|
|
@@ -70,13 +94,28 @@ module ActiveMerchant #:nodoc:
|
|
70
94
|
commit 'completion', crediting_params(authorization, :comp_amount => amount(money))
|
71
95
|
end
|
72
96
|
|
73
|
-
# Voiding
|
97
|
+
# Voiding requires the original transaction ID and order ID of some open
|
98
|
+
# transaction. Closed transactions must be refunded.
|
99
|
+
#
|
100
|
+
# Moneris supports the voiding of an unsettled capture or purchase via
|
101
|
+
# its <tt>purchasecorrection</tt> command. This action can only occur
|
102
|
+
# on the same day as the capture/purchase prior to 22:00-23:00 EST. If
|
103
|
+
# you want to do this, pass <tt>:purchasecorrection => true</tt> as
|
104
|
+
# an option.
|
105
|
+
#
|
106
|
+
# Fun, Historical Trivia:
|
107
|
+
# Voiding an authorization in Moneris is a relatively new feature
|
108
|
+
# (September, 2011). It is actually done by doing a $0 capture.
|
74
109
|
#
|
75
110
|
# Concatenate your transaction number and order_id by using a semicolon
|
76
111
|
# (';'). This is to keep the Moneris interface consistent with other
|
77
112
|
# gateways. (See +capture+ for details.)
|
78
113
|
def void(authorization, options = {})
|
79
|
-
|
114
|
+
if options[:purchasecorrection]
|
115
|
+
commit 'purchasecorrection', crediting_params(authorization)
|
116
|
+
else
|
117
|
+
capture(0, authorization, options)
|
118
|
+
end
|
80
119
|
end
|
81
120
|
|
82
121
|
# Performs a refund. This method requires that the original transaction
|
@@ -85,7 +124,7 @@ module ActiveMerchant #:nodoc:
|
|
85
124
|
# Moneris interface consistent with other gateways. (See +capture+ for
|
86
125
|
# details.)
|
87
126
|
def credit(money, authorization, options = {})
|
88
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
127
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
89
128
|
refund(money, authorization, options)
|
90
129
|
end
|
91
130
|
|
@@ -93,6 +132,13 @@ module ActiveMerchant #:nodoc:
|
|
93
132
|
commit 'refund', crediting_params(authorization, :amount => amount(money))
|
94
133
|
end
|
95
134
|
|
135
|
+
def verify(credit_card, options={})
|
136
|
+
MultiResponse.run(:use_first_response) do |r|
|
137
|
+
r.process { authorize(100, credit_card, options) }
|
138
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
96
142
|
def store(credit_card, options = {})
|
97
143
|
post = {}
|
98
144
|
post[:pan] = credit_card.number
|
@@ -116,19 +162,42 @@ module ActiveMerchant #:nodoc:
|
|
116
162
|
commit('res_update_cc', post)
|
117
163
|
end
|
118
164
|
|
165
|
+
def supports_scrubbing?
|
166
|
+
true
|
167
|
+
end
|
168
|
+
|
169
|
+
def scrub(transcript)
|
170
|
+
transcript.
|
171
|
+
gsub(%r((<store_id>).+(</store_id>)), '\1[FILTERED]\2').
|
172
|
+
gsub(%r((<api_token>).+(</api_token>)), '\1[FILTERED]\2').
|
173
|
+
gsub(%r((<pan>).+(</pan>)), '\1[FILTERED]\2').
|
174
|
+
gsub(%r((<cvd_value>).+(</cvd_value>)), '\1[FILTERED]\2').
|
175
|
+
gsub(%r((<cavv>).+(</cavv>)), '\1[FILTERED]\2')
|
176
|
+
end
|
177
|
+
|
119
178
|
private # :nodoc: all
|
120
179
|
|
121
180
|
def expdate(creditcard)
|
122
181
|
sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
|
123
182
|
end
|
124
183
|
|
125
|
-
def add_payment_source(post,
|
126
|
-
if
|
127
|
-
post[:data_key] =
|
184
|
+
def add_payment_source(post, payment_method, options)
|
185
|
+
if payment_method.is_a?(String)
|
186
|
+
post[:data_key] = payment_method
|
187
|
+
post[:cust_id] = options[:customer]
|
128
188
|
else
|
129
|
-
|
130
|
-
|
131
|
-
|
189
|
+
if payment_method.respond_to?(:track_data) && payment_method.track_data.present?
|
190
|
+
post[:pos_code] = '00'
|
191
|
+
post[:track2] = payment_method.track_data
|
192
|
+
else
|
193
|
+
post[:pan] = payment_method.number
|
194
|
+
post[:expdate] = expdate(payment_method)
|
195
|
+
post[:cvd_value] = payment_method.verification_value if payment_method.verification_value?
|
196
|
+
post[:cavv] = payment_method.payment_cryptogram if payment_method.is_a?(NetworkTokenizationCreditCard)
|
197
|
+
post[:wallet_indicator] = wallet_indicator(payment_method.source.to_s) if payment_method.is_a?(NetworkTokenizationCreditCard)
|
198
|
+
post[:crypt_type] = (payment_method.eci || 7) if payment_method.is_a?(NetworkTokenizationCreditCard)
|
199
|
+
end
|
200
|
+
post[:cust_id] = options[:customer] || payment_method.name
|
132
201
|
end
|
133
202
|
end
|
134
203
|
|
@@ -141,7 +210,7 @@ module ActiveMerchant #:nodoc:
|
|
141
210
|
}.merge(options)
|
142
211
|
end
|
143
212
|
|
144
|
-
# Splits an +authorization+ param and
|
213
|
+
# Splits an +authorization+ param and retrieves the order id and
|
145
214
|
# transaction number in that order.
|
146
215
|
def split_authorization(authorization)
|
147
216
|
if authorization.nil? || authorization.empty? || authorization !~ /;/
|
@@ -152,11 +221,15 @@ module ActiveMerchant #:nodoc:
|
|
152
221
|
end
|
153
222
|
|
154
223
|
def commit(action, parameters = {})
|
155
|
-
|
224
|
+
data = post_data(action, parameters)
|
225
|
+
url = test? ? self.test_url : self.live_url
|
226
|
+
raw = ssl_post(url, data)
|
227
|
+
response = parse(raw)
|
156
228
|
|
157
229
|
Response.new(successful?(response), message_from(response[:message]), response,
|
158
230
|
:test => test?,
|
159
|
-
:
|
231
|
+
:avs_result => { :code => response[:avs_result_code] },
|
232
|
+
:cvv_result => response[:cvd_result_code] && response[:cvd_result_code][-1,1],
|
160
233
|
:authorization => authorization_from(response)
|
161
234
|
)
|
162
235
|
end
|
@@ -204,8 +277,11 @@ module ActiveMerchant #:nodoc:
|
|
204
277
|
|
205
278
|
# Must add the elements in the correct order
|
206
279
|
actions[action].each do |key|
|
207
|
-
|
208
|
-
|
280
|
+
case key
|
281
|
+
when :avs_info
|
282
|
+
transaction.add_element(avs_element(parameters[:address])) if @avs_enabled && parameters[:address]
|
283
|
+
when :cvd_info
|
284
|
+
transaction.add_element(cvd_element(parameters[:cvd_value])) if @cvv_enabled
|
209
285
|
else
|
210
286
|
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
|
211
287
|
end
|
@@ -214,6 +290,17 @@ module ActiveMerchant #:nodoc:
|
|
214
290
|
transaction
|
215
291
|
end
|
216
292
|
|
293
|
+
def avs_element(address)
|
294
|
+
full_address = "#{address[:address1]} #{address[:address2]}"
|
295
|
+
tokens = full_address.split(/\s+/)
|
296
|
+
|
297
|
+
element = REXML::Element.new('avs_info')
|
298
|
+
element.add_element('avs_street_number').text = tokens.select{|x| x =~ /\d/}.join(' ')
|
299
|
+
element.add_element('avs_street_name').text = tokens.reject{|x| x =~ /\d/}.join(' ')
|
300
|
+
element.add_element('avs_zipcode').text = address[:zip]
|
301
|
+
element
|
302
|
+
end
|
303
|
+
|
217
304
|
def cvd_element(cvd_value)
|
218
305
|
element = REXML::Element.new('cvd_info')
|
219
306
|
if cvd_value
|
@@ -225,32 +312,28 @@ module ActiveMerchant #:nodoc:
|
|
225
312
|
element
|
226
313
|
end
|
227
314
|
|
315
|
+
def wallet_indicator(token_source)
|
316
|
+
return 'APP' if token_source == 'apple_pay'
|
317
|
+
return 'ANP' if token_source == 'android_pay'
|
318
|
+
nil
|
319
|
+
end
|
320
|
+
|
228
321
|
def message_from(message)
|
229
322
|
return 'Unspecified error' if message.blank?
|
230
323
|
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
231
324
|
end
|
232
325
|
|
233
|
-
# Make a Ruby type out of the response string
|
234
|
-
def normalize(field)
|
235
|
-
case field
|
236
|
-
when "true" then true
|
237
|
-
when "false" then false
|
238
|
-
when '', "null" then nil
|
239
|
-
else field
|
240
|
-
end
|
241
|
-
end
|
242
|
-
|
243
326
|
def actions
|
244
327
|
{
|
245
|
-
"purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :cvd_info],
|
246
|
-
"preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :cvd_info],
|
328
|
+
"purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code],
|
329
|
+
"preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code],
|
247
330
|
"command" => [:order_id],
|
248
331
|
"refund" => [:order_id, :amount, :txn_number, :crypt_type],
|
249
332
|
"indrefund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
250
333
|
"completion" => [:order_id, :comp_amount, :txn_number, :crypt_type],
|
251
334
|
"purchasecorrection" => [:order_id, :txn_number, :crypt_type],
|
252
|
-
"
|
253
|
-
"
|
335
|
+
"cavv_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
|
336
|
+
"cavv_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
|
254
337
|
"transact" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
255
338
|
"Batchcloseall" => [],
|
256
339
|
"opentotals" => [:ecr_number],
|
@@ -18,29 +18,64 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
self.homepage_url = 'http://www.monerisusa.com/'
|
19
19
|
self.display_name = 'Moneris (US)'
|
20
20
|
|
21
|
-
#
|
22
|
-
#
|
21
|
+
# Initialize the Gateway
|
22
|
+
#
|
23
|
+
# The gateway requires that a valid login and password be passed
|
24
|
+
# in the +options+ hash.
|
25
|
+
#
|
26
|
+
# ==== Options
|
27
|
+
#
|
28
|
+
# * <tt>:login</tt> -- Your Store ID
|
29
|
+
# * <tt>:password</tt> -- Your API Token
|
30
|
+
# * <tt>:cvv_enabled</tt> -- Specify that you would like the CVV passed to the gateway.
|
31
|
+
# Only particular account types at Moneris will allow this.
|
32
|
+
# Defaults to false. (optional)
|
23
33
|
def initialize(options = {})
|
24
34
|
requires!(options, :login, :password)
|
35
|
+
@cvv_enabled = options[:cvv_enabled]
|
36
|
+
@avs_enabled = options[:avs_enabled]
|
25
37
|
options = { :crypt_type => 7 }.merge(options)
|
26
38
|
super
|
27
39
|
end
|
28
40
|
|
41
|
+
def verify(creditcard_or_datakey, options = {})
|
42
|
+
MultiResponse.run(:use_first_response) do |r|
|
43
|
+
r.process { authorize(100, creditcard_or_datakey, options) }
|
44
|
+
r.process(:ignore_result) { capture(0, r.authorization) }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
29
48
|
# Referred to as "PreAuth" in the Moneris integration guide, this action
|
30
49
|
# verifies and locks funds on a customer's card, which then must be
|
31
50
|
# captured at a later date.
|
32
51
|
#
|
33
52
|
# Pass in +order_id+ and optionally a +customer+ parameter.
|
34
|
-
def authorize(money,
|
35
|
-
|
53
|
+
def authorize(money, creditcard_or_datakey, options = {})
|
54
|
+
requires!(options, :order_id)
|
55
|
+
post = {}
|
56
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
57
|
+
post[:amount] = amount(money)
|
58
|
+
post[:order_id] = options[:order_id]
|
59
|
+
post[:address] = options[:billing_address] || options[:address]
|
60
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
61
|
+
action = (post[:data_key].blank?) ? 'us_preauth' : 'us_res_preauth_cc'
|
62
|
+
commit(action, post)
|
36
63
|
end
|
37
64
|
|
38
|
-
# This action verifies funding on a customer's card
|
65
|
+
# This action verifies funding on a customer's card and readies them for
|
39
66
|
# deposit in a merchant's account.
|
40
67
|
#
|
41
68
|
# Pass in <tt>order_id</tt> and optionally a <tt>customer</tt> parameter
|
42
|
-
def purchase(money,
|
43
|
-
|
69
|
+
def purchase(money, creditcard_or_datakey, options = {})
|
70
|
+
requires!(options, :order_id)
|
71
|
+
post = {}
|
72
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
73
|
+
post[:amount] = amount(money)
|
74
|
+
post[:order_id] = options[:order_id]
|
75
|
+
post[:address] = options[:billing_address] || options[:address]
|
76
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
77
|
+
action = (post[:data_key].blank?) ? 'us_purchase' : 'us_res_purchase_cc'
|
78
|
+
commit(action, post)
|
44
79
|
end
|
45
80
|
|
46
81
|
# This method retrieves locked funds from a customer's account (from a
|
@@ -71,7 +106,7 @@ module ActiveMerchant #:nodoc:
|
|
71
106
|
# Moneris interface consistent with other gateways. (See +capture+ for
|
72
107
|
# details.)
|
73
108
|
def credit(money, authorization, options = {})
|
74
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
109
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
75
110
|
refund(money, authorization, options)
|
76
111
|
end
|
77
112
|
|
@@ -79,27 +114,56 @@ module ActiveMerchant #:nodoc:
|
|
79
114
|
commit 'us_refund', crediting_params(authorization, :amount => amount(money))
|
80
115
|
end
|
81
116
|
|
117
|
+
def store(credit_card, options = {})
|
118
|
+
post = {}
|
119
|
+
post[:pan] = credit_card.number
|
120
|
+
post[:expdate] = expdate(credit_card)
|
121
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
122
|
+
commit('us_res_add_cc', post)
|
123
|
+
end
|
124
|
+
|
125
|
+
def unstore(data_key, options = {})
|
126
|
+
post = {}
|
127
|
+
post[:data_key] = data_key
|
128
|
+
commit('us_res_delete', post)
|
129
|
+
end
|
130
|
+
|
131
|
+
def update(data_key, credit_card, options = {})
|
132
|
+
post = {}
|
133
|
+
post[:pan] = credit_card.number
|
134
|
+
post[:expdate] = expdate(credit_card)
|
135
|
+
post[:data_key] = data_key
|
136
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
137
|
+
commit('us_res_update_cc', post)
|
138
|
+
end
|
139
|
+
|
140
|
+
def supports_scrubbing?
|
141
|
+
true
|
142
|
+
end
|
143
|
+
|
144
|
+
def scrub(transcript)
|
145
|
+
transcript.
|
146
|
+
gsub(%r((<pan>)[^<]*(</pan>))i, '\1[FILTERED]\2').
|
147
|
+
gsub(%r((<api_token>)[^<]*(</api_token>))i, '\1[FILTERED]\2').
|
148
|
+
gsub(%r((<cvd_value>)[^<]*(</cvd_value>))i, '\1[FILTERED]\2')
|
149
|
+
end
|
150
|
+
|
82
151
|
private # :nodoc: all
|
83
152
|
|
84
153
|
def expdate(creditcard)
|
85
154
|
sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
|
86
155
|
end
|
87
156
|
|
88
|
-
def
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
:
|
97
|
-
|
98
|
-
:amount => amount(money),
|
99
|
-
:pan => creditcard.number,
|
100
|
-
:expdate => expdate(creditcard),
|
101
|
-
:crypt_type => options[:crypt_type] || @options[:crypt_type]
|
102
|
-
}
|
157
|
+
def add_payment_source(post, source, options)
|
158
|
+
if source.is_a?(String)
|
159
|
+
post[:data_key] = source
|
160
|
+
post[:cust_id] = options[:customer]
|
161
|
+
else
|
162
|
+
post[:pan] = source.number
|
163
|
+
post[:expdate] = expdate(source)
|
164
|
+
post[:cvd_value] = source.verification_value if source.verification_value?
|
165
|
+
post[:cust_id] = options[:customer] || source.name
|
166
|
+
end
|
103
167
|
end
|
104
168
|
|
105
169
|
# Common params used amongst the +credit+, +void+ and +capture+ methods
|
@@ -111,7 +175,7 @@ module ActiveMerchant #:nodoc:
|
|
111
175
|
}.merge(options)
|
112
176
|
end
|
113
177
|
|
114
|
-
# Splits an +authorization+ param and
|
178
|
+
# Splits an +authorization+ param and retrieves the order id and
|
115
179
|
# transaction number in that order.
|
116
180
|
def split_authorization(authorization)
|
117
181
|
if authorization.nil? || authorization.empty? || authorization !~ /;/
|
@@ -122,10 +186,15 @@ module ActiveMerchant #:nodoc:
|
|
122
186
|
end
|
123
187
|
|
124
188
|
def commit(action, parameters = {})
|
125
|
-
|
189
|
+
data = post_data(action, parameters)
|
190
|
+
url = test? ? self.test_url : self.live_url
|
191
|
+
raw = ssl_post(url, data)
|
192
|
+
response = parse(raw)
|
126
193
|
|
127
194
|
Response.new(successful?(response), message_from(response[:message]), response,
|
128
195
|
:test => test?,
|
196
|
+
:avs_result => { :code => response[:avs_result_code] },
|
197
|
+
:cvv_result => response[:cvd_result_code] && response[:cvd_result_code][-1,1],
|
129
198
|
:authorization => authorization_from(response)
|
130
199
|
)
|
131
200
|
end
|
@@ -163,44 +232,76 @@ module ActiveMerchant #:nodoc:
|
|
163
232
|
root = xml.add_element("request")
|
164
233
|
root.add_element("store_id").text = options[:login]
|
165
234
|
root.add_element("api_token").text = options[:password]
|
166
|
-
|
235
|
+
root.add_element(transaction_element(action, parameters))
|
236
|
+
|
237
|
+
xml.to_s
|
238
|
+
end
|
239
|
+
|
240
|
+
def transaction_element(action, parameters)
|
241
|
+
transaction = REXML::Element.new(action)
|
167
242
|
|
168
243
|
# Must add the elements in the correct order
|
169
244
|
actions[action].each do |key|
|
170
|
-
|
245
|
+
case key
|
246
|
+
when :avs_info
|
247
|
+
transaction.add_element(avs_element(parameters[:address])) if @avs_enabled && parameters[:address]
|
248
|
+
when :cvd_info
|
249
|
+
transaction.add_element(cvd_element(parameters[:cvd_value])) if @cvv_enabled
|
250
|
+
else
|
251
|
+
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
|
252
|
+
end
|
171
253
|
end
|
172
254
|
|
173
|
-
|
255
|
+
transaction
|
174
256
|
end
|
175
257
|
|
176
|
-
def
|
177
|
-
|
178
|
-
|
258
|
+
def avs_element(address)
|
259
|
+
full_address = "#{address[:address1]} #{address[:address2]}"
|
260
|
+
tokens = full_address.split(/\s+/)
|
261
|
+
|
262
|
+
element = REXML::Element.new('avs_info')
|
263
|
+
element.add_element('avs_street_number').text = tokens.select{|x| x =~ /\d/}.join(' ')
|
264
|
+
element.add_element('avs_street_name').text = tokens.reject{|x| x =~ /\d/}.join(' ')
|
265
|
+
element.add_element('avs_zipcode').text = address[:zip]
|
266
|
+
element
|
179
267
|
end
|
180
268
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
269
|
+
def cvd_element(cvd_value)
|
270
|
+
element = REXML::Element.new('cvd_info')
|
271
|
+
if cvd_value
|
272
|
+
element.add_element('cvd_indicator').text = "1"
|
273
|
+
element.add_element('cvd_value').text = cvd_value
|
274
|
+
else
|
275
|
+
element.add_element('cvd_indicator').text = "0"
|
188
276
|
end
|
277
|
+
element
|
278
|
+
end
|
279
|
+
|
280
|
+
def message_from(message)
|
281
|
+
return 'Unspecified error' if message.blank?
|
282
|
+
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
189
283
|
end
|
190
284
|
|
191
285
|
def actions
|
192
286
|
{
|
193
|
-
"us_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
194
|
-
"us_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
287
|
+
"us_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info],
|
288
|
+
"us_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info],
|
289
|
+
"us_command" => [:order_id],
|
195
290
|
"us_refund" => [:order_id, :amount, :txn_number, :crypt_type],
|
196
|
-
"
|
291
|
+
"us_indrefund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
197
292
|
"us_completion" => [:order_id, :comp_amount, :txn_number, :crypt_type],
|
198
293
|
"us_purchasecorrection" => [:order_id, :txn_number, :crypt_type],
|
199
|
-
"
|
200
|
-
"
|
201
|
-
"
|
294
|
+
"us_cavvpurcha" => [:order_id, :cust_id, :amount, :pan, :expdate, :cav],
|
295
|
+
"us_cavvpreaut" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv],
|
296
|
+
"us_transact" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
297
|
+
"us_Batchcloseall" => [],
|
202
298
|
"us_opentotals" => [:ecr_number],
|
203
|
-
"us_batchclose" => [:ecr_number]
|
299
|
+
"us_batchclose" => [:ecr_number],
|
300
|
+
"us_res_add_cc" => [:pan, :expdate, :crypt_type],
|
301
|
+
"us_res_delete" => [:data_key],
|
302
|
+
"us_res_update_cc" => [:data_key, :pan, :expdate, :crypt_type],
|
303
|
+
"us_res_purchase_cc" => [:data_key, :order_id, :cust_id, :amount, :crypt_type],
|
304
|
+
"us_res_preauth_cc" => [:data_key, :order_id, :cust_id, :amount, :crypt_type]
|
204
305
|
}
|
205
306
|
end
|
206
307
|
end
|