activemerchant 1.42.6 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/CHANGELOG +1420 -2
- data/CONTRIBUTORS +106 -0
- data/README.md +107 -103
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/avs_result.rb +12 -13
- data/lib/active_merchant/billing/base.rb +13 -16
- data/lib/active_merchant/billing/check.rb +35 -24
- data/lib/active_merchant/billing/compatibility.rb +117 -0
- data/lib/active_merchant/billing/credit_card.rb +196 -81
- data/lib/active_merchant/billing/credit_card_formatting.rb +6 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +199 -75
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +171 -39
- data/lib/active_merchant/billing/gateways/adyen.rb +380 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +933 -604
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +74 -54
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +130 -370
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +23 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +351 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +109 -32
- data/lib/active_merchant/billing/gateways/beanstream.rb +59 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -9
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -498
- data/lib/active_merchant/billing/gateways/blue_snap.rb +347 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +80 -46
- data/lib/active_merchant/billing/gateways/borgun.rb +220 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +15 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +311 -121
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +244 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +311 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +6 -7
- data/lib/active_merchant/billing/gateways/card_stream.rb +235 -89
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +50 -8
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -14
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +22 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +142 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +91 -97
- data/lib/active_merchant/billing/gateways/creditcall.rb +271 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +356 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +268 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +294 -158
- data/lib/active_merchant/billing/gateways/d_local.rb +226 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +59 -347
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +24 -39
- data/lib/active_merchant/billing/gateways/elavon.rb +146 -147
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +41 -31
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +79 -78
- data/lib/active_merchant/billing/gateways/eway_managed.rb +35 -36
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +369 -228
- data/lib/active_merchant/billing/gateways/exact.rb +32 -26
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +90 -64
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -14
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +142 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +128 -122
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +190 -64
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +446 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +270 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +29 -27
- data/lib/active_merchant/billing/gateways/global_collect.rb +340 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +35 -36
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +29 -32
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -6
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +247 -41
- data/lib/active_merchant/billing/gateways/itransact.rb +4 -5
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +198 -71
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +219 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +411 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +45 -43
- data/lib/active_merchant/billing/gateways/litle.rb +328 -444
- data/lib/active_merchant/billing/gateways/mastercard.rb +267 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +145 -115
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +277 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +37 -19
- data/lib/active_merchant/billing/gateways/merchant_one.rb +13 -15
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +57 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +59 -48
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +38 -19
- data/lib/active_merchant/billing/gateways/mercury.rb +77 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +11 -30
- data/lib/active_merchant/billing/gateways/micropayment.rb +183 -0
- data/lib/active_merchant/billing/gateways/migs.rb +81 -22
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +23 -25
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +146 -64
- data/lib/active_merchant/billing/gateways/moneris_us.rb +197 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -15
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +86 -64
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +11 -5
- data/lib/active_merchant/billing/gateways/netaxept.rb +21 -22
- data/lib/active_merchant/billing/gateways/netbanx.rb +290 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +70 -35
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -6
- data/lib/active_merchant/billing/gateways/network_merchants.rb +241 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +274 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +90 -47
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +48 -20
- data/lib/active_merchant/billing/gateways/opp.rb +369 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +79 -44
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -102
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +48 -29
- data/lib/active_merchant/billing/gateways/pagarme.rb +246 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +67 -48
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +20 -26
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +188 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +7 -15
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +40 -36
- data/lib/active_merchant/billing/gateways/payeezy.rb +410 -0
- data/lib/active_merchant/billing/gateways/payex.rb +38 -30
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +62 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +74 -27
- data/lib/active_merchant/billing/gateways/payflow_express.rb +77 -81
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +54 -45
- data/lib/active_merchant/billing/gateways/paymentez.rb +304 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +160 -66
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +54 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +17 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +36 -27
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +7 -6
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -88
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +445 -0
- data/lib/active_merchant/billing/gateways/payway.rb +8 -8
- data/lib/active_merchant/billing/gateways/pin.rb +74 -18
- data/lib/active_merchant/billing/gateways/plugnpay.rb +66 -76
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +30 -30
- data/lib/active_merchant/billing/gateways/psl_card.rb +27 -34
- data/lib/active_merchant/billing/gateways/qbms.rb +65 -54
- data/lib/active_merchant/billing/gateways/quantum.rb +18 -18
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +295 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -350
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +78 -48
- data/lib/active_merchant/billing/gateways/redsys.rb +310 -170
- data/lib/active_merchant/billing/gateways/s5.rb +246 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +415 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +195 -90
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -12
- data/lib/active_merchant/billing/gateways/secure_net.rb +51 -43
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -10
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -14
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +10 -18
- data/lib/active_merchant/billing/gateways/securion_pay.rb +264 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +35 -38
- data/lib/active_merchant/billing/gateways/smart_ps.rb +50 -42
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +9 -9
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +62 -12
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -103
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +12 -18
- data/lib/active_merchant/billing/gateways/telr.rb +274 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +143 -30
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transax.rb +5 -6
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -232
- data/lib/active_merchant/billing/gateways/trexle.rb +218 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +86 -57
- data/lib/active_merchant/billing/gateways/usa_epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +196 -89
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +157 -32
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +42 -49
- data/lib/active_merchant/billing/gateways/viaklix.rb +11 -24
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +233 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +26 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +237 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +153 -31
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +207 -63
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +215 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +31 -24
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +195 -0
- data/lib/active_merchant/country.rb +335 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +10 -0
- data/lib/active_merchant/network_connection_retries.rb +80 -0
- data/lib/active_merchant/post_data.rb +25 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +23 -27
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3988 -0
- data/lib/support/gateway_support.rb +7 -9
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +6 -7
- data/lib/support/ssl_version.rb +87 -0
- metadata +148 -323
- checksums.yaml.gz.sig +0 -0
- data/gem-public_cert.pem +0 -21
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/app55.rb +0 -185
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -249
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/alipay/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/alipay/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/alipay.rb +0 -18
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -64
- data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +0 -74
- data/lib/active_merchant/billing/integrations/bit_pay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus/notification.rb +0 -133
- data/lib/active_merchant/billing/integrations/citrus/return.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus.rb +0 -51
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/doku/helper.rb +0 -102
- data/lib/active_merchant/billing/integrations/doku/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/doku/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/doku.rb +0 -24
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -118
- data/lib/active_merchant/billing/integrations/ipay88/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -29
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -23
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -60
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -154
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +0 -19
- data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +0 -16
- data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +0 -30
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -107
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -171
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -58
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/common.rb +0 -104
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/helper.rb +0 -145
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb +0 -35
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page.rb +0 -39
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -1
|
@@ -1,20 +1,284 @@
|
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
|
3
|
-
class NmiGateway <
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
class NmiGateway < Gateway
|
|
4
|
+
include Empty
|
|
5
|
+
|
|
6
|
+
DUP_WINDOW_DEPRECATION_MESSAGE = 'The class-level duplicate_window variable is deprecated. Please use the :dup_seconds transaction option instead.'
|
|
7
|
+
|
|
8
|
+
self.test_url = self.live_url = 'https://secure.nmi.com/api/transact.php'
|
|
9
|
+
self.default_currency = 'USD'
|
|
10
|
+
self.money_format = :dollars
|
|
8
11
|
self.supported_countries = ['US']
|
|
9
12
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
|
13
|
+
self.homepage_url = 'http://nmi.com/'
|
|
14
|
+
self.display_name = 'NMI'
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
def self.duplicate_window=(seconds)
|
|
17
|
+
ActiveMerchant.deprecated(DUP_WINDOW_DEPRECATION_MESSAGE)
|
|
18
|
+
@dup_seconds = seconds
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.duplicate_window
|
|
22
|
+
instance_variable_defined?(:@dup_seconds) ? @dup_seconds : nil
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def initialize(options = {})
|
|
26
|
+
requires!(options, :login, :password)
|
|
13
27
|
super
|
|
14
|
-
post[:recurring_billing] = "TRUE" if options[:recurring]
|
|
15
28
|
end
|
|
16
|
-
end
|
|
17
29
|
|
|
30
|
+
def purchase(amount, payment_method, options={})
|
|
31
|
+
post = {}
|
|
32
|
+
add_invoice(post, amount, options)
|
|
33
|
+
add_payment_method(post, payment_method, options)
|
|
34
|
+
add_customer_data(post, options)
|
|
35
|
+
add_vendor_data(post, options)
|
|
36
|
+
add_merchant_defined_fields(post, options)
|
|
37
|
+
|
|
38
|
+
commit('sale', post)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def authorize(amount, payment_method, options={})
|
|
42
|
+
post = {}
|
|
43
|
+
add_invoice(post, amount, options)
|
|
44
|
+
add_payment_method(post, payment_method, options)
|
|
45
|
+
add_customer_data(post, options)
|
|
46
|
+
add_vendor_data(post, options)
|
|
47
|
+
add_merchant_defined_fields(post, options)
|
|
48
|
+
|
|
49
|
+
commit('auth', post)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def capture(amount, authorization, options={})
|
|
53
|
+
post = {}
|
|
54
|
+
add_invoice(post, amount, options)
|
|
55
|
+
add_reference(post, authorization)
|
|
56
|
+
add_merchant_defined_fields(post, options)
|
|
57
|
+
|
|
58
|
+
commit('capture', post)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def void(authorization, options={})
|
|
62
|
+
post = {}
|
|
63
|
+
add_reference(post, authorization)
|
|
64
|
+
add_payment_type(post, authorization)
|
|
65
|
+
|
|
66
|
+
commit('void', post)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def refund(amount, authorization, options={})
|
|
70
|
+
post = {}
|
|
71
|
+
add_invoice(post, amount, options)
|
|
72
|
+
add_reference(post, authorization)
|
|
73
|
+
add_payment_type(post, authorization)
|
|
74
|
+
|
|
75
|
+
commit('refund', post)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def credit(amount, payment_method, options={})
|
|
79
|
+
post = {}
|
|
80
|
+
add_invoice(post, amount, options)
|
|
81
|
+
add_payment_method(post, payment_method, options)
|
|
82
|
+
add_customer_data(post, options)
|
|
83
|
+
add_vendor_data(post, options)
|
|
84
|
+
|
|
85
|
+
commit('credit', post)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def verify(payment_method, options={})
|
|
89
|
+
post = {}
|
|
90
|
+
add_payment_method(post, payment_method, options)
|
|
91
|
+
add_customer_data(post, options)
|
|
92
|
+
add_vendor_data(post, options)
|
|
93
|
+
add_merchant_defined_fields(post, options)
|
|
94
|
+
|
|
95
|
+
commit('validate', post)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def store(payment_method, options = {})
|
|
99
|
+
post = {}
|
|
100
|
+
add_invoice(post, nil, options)
|
|
101
|
+
add_payment_method(post, payment_method, options)
|
|
102
|
+
add_customer_data(post, options)
|
|
103
|
+
add_vendor_data(post, options)
|
|
104
|
+
add_merchant_defined_fields(post, options)
|
|
105
|
+
|
|
106
|
+
commit('add_customer', post)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def verify_credentials
|
|
110
|
+
response = void('0')
|
|
111
|
+
response.message != 'Authentication Failed'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def supports_scrubbing?
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def scrub(transcript)
|
|
119
|
+
transcript.
|
|
120
|
+
gsub(%r((password=)\w+), '\1[FILTERED]').
|
|
121
|
+
gsub(%r((ccnumber=)\d+), '\1[FILTERED]').
|
|
122
|
+
gsub(%r((cvv=)\d+), '\1[FILTERED]').
|
|
123
|
+
gsub(%r((checkaba=)\d+), '\1[FILTERED]').
|
|
124
|
+
gsub(%r((checkaccount=)\d+), '\1[FILTERED]').
|
|
125
|
+
gsub(%r((cryptogram=)[^&]+(&?)), '\1[FILTERED]\2')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def supports_network_tokenization?
|
|
129
|
+
true
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
private
|
|
133
|
+
|
|
134
|
+
def add_invoice(post, money, options)
|
|
135
|
+
post[:amount] = amount(money)
|
|
136
|
+
post[:orderid] = options[:order_id]
|
|
137
|
+
post[:orderdescription] = options[:description]
|
|
138
|
+
post[:currency] = options[:currency] || currency(money)
|
|
139
|
+
post[:billing_method] = 'recurring' if options[:recurring]
|
|
140
|
+
if (dup_seconds = (options[:dup_seconds] || self.class.duplicate_window))
|
|
141
|
+
post[:dup_seconds] = dup_seconds
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def add_payment_method(post, payment_method, options)
|
|
146
|
+
if(payment_method.is_a?(String))
|
|
147
|
+
post[:customer_vault_id] = payment_method
|
|
148
|
+
elsif payment_method.is_a?(NetworkTokenizationCreditCard)
|
|
149
|
+
post[:ccnumber] = payment_method.number
|
|
150
|
+
post[:ccexp] = exp_date(payment_method)
|
|
151
|
+
post[:token_cryptogram] = payment_method.payment_cryptogram
|
|
152
|
+
elsif(card_brand(payment_method) == 'check')
|
|
153
|
+
post[:payment] = 'check'
|
|
154
|
+
post[:firstname] = payment_method.first_name
|
|
155
|
+
post[:lastname] = payment_method.last_name
|
|
156
|
+
post[:checkname] = payment_method.name
|
|
157
|
+
post[:checkaba] = payment_method.routing_number
|
|
158
|
+
post[:checkaccount] = payment_method.account_number
|
|
159
|
+
post[:account_holder_type] = payment_method.account_holder_type
|
|
160
|
+
post[:account_type] = payment_method.account_type
|
|
161
|
+
post[:sec_code] = options[:sec_code] || 'WEB'
|
|
162
|
+
else
|
|
163
|
+
post[:payment] = 'creditcard'
|
|
164
|
+
post[:firstname] = payment_method.first_name
|
|
165
|
+
post[:lastname] = payment_method.last_name
|
|
166
|
+
post[:ccnumber] = payment_method.number
|
|
167
|
+
post[:cvv] = payment_method.verification_value unless empty?(payment_method.verification_value)
|
|
168
|
+
post[:ccexp] = exp_date(payment_method)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def add_customer_data(post, options)
|
|
173
|
+
post[:email] = options[:email]
|
|
174
|
+
post[:ipaddress] = options[:ip]
|
|
175
|
+
post[:customer_id] = options[:customer_id] || options[:customer]
|
|
176
|
+
|
|
177
|
+
if(billing_address = options[:billing_address] || options[:address])
|
|
178
|
+
post[:company] = billing_address[:company]
|
|
179
|
+
post[:address1] = billing_address[:address1]
|
|
180
|
+
post[:address2] = billing_address[:address2]
|
|
181
|
+
post[:city] = billing_address[:city]
|
|
182
|
+
post[:state] = billing_address[:state]
|
|
183
|
+
post[:country] = billing_address[:country]
|
|
184
|
+
post[:zip] = billing_address[:zip]
|
|
185
|
+
post[:phone] = billing_address[:phone]
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if(shipping_address = options[:shipping_address])
|
|
189
|
+
post[:shipping_company] = shipping_address[:company]
|
|
190
|
+
post[:shipping_address1] = shipping_address[:address1]
|
|
191
|
+
post[:shipping_address2] = shipping_address[:address2]
|
|
192
|
+
post[:shipping_city] = shipping_address[:city]
|
|
193
|
+
post[:shipping_state] = shipping_address[:state]
|
|
194
|
+
post[:shipping_country] = shipping_address[:country]
|
|
195
|
+
post[:shipping_zip] = shipping_address[:zip]
|
|
196
|
+
post[:shipping_phone] = shipping_address[:phone]
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def add_vendor_data(post, options)
|
|
201
|
+
post[:vendor_id] = options[:vendor_id] if options[:vendor_id]
|
|
202
|
+
post[:processor_id] = options[:processor_id] if options[:processor_id]
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def add_merchant_defined_fields(post, options)
|
|
206
|
+
(1..20).each do |each|
|
|
207
|
+
key = "merchant_defined_field_#{each}".to_sym
|
|
208
|
+
post[key] = options[key] if options[key]
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def add_reference(post, authorization)
|
|
213
|
+
transaction_id, _ = split_authorization(authorization)
|
|
214
|
+
post[:transactionid] = transaction_id
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
def add_payment_type(post, authorization)
|
|
218
|
+
_, payment_type = split_authorization(authorization)
|
|
219
|
+
post[:payment] = payment_type if payment_type
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def exp_date(payment_method)
|
|
223
|
+
"#{format(payment_method.month, :two_digits)}#{format(payment_method.year, :two_digits)}"
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
def commit(action, params)
|
|
227
|
+
params[action == 'add_customer' ? :customer_vault : :type] = action
|
|
228
|
+
params[:username] = @options[:login]
|
|
229
|
+
params[:password] = @options[:password]
|
|
230
|
+
|
|
231
|
+
raw_response = ssl_post(url, post_data(action, params), headers)
|
|
232
|
+
response = parse(raw_response)
|
|
233
|
+
succeeded = success_from(response)
|
|
234
|
+
|
|
235
|
+
Response.new(
|
|
236
|
+
succeeded,
|
|
237
|
+
message_from(succeeded, response),
|
|
238
|
+
response,
|
|
239
|
+
authorization: authorization_from(response, params[:payment]),
|
|
240
|
+
avs_result: AVSResult.new(code: response[:avsresponse]),
|
|
241
|
+
cvv_result: CVVResult.new(response[:cvvresponse]),
|
|
242
|
+
test: test?
|
|
243
|
+
)
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
def authorization_from(response, payment_type)
|
|
247
|
+
[ response[:transactionid], payment_type ].join('#')
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def split_authorization(authorization)
|
|
251
|
+
authorization.split('#')
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
def headers
|
|
255
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' }
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
def post_data(action, params)
|
|
259
|
+
params.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
def url
|
|
263
|
+
test? ? test_url : live_url
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
def parse(body)
|
|
267
|
+
Hash[CGI::parse(body).map { |k, v| [k.intern, v.first] }]
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
def success_from(response)
|
|
271
|
+
response[:response] == '1'
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
def message_from(succeeded, response)
|
|
275
|
+
if succeeded
|
|
276
|
+
'Succeeded'
|
|
277
|
+
else
|
|
278
|
+
response[:responsetext]
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
end
|
|
18
283
|
end
|
|
19
284
|
end
|
|
20
|
-
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
|
+
|
|
2
3
|
require 'rexml/document'
|
|
3
4
|
|
|
4
5
|
module ActiveMerchant #:nodoc:
|
|
@@ -119,20 +120,18 @@ module ActiveMerchant #:nodoc:
|
|
|
119
120
|
'KO' => 'N',
|
|
120
121
|
'NO' => 'R' }
|
|
121
122
|
|
|
122
|
-
SUCCESS_MESSAGE =
|
|
123
|
+
SUCCESS_MESSAGE = 'The transaction was successful'
|
|
124
|
+
|
|
125
|
+
THREE_D_SECURE_DISPLAY_WAYS = { :main_window => 'MAINW', # display the identification page in the main window (default value).
|
|
123
126
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
:pop_up => 'POPUP', # display the identification page in a pop-up window
|
|
127
|
-
# and return to the main window at the end.
|
|
128
|
-
:pop_ix => 'POPIX' } # display the identification page in a pop-up window
|
|
129
|
-
# and remain in the pop-up window.
|
|
127
|
+
:pop_up => 'POPUP', # display the identification page in a pop-up window and return to the main window at the end.
|
|
128
|
+
:pop_ix => 'POPIX' } # display the identification page in a pop-up window and remain in the pop-up window.
|
|
130
129
|
|
|
131
|
-
OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE =
|
|
130
|
+
OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE = 'Signature usage will be the default for a future release of ActiveMerchant. You should either begin using it, or update your configuration to explicitly disable it (signature_encryptor: none)'
|
|
132
131
|
OGONE_STORE_OPTION_DEPRECATION_MESSAGE = "The 'store' option has been renamed to 'billing_id', and its usage is deprecated."
|
|
133
132
|
|
|
134
|
-
self.test_url =
|
|
135
|
-
self.live_url =
|
|
133
|
+
self.test_url = 'https://secure.ogone.com/ncol/test/'
|
|
134
|
+
self.live_url = 'https://secure.ogone.com/ncol/prod/'
|
|
136
135
|
|
|
137
136
|
self.supported_countries = ['BE', 'DE', 'FR', 'NL', 'AT', 'CH']
|
|
138
137
|
# also supports Airplus and UATP
|
|
@@ -141,7 +140,6 @@ module ActiveMerchant #:nodoc:
|
|
|
141
140
|
self.display_name = 'Ogone'
|
|
142
141
|
self.default_currency = 'EUR'
|
|
143
142
|
self.money_format = :cents
|
|
144
|
-
self.ssl_version = :TLSv1
|
|
145
143
|
|
|
146
144
|
def initialize(options = {})
|
|
147
145
|
requires!(options, :login, :user, :password)
|
|
@@ -151,12 +149,13 @@ module ActiveMerchant #:nodoc:
|
|
|
151
149
|
# Verify and reserve the specified amount on the account, without actually doing the transaction.
|
|
152
150
|
def authorize(money, payment_source, options = {})
|
|
153
151
|
post = {}
|
|
152
|
+
action = payment_source.brand == 'mastercard' ? 'PAU' : 'RES'
|
|
154
153
|
add_invoice(post, options)
|
|
155
154
|
add_payment_source(post, payment_source, options)
|
|
156
155
|
add_address(post, payment_source, options)
|
|
157
156
|
add_customer_data(post, options)
|
|
158
157
|
add_money(post, money, options)
|
|
159
|
-
commit(
|
|
158
|
+
commit(action, post)
|
|
160
159
|
end
|
|
161
160
|
|
|
162
161
|
# Verify and transfer the specified amount.
|
|
@@ -192,7 +191,7 @@ module ActiveMerchant #:nodoc:
|
|
|
192
191
|
# Credit the specified account by a specific amount.
|
|
193
192
|
def credit(money, identification_or_credit_card, options = {})
|
|
194
193
|
if reference_transaction?(identification_or_credit_card)
|
|
195
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
194
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
196
195
|
# Referenced credit: refund of a settled transaction
|
|
197
196
|
refund(money, identification_or_credit_card, options)
|
|
198
197
|
else # must be a credit card or card reference
|
|
@@ -205,23 +204,42 @@ module ActiveMerchant #:nodoc:
|
|
|
205
204
|
perform_reference_credit(money, reference, options)
|
|
206
205
|
end
|
|
207
206
|
|
|
207
|
+
def verify(credit_card, options={})
|
|
208
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
209
|
+
r.process { authorize(100, credit_card, options) }
|
|
210
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
208
214
|
# Store a credit card by creating an Ogone Alias
|
|
209
215
|
def store(payment_source, options = {})
|
|
210
|
-
options
|
|
216
|
+
options[:alias_operation] = 'BYPSP' unless(options.has_key?(:billing_id) || options.has_key?(:store))
|
|
211
217
|
response = authorize(@options[:store_amount] || 1, payment_source, options)
|
|
212
218
|
void(response.authorization) if response.success?
|
|
213
219
|
response
|
|
214
220
|
end
|
|
215
221
|
|
|
222
|
+
def supports_scrubbing?
|
|
223
|
+
true
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
def scrub(transcript)
|
|
227
|
+
transcript.
|
|
228
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
|
229
|
+
gsub(%r((&?cardno=)[^&]*)i, '\1[FILTERED]').
|
|
230
|
+
gsub(%r((&?cvc=)[^&]*)i, '\1[FILTERED]').
|
|
231
|
+
gsub(%r((&?pswd=)[^&]*)i, '\1[FILTERED]')
|
|
232
|
+
end
|
|
233
|
+
|
|
216
234
|
private
|
|
217
235
|
|
|
218
236
|
def reference_from(authorization)
|
|
219
|
-
authorization.split(
|
|
237
|
+
authorization.split(';').first
|
|
220
238
|
end
|
|
221
239
|
|
|
222
240
|
def reference_transaction?(identifier)
|
|
223
241
|
return false unless identifier.is_a?(String)
|
|
224
|
-
_, action = identifier.split(
|
|
242
|
+
_, action = identifier.split(';')
|
|
225
243
|
!action.nil?
|
|
226
244
|
end
|
|
227
245
|
|
|
@@ -251,7 +269,7 @@ module ActiveMerchant #:nodoc:
|
|
|
251
269
|
add_eci(post, options[:eci] || '9')
|
|
252
270
|
else
|
|
253
271
|
if options.has_key?(:store)
|
|
254
|
-
deprecated OGONE_STORE_OPTION_DEPRECATION_MESSAGE
|
|
272
|
+
ActiveMerchant.deprecated OGONE_STORE_OPTION_DEPRECATION_MESSAGE
|
|
255
273
|
options[:billing_id] ||= options[:store]
|
|
256
274
|
end
|
|
257
275
|
add_alias(post, options[:billing_id], options[:alias_operation])
|
|
@@ -267,11 +285,13 @@ module ActiveMerchant #:nodoc:
|
|
|
267
285
|
THREE_D_SECURE_DISPLAY_WAYS[:main_window]
|
|
268
286
|
add_pair post, 'WIN3DS', win_3ds
|
|
269
287
|
|
|
270
|
-
add_pair post, 'HTTP_ACCEPT', options[:http_accept] ||
|
|
288
|
+
add_pair post, 'HTTP_ACCEPT', options[:http_accept] || '*/*'
|
|
271
289
|
add_pair post, 'HTTP_USER_AGENT', options[:http_user_agent] if options[:http_user_agent]
|
|
272
290
|
add_pair post, 'ACCEPTURL', options[:accept_url] if options[:accept_url]
|
|
273
291
|
add_pair post, 'DECLINEURL', options[:decline_url] if options[:decline_url]
|
|
274
292
|
add_pair post, 'EXCEPTIONURL', options[:exception_url] if options[:exception_url]
|
|
293
|
+
add_pair post, 'CANCELURL', options[:cancel_url] if options[:cancel_url]
|
|
294
|
+
add_pair post, 'PARAMVAR', options[:paramvar] if options[:paramvar]
|
|
275
295
|
add_pair post, 'PARAMPLUS', options[:paramplus] if options[:paramplus]
|
|
276
296
|
add_pair post, 'COMPLUS', options[:complus] if options[:complus]
|
|
277
297
|
add_pair post, 'LANGUAGE', options[:language] if options[:language]
|
|
@@ -281,8 +301,8 @@ module ActiveMerchant #:nodoc:
|
|
|
281
301
|
add_pair post, 'ECI', eci.to_s
|
|
282
302
|
end
|
|
283
303
|
|
|
284
|
-
def add_alias(post,
|
|
285
|
-
add_pair post, 'ALIAS',
|
|
304
|
+
def add_alias(post, alias_name, alias_operation = nil)
|
|
305
|
+
add_pair post, 'ALIAS', alias_name
|
|
286
306
|
add_pair post, 'ALIASOPERATION', alias_operation unless alias_operation.nil?
|
|
287
307
|
end
|
|
288
308
|
|
|
@@ -312,12 +332,13 @@ module ActiveMerchant #:nodoc:
|
|
|
312
332
|
def add_invoice(post, options)
|
|
313
333
|
add_pair post, 'orderID', options[:order_id] || generate_unique_id[0...30]
|
|
314
334
|
add_pair post, 'COM', options[:description]
|
|
335
|
+
add_pair post, 'ORIG', options[:origin] if options[:origin]
|
|
315
336
|
end
|
|
316
337
|
|
|
317
338
|
def add_creditcard(post, creditcard)
|
|
318
339
|
add_pair post, 'CN', creditcard.name
|
|
319
340
|
add_pair post, 'CARDNO', creditcard.number
|
|
320
|
-
add_pair post, 'ED',
|
|
341
|
+
add_pair post, 'ED', '%02d%02s' % [creditcard.month, creditcard.year.to_s[-2..-1]]
|
|
321
342
|
add_pair post, 'CVC', creditcard.verification_value
|
|
322
343
|
end
|
|
323
344
|
|
|
@@ -327,14 +348,15 @@ module ActiveMerchant #:nodoc:
|
|
|
327
348
|
|
|
328
349
|
# Add HTML_ANSWER element (3-D Secure specific to the response's params)
|
|
329
350
|
# Note: HTML_ANSWER is not an attribute so we add it "by hand" to the response
|
|
330
|
-
if html_answer = REXML::XPath.first(xml_root,
|
|
331
|
-
response[
|
|
351
|
+
if html_answer = REXML::XPath.first(xml_root, '//HTML_ANSWER')
|
|
352
|
+
response['HTML_ANSWER'] = html_answer.text
|
|
332
353
|
end
|
|
333
354
|
|
|
334
355
|
response
|
|
335
356
|
end
|
|
336
357
|
|
|
337
358
|
def commit(action, parameters)
|
|
359
|
+
add_pair parameters, 'RTIMEOUT', @options[:timeout] if @options[:timeout]
|
|
338
360
|
add_pair parameters, 'PSPID', @options[:login]
|
|
339
361
|
add_pair parameters, 'USERID', @options[:user]
|
|
340
362
|
add_pair parameters, 'PSWD', @options[:password]
|
|
@@ -342,27 +364,27 @@ module ActiveMerchant #:nodoc:
|
|
|
342
364
|
response = parse(ssl_post(url(parameters['PAYID']), post_data(action, parameters)))
|
|
343
365
|
|
|
344
366
|
options = {
|
|
345
|
-
:authorization => [response[
|
|
367
|
+
:authorization => [response['PAYID'], action].join(';'),
|
|
346
368
|
:test => test?,
|
|
347
|
-
:avs_result => { :code => AVS_MAPPING[response[
|
|
348
|
-
:cvv_result => CVV_MAPPING[response[
|
|
369
|
+
:avs_result => { :code => AVS_MAPPING[response['AAVCheck']] },
|
|
370
|
+
:cvv_result => CVV_MAPPING[response['CVCCheck']]
|
|
349
371
|
}
|
|
350
372
|
OgoneResponse.new(successful?(response), message_from(response), response, options)
|
|
351
373
|
end
|
|
352
374
|
|
|
353
375
|
def url(payid)
|
|
354
|
-
(test? ? test_url : live_url) + (payid ?
|
|
376
|
+
(test? ? test_url : live_url) + (payid ? 'maintenancedirect.asp' : 'orderdirect.asp')
|
|
355
377
|
end
|
|
356
378
|
|
|
357
379
|
def successful?(response)
|
|
358
|
-
response[
|
|
380
|
+
response['NCERROR'] == '0'
|
|
359
381
|
end
|
|
360
382
|
|
|
361
383
|
def message_from(response)
|
|
362
384
|
if successful?(response)
|
|
363
385
|
SUCCESS_MESSAGE
|
|
364
386
|
else
|
|
365
|
-
format_error_message(response[
|
|
387
|
+
format_error_message(response['NCERRORPLUS'])
|
|
366
388
|
end
|
|
367
389
|
end
|
|
368
390
|
|
|
@@ -370,9 +392,9 @@ module ActiveMerchant #:nodoc:
|
|
|
370
392
|
raw_message = message.to_s.strip
|
|
371
393
|
case raw_message
|
|
372
394
|
when /\|/
|
|
373
|
-
raw_message.split(
|
|
395
|
+
raw_message.split('|').join(', ').capitalize
|
|
374
396
|
when /\//
|
|
375
|
-
raw_message.split(
|
|
397
|
+
raw_message.split('/').first.to_s.capitalize
|
|
376
398
|
else
|
|
377
399
|
raw_message.to_s.capitalize
|
|
378
400
|
end
|
|
@@ -386,27 +408,48 @@ module ActiveMerchant #:nodoc:
|
|
|
386
408
|
|
|
387
409
|
def add_signature(parameters)
|
|
388
410
|
if @options[:signature].blank?
|
|
389
|
-
|
|
390
|
-
|
|
411
|
+
ActiveMerchant.deprecated(OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE) unless(@options[:signature_encryptor] == 'none')
|
|
412
|
+
return
|
|
391
413
|
end
|
|
392
414
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
415
|
+
add_pair parameters, 'SHASign', calculate_signature(parameters, @options[:signature_encryptor], @options[:signature])
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
def calculate_signature(signed_parameters, algorithm, secret)
|
|
419
|
+
return legacy_calculate_signature(signed_parameters, secret) unless algorithm
|
|
420
|
+
|
|
421
|
+
sha_encryptor = case algorithm
|
|
422
|
+
when 'sha256'
|
|
423
|
+
Digest::SHA256
|
|
424
|
+
when 'sha512'
|
|
425
|
+
Digest::SHA512
|
|
426
|
+
when 'sha1'
|
|
427
|
+
Digest::SHA1
|
|
404
428
|
else
|
|
405
|
-
|
|
429
|
+
raise "Unknown signature algorithm #{algorithm}"
|
|
406
430
|
end
|
|
407
|
-
string_to_digest << @options[:signature]
|
|
408
431
|
|
|
409
|
-
|
|
432
|
+
filtered_params = signed_parameters.select { |k, v| !v.blank? }
|
|
433
|
+
sha_encryptor.hexdigest(
|
|
434
|
+
filtered_params.sort_by { |k, v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('')
|
|
435
|
+
).upcase
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
def legacy_calculate_signature(parameters, secret)
|
|
439
|
+
Digest::SHA1.hexdigest(
|
|
440
|
+
(
|
|
441
|
+
%w(
|
|
442
|
+
orderID
|
|
443
|
+
amount
|
|
444
|
+
currency
|
|
445
|
+
CARDNO
|
|
446
|
+
PSPID
|
|
447
|
+
Operation
|
|
448
|
+
ALIAS
|
|
449
|
+
).map { |key| parameters[key] } +
|
|
450
|
+
[secret]
|
|
451
|
+
).join('')
|
|
452
|
+
).upcase
|
|
410
453
|
end
|
|
411
454
|
|
|
412
455
|
def add_pair(post, key, value)
|