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
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
require 'nokogiri'
|
|
2
|
+
|
|
3
|
+
module ActiveMerchant #:nodoc:
|
|
4
|
+
module Billing #:nodoc:
|
|
5
|
+
#
|
|
6
|
+
# == Monei gateway
|
|
7
|
+
# This class implements Monei gateway for Active Merchant. For more information about Monei
|
|
8
|
+
# gateway please go to http://www.monei.net
|
|
9
|
+
#
|
|
10
|
+
# === Setup
|
|
11
|
+
# In order to set-up the gateway you need four paramaters: sender_id, channel_id, login and pwd.
|
|
12
|
+
# Request that data to Monei.
|
|
13
|
+
class MoneiGateway < Gateway
|
|
14
|
+
self.test_url = 'https://test.monei-api.net/payment/ctpe'
|
|
15
|
+
self.live_url = 'https://monei-api.net/payment/ctpe'
|
|
16
|
+
|
|
17
|
+
self.supported_countries = ['AD', 'AT', 'BE', 'BG', 'CA', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FO', 'FR', 'GB', 'GI', 'GR', 'HU', 'IE', 'IL', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'TR', 'US', 'VA']
|
|
18
|
+
self.default_currency = 'EUR'
|
|
19
|
+
self.supported_cardtypes = [:visa, :master, :maestro, :jcb, :american_express]
|
|
20
|
+
|
|
21
|
+
self.homepage_url = 'http://www.monei.net/'
|
|
22
|
+
self.display_name = 'Monei'
|
|
23
|
+
|
|
24
|
+
# Constructor
|
|
25
|
+
#
|
|
26
|
+
# options - Hash containing the gateway credentials, ALL MANDATORY
|
|
27
|
+
# :sender_id Sender ID
|
|
28
|
+
# :channel_id Channel ID
|
|
29
|
+
# :login User login
|
|
30
|
+
# :pwd User password
|
|
31
|
+
#
|
|
32
|
+
def initialize(options={})
|
|
33
|
+
requires!(options, :sender_id, :channel_id, :login, :pwd)
|
|
34
|
+
super
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Public: Performs purchase operation
|
|
38
|
+
#
|
|
39
|
+
# money - Amount of purchase
|
|
40
|
+
# credit_card - Credit card
|
|
41
|
+
# options - Hash containing purchase options
|
|
42
|
+
# :order_id Merchant created id for the purchase
|
|
43
|
+
# :billing_address Hash with billing address information
|
|
44
|
+
# :description Merchant created purchase description (optional)
|
|
45
|
+
# :currency Sale currency to override money object or default (optional)
|
|
46
|
+
#
|
|
47
|
+
# Returns Active Merchant response object
|
|
48
|
+
def purchase(money, credit_card, options={})
|
|
49
|
+
execute_new_order(:purchase, money, credit_card, options)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Public: Performs authorization operation
|
|
53
|
+
#
|
|
54
|
+
# money - Amount to authorize
|
|
55
|
+
# credit_card - Credit card
|
|
56
|
+
# options - Hash containing authorization options
|
|
57
|
+
# :order_id Merchant created id for the authorization
|
|
58
|
+
# :billing_address Hash with billing address information
|
|
59
|
+
# :description Merchant created authorization description (optional)
|
|
60
|
+
# :currency Sale currency to override money object or default (optional)
|
|
61
|
+
#
|
|
62
|
+
# Returns Active Merchant response object
|
|
63
|
+
def authorize(money, credit_card, options={})
|
|
64
|
+
execute_new_order(:authorize, money, credit_card, options)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Public: Performs capture operation on previous authorization
|
|
68
|
+
#
|
|
69
|
+
# money - Amount to capture
|
|
70
|
+
# authorization - Reference to previous authorization, obtained from response object returned by authorize
|
|
71
|
+
# options - Hash containing capture options
|
|
72
|
+
# :order_id Merchant created id for the authorization (optional)
|
|
73
|
+
# :description Merchant created authorization description (optional)
|
|
74
|
+
# :currency Sale currency to override money object or default (optional)
|
|
75
|
+
#
|
|
76
|
+
# Note: you should pass either order_id or description
|
|
77
|
+
#
|
|
78
|
+
# Returns Active Merchant response object
|
|
79
|
+
def capture(money, authorization, options={})
|
|
80
|
+
execute_dependant(:capture, money, authorization, options)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Public: Refunds from previous purchase
|
|
84
|
+
#
|
|
85
|
+
# money - Amount to refund
|
|
86
|
+
# authorization - Reference to previous purchase, obtained from response object returned by purchase
|
|
87
|
+
# options - Hash containing refund options
|
|
88
|
+
# :order_id Merchant created id for the authorization (optional)
|
|
89
|
+
# :description Merchant created authorization description (optional)
|
|
90
|
+
# :currency Sale currency to override money object or default (optional)
|
|
91
|
+
#
|
|
92
|
+
# Note: you should pass either order_id or description
|
|
93
|
+
#
|
|
94
|
+
# Returns Active Merchant response object
|
|
95
|
+
def refund(money, authorization, options={})
|
|
96
|
+
execute_dependant(:refund, money, authorization, options)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Public: Voids previous authorization
|
|
100
|
+
#
|
|
101
|
+
# authorization - Reference to previous authorization, obtained from response object returned by authorize
|
|
102
|
+
# options - Hash containing capture options
|
|
103
|
+
# :order_id Merchant created id for the authorization (optional)
|
|
104
|
+
#
|
|
105
|
+
# Returns Active Merchant response object
|
|
106
|
+
def void(authorization, options={})
|
|
107
|
+
execute_dependant(:void, nil, authorization, options)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Public: Verifies credit card. Does this by doing a authorization of 1.00 Euro and then voiding it.
|
|
111
|
+
#
|
|
112
|
+
# credit_card - Credit card
|
|
113
|
+
# options - Hash containing authorization options
|
|
114
|
+
# :order_id Merchant created id for the authorization
|
|
115
|
+
# :billing_address Hash with billing address information
|
|
116
|
+
# :description Merchant created authorization description (optional)
|
|
117
|
+
# :currency Sale currency to override money object or default (optional)
|
|
118
|
+
#
|
|
119
|
+
# Returns Active Merchant response object of Authorization operation
|
|
120
|
+
def verify(credit_card, options={})
|
|
121
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
122
|
+
r.process { authorize(100, credit_card, options) }
|
|
123
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
private
|
|
128
|
+
|
|
129
|
+
# Private: Execute purchase or authorize operation
|
|
130
|
+
def execute_new_order(action, money, credit_card, options)
|
|
131
|
+
request = build_request do |xml|
|
|
132
|
+
add_identification_new_order(xml, options)
|
|
133
|
+
add_payment(xml, action, money, options)
|
|
134
|
+
add_account(xml, credit_card)
|
|
135
|
+
add_customer(xml, credit_card, options)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
commit(request)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Private: Execute operation that depends on authorization code from previous purchase or authorize operation
|
|
142
|
+
def execute_dependant(action, money, authorization, options)
|
|
143
|
+
request = build_request do |xml|
|
|
144
|
+
add_identification_authorization(xml, authorization, options)
|
|
145
|
+
add_payment(xml, action, money, options)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
commit(request)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Private: Build XML wrapping code yielding to code to fill the transaction information
|
|
152
|
+
def build_request
|
|
153
|
+
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
|
154
|
+
xml.Request(:version => '1.0') do
|
|
155
|
+
xml.Header { xml.Security(:sender => @options[:sender_id]) }
|
|
156
|
+
xml.Transaction(:mode => test? ? 'CONNECTOR_TEST' : 'LIVE', :response => 'SYNC', :channel => @options[:channel_id]) do
|
|
157
|
+
xml.User(:login => @options[:login], :pwd => @options[:pwd])
|
|
158
|
+
yield xml
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
builder.to_xml
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Private: Add identification part to XML for new orders
|
|
166
|
+
def add_identification_new_order(xml, options)
|
|
167
|
+
requires!(options, :order_id)
|
|
168
|
+
xml.Identification do
|
|
169
|
+
xml.TransactionID options[:order_id]
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Private: Add identification part to XML for orders that depend on authorization from previous operation
|
|
174
|
+
def add_identification_authorization(xml, authorization, options)
|
|
175
|
+
xml.Identification do
|
|
176
|
+
xml.ReferenceID authorization
|
|
177
|
+
xml.TransactionID options[:order_id]
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Private: Add payment part to XML
|
|
182
|
+
def add_payment(xml, action, money, options)
|
|
183
|
+
code = tanslate_payment_code(action)
|
|
184
|
+
|
|
185
|
+
xml.Payment(:code => code) do
|
|
186
|
+
xml.Presentation do
|
|
187
|
+
xml.Amount amount(money)
|
|
188
|
+
xml.Currency options[:currency] || currency(money)
|
|
189
|
+
xml.Usage options[:description] || options[:order_id]
|
|
190
|
+
end unless money.nil?
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Private: Add account part to XML
|
|
195
|
+
def add_account(xml, credit_card)
|
|
196
|
+
xml.Account do
|
|
197
|
+
xml.Holder credit_card.name
|
|
198
|
+
xml.Number credit_card.number
|
|
199
|
+
xml.Brand credit_card.brand.upcase
|
|
200
|
+
xml.Expiry(:month => credit_card.month, :year => credit_card.year)
|
|
201
|
+
xml.Verification credit_card.verification_value
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Private: Add customer part to XML
|
|
206
|
+
def add_customer(xml, credit_card, options)
|
|
207
|
+
requires!(options, :billing_address)
|
|
208
|
+
address = options[:billing_address]
|
|
209
|
+
xml.Customer do
|
|
210
|
+
xml.Name do
|
|
211
|
+
xml.Given credit_card.first_name
|
|
212
|
+
xml.Family credit_card.last_name
|
|
213
|
+
end
|
|
214
|
+
xml.Address do
|
|
215
|
+
xml.Street address[:address1].to_s
|
|
216
|
+
xml.Zip address[:zip].to_s
|
|
217
|
+
xml.City address[:city].to_s
|
|
218
|
+
xml.State address[:state].to_s if address.has_key? :state
|
|
219
|
+
xml.Country address[:country].to_s
|
|
220
|
+
end
|
|
221
|
+
xml.Contact do
|
|
222
|
+
xml.Email options[:email] || 'noemail@monei.net'
|
|
223
|
+
xml.Ip options[:ip] || '0.0.0.0'
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Private: Parse XML response from Monei servers
|
|
229
|
+
def parse(body)
|
|
230
|
+
xml = Nokogiri::XML(body)
|
|
231
|
+
{
|
|
232
|
+
:unique_id => xml.xpath('//Response/Transaction/Identification/UniqueID').text,
|
|
233
|
+
:status => translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
|
|
234
|
+
:reason => translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
|
|
235
|
+
:message => xml.xpath('//Response/Transaction/Processing/Return').text
|
|
236
|
+
}
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Private: Send XML transaction to Monei servers and create AM response
|
|
240
|
+
def commit(xml)
|
|
241
|
+
url = (test? ? test_url : live_url)
|
|
242
|
+
|
|
243
|
+
response = parse(ssl_post(url, post_data(xml), 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'))
|
|
244
|
+
|
|
245
|
+
Response.new(
|
|
246
|
+
success_from(response),
|
|
247
|
+
message_from(response),
|
|
248
|
+
response,
|
|
249
|
+
authorization: authorization_from(response),
|
|
250
|
+
test: test?,
|
|
251
|
+
error_code: error_code_from(response)
|
|
252
|
+
)
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Private: Decide success from servers response
|
|
256
|
+
def success_from(response)
|
|
257
|
+
response[:status] == :success || response[:status] == :new
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Private: Get message from servers response
|
|
261
|
+
def message_from(response)
|
|
262
|
+
response[:message]
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Private: Get error code from servers response
|
|
266
|
+
def error_code_from(response)
|
|
267
|
+
success_from(response) ? nil : STANDARD_ERROR_CODE[:card_declined]
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Private: Get authorization code from servers response
|
|
271
|
+
def authorization_from(response)
|
|
272
|
+
response[:unique_id]
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Private: Encode POST parameters
|
|
276
|
+
def post_data(xml)
|
|
277
|
+
"load=#{CGI.escape(xml)}"
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Private: Translate Monei status code to native ruby symbols
|
|
281
|
+
def translate_status_code(code)
|
|
282
|
+
{
|
|
283
|
+
'00' => :success,
|
|
284
|
+
'40' => :neutral,
|
|
285
|
+
'59' => :waiting_bank,
|
|
286
|
+
'60' => :rejected_bank,
|
|
287
|
+
'64' => :waiting_risk,
|
|
288
|
+
'65' => :rejected_risk,
|
|
289
|
+
'70' => :rejected_validation,
|
|
290
|
+
'80' => :waiting,
|
|
291
|
+
'90' => :new
|
|
292
|
+
}[code]
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Private: Translate AM operations to Monei operations codes
|
|
296
|
+
def tanslate_payment_code(action)
|
|
297
|
+
{
|
|
298
|
+
:purchase => 'CC.DB',
|
|
299
|
+
:authorize => 'CC.PA',
|
|
300
|
+
:capture => 'CC.CP',
|
|
301
|
+
:refund => 'CC.RF',
|
|
302
|
+
:void => 'CC.RV'
|
|
303
|
+
}[action]
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
end
|
|
@@ -2,7 +2,6 @@ require 'rexml/document'
|
|
|
2
2
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
5
|
-
|
|
6
5
|
# To learn more about the Moneris gateway, please contact
|
|
7
6
|
# eselectplus@moneris.com for a copy of their integration guide. For
|
|
8
7
|
# information on remote testing, please see "Test Environment Penny Value
|
|
@@ -33,7 +32,9 @@ module ActiveMerchant #:nodoc:
|
|
|
33
32
|
def initialize(options = {})
|
|
34
33
|
requires!(options, :login, :password)
|
|
35
34
|
@cvv_enabled = options[:cvv_enabled]
|
|
36
|
-
|
|
35
|
+
@avs_enabled = options[:avs_enabled]
|
|
36
|
+
@cof_enabled = options[:cof_enabled]
|
|
37
|
+
options[:crypt_type] = 7 unless options.has_key?(:crypt_type)
|
|
37
38
|
super
|
|
38
39
|
end
|
|
39
40
|
|
|
@@ -45,12 +46,19 @@ module ActiveMerchant #:nodoc:
|
|
|
45
46
|
def authorize(money, creditcard_or_datakey, options = {})
|
|
46
47
|
requires!(options, :order_id)
|
|
47
48
|
post = {}
|
|
48
|
-
add_payment_source(post, creditcard_or_datakey)
|
|
49
|
-
post[:amount]
|
|
50
|
-
post[:order_id]
|
|
51
|
-
post[:
|
|
49
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
|
50
|
+
post[:amount] = amount(money)
|
|
51
|
+
post[:order_id] = options[:order_id]
|
|
52
|
+
post[:address] = options[:billing_address] || options[:address]
|
|
52
53
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
|
53
|
-
|
|
54
|
+
add_cof(post, options) if @cof_enabled
|
|
55
|
+
action = if post[:cavv]
|
|
56
|
+
'cavv_preauth'
|
|
57
|
+
elsif post[:data_key].blank?
|
|
58
|
+
'preauth'
|
|
59
|
+
else
|
|
60
|
+
'res_preauth_cc'
|
|
61
|
+
end
|
|
54
62
|
commit(action, post)
|
|
55
63
|
end
|
|
56
64
|
|
|
@@ -61,12 +69,19 @@ module ActiveMerchant #:nodoc:
|
|
|
61
69
|
def purchase(money, creditcard_or_datakey, options = {})
|
|
62
70
|
requires!(options, :order_id)
|
|
63
71
|
post = {}
|
|
64
|
-
add_payment_source(post, creditcard_or_datakey)
|
|
65
|
-
post[:amount]
|
|
66
|
-
post[:order_id]
|
|
67
|
-
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]
|
|
68
76
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
|
69
|
-
|
|
77
|
+
add_cof(post, options) if @cof_enabled
|
|
78
|
+
action = if post[:cavv]
|
|
79
|
+
'cavv_purchase'
|
|
80
|
+
elsif post[:data_key].blank?
|
|
81
|
+
'purchase'
|
|
82
|
+
else
|
|
83
|
+
'res_purchase_cc'
|
|
84
|
+
end
|
|
70
85
|
commit(action, post)
|
|
71
86
|
end
|
|
72
87
|
|
|
@@ -111,7 +126,7 @@ module ActiveMerchant #:nodoc:
|
|
|
111
126
|
# Moneris interface consistent with other gateways. (See +capture+ for
|
|
112
127
|
# details.)
|
|
113
128
|
def credit(money, authorization, options = {})
|
|
114
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
129
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
115
130
|
refund(money, authorization, options)
|
|
116
131
|
end
|
|
117
132
|
|
|
@@ -119,6 +134,13 @@ module ActiveMerchant #:nodoc:
|
|
|
119
134
|
commit 'refund', crediting_params(authorization, :amount => amount(money))
|
|
120
135
|
end
|
|
121
136
|
|
|
137
|
+
def verify(credit_card, options={})
|
|
138
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
139
|
+
r.process { authorize(100, credit_card, options) }
|
|
140
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
122
144
|
def store(credit_card, options = {})
|
|
123
145
|
post = {}
|
|
124
146
|
post[:pan] = credit_card.number
|
|
@@ -142,22 +164,51 @@ module ActiveMerchant #:nodoc:
|
|
|
142
164
|
commit('res_update_cc', post)
|
|
143
165
|
end
|
|
144
166
|
|
|
167
|
+
def supports_scrubbing?
|
|
168
|
+
true
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def scrub(transcript)
|
|
172
|
+
transcript.
|
|
173
|
+
gsub(%r((<store_id>).+(</store_id>)), '\1[FILTERED]\2').
|
|
174
|
+
gsub(%r((<api_token>).+(</api_token>)), '\1[FILTERED]\2').
|
|
175
|
+
gsub(%r((<pan>).+(</pan>)), '\1[FILTERED]\2').
|
|
176
|
+
gsub(%r((<cvd_value>).+(</cvd_value>)), '\1[FILTERED]\2').
|
|
177
|
+
gsub(%r((<cavv>).+(</cavv>)), '\1[FILTERED]\2')
|
|
178
|
+
end
|
|
179
|
+
|
|
145
180
|
private # :nodoc: all
|
|
146
181
|
|
|
147
182
|
def expdate(creditcard)
|
|
148
|
-
sprintf(
|
|
183
|
+
sprintf('%.4i', creditcard.year)[-2..-1] + sprintf('%.2i', creditcard.month)
|
|
149
184
|
end
|
|
150
185
|
|
|
151
|
-
def add_payment_source(post,
|
|
152
|
-
if
|
|
153
|
-
post[:data_key]
|
|
186
|
+
def add_payment_source(post, payment_method, options)
|
|
187
|
+
if payment_method.is_a?(String)
|
|
188
|
+
post[:data_key] = payment_method
|
|
189
|
+
post[:cust_id] = options[:customer]
|
|
154
190
|
else
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
191
|
+
if payment_method.respond_to?(:track_data) && payment_method.track_data.present?
|
|
192
|
+
post[:pos_code] = '00'
|
|
193
|
+
post[:track2] = payment_method.track_data
|
|
194
|
+
else
|
|
195
|
+
post[:pan] = payment_method.number
|
|
196
|
+
post[:expdate] = expdate(payment_method)
|
|
197
|
+
post[:cvd_value] = payment_method.verification_value if payment_method.verification_value?
|
|
198
|
+
post[:cavv] = payment_method.payment_cryptogram if payment_method.is_a?(NetworkTokenizationCreditCard)
|
|
199
|
+
post[:wallet_indicator] = wallet_indicator(payment_method.source.to_s) if payment_method.is_a?(NetworkTokenizationCreditCard)
|
|
200
|
+
post[:crypt_type] = (payment_method.eci || 7) if payment_method.is_a?(NetworkTokenizationCreditCard)
|
|
201
|
+
end
|
|
202
|
+
post[:cust_id] = options[:customer] || payment_method.name
|
|
158
203
|
end
|
|
159
204
|
end
|
|
160
205
|
|
|
206
|
+
def add_cof(post, options)
|
|
207
|
+
post[:issuer_id] = options[:issuer_id] if options[:issuer_id]
|
|
208
|
+
post[:payment_indicator] = options[:payment_indicator] if options[:payment_indicator]
|
|
209
|
+
post[:payment_information] = options[:payment_information] if options[:payment_information]
|
|
210
|
+
end
|
|
211
|
+
|
|
161
212
|
# Common params used amongst the +credit+, +void+ and +capture+ methods
|
|
162
213
|
def crediting_params(authorization, options = {})
|
|
163
214
|
{
|
|
@@ -183,11 +234,14 @@ module ActiveMerchant #:nodoc:
|
|
|
183
234
|
raw = ssl_post(url, data)
|
|
184
235
|
response = parse(raw)
|
|
185
236
|
|
|
186
|
-
Response.new(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
237
|
+
Response.new(
|
|
238
|
+
successful?(response),
|
|
239
|
+
message_from(response[:message]),
|
|
240
|
+
response,
|
|
241
|
+
:test => test?,
|
|
242
|
+
:avs_result => {:code => response[:avs_result_code]},
|
|
243
|
+
:cvv_result => response[:cvd_result_code] && response[:cvd_result_code][-1, 1],
|
|
244
|
+
:authorization => authorization_from(response))
|
|
191
245
|
end
|
|
192
246
|
|
|
193
247
|
# Generates a Moneris authorization string of the form 'trans_id;receipt_id'.
|
|
@@ -201,11 +255,11 @@ module ActiveMerchant #:nodoc:
|
|
|
201
255
|
def successful?(response)
|
|
202
256
|
response[:response_code] &&
|
|
203
257
|
response[:complete] &&
|
|
204
|
-
(0..49).
|
|
258
|
+
(0..49).cover?(response[:response_code].to_i)
|
|
205
259
|
end
|
|
206
260
|
|
|
207
261
|
def parse(xml)
|
|
208
|
-
response = { :message =>
|
|
262
|
+
response = { :message => 'Global Error Receipt', :complete => false }
|
|
209
263
|
hashify_xml!(xml, response)
|
|
210
264
|
response
|
|
211
265
|
end
|
|
@@ -219,10 +273,10 @@ module ActiveMerchant #:nodoc:
|
|
|
219
273
|
end
|
|
220
274
|
|
|
221
275
|
def post_data(action, parameters = {})
|
|
222
|
-
xml
|
|
223
|
-
root
|
|
224
|
-
root.add_element(
|
|
225
|
-
root.add_element(
|
|
276
|
+
xml = REXML::Document.new
|
|
277
|
+
root = xml.add_element('request')
|
|
278
|
+
root.add_element('store_id').text = options[:login]
|
|
279
|
+
root.add_element('api_token').text = options[:password]
|
|
226
280
|
root.add_element(transaction_element(action, parameters))
|
|
227
281
|
|
|
228
282
|
xml.to_s
|
|
@@ -233,8 +287,13 @@ module ActiveMerchant #:nodoc:
|
|
|
233
287
|
|
|
234
288
|
# Must add the elements in the correct order
|
|
235
289
|
actions[action].each do |key|
|
|
236
|
-
|
|
237
|
-
|
|
290
|
+
case key
|
|
291
|
+
when :avs_info
|
|
292
|
+
transaction.add_element(avs_element(parameters[:address])) if @avs_enabled && parameters[:address]
|
|
293
|
+
when :cvd_info
|
|
294
|
+
transaction.add_element(cvd_element(parameters[:cvd_value])) if @cvv_enabled
|
|
295
|
+
when :cof_info
|
|
296
|
+
transaction.add_element(credential_on_file(parameters)) if @cof_enabled && cof_details_present?(parameters)
|
|
238
297
|
else
|
|
239
298
|
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
|
|
240
299
|
end
|
|
@@ -243,52 +302,75 @@ module ActiveMerchant #:nodoc:
|
|
|
243
302
|
transaction
|
|
244
303
|
end
|
|
245
304
|
|
|
305
|
+
def avs_element(address)
|
|
306
|
+
full_address = "#{address[:address1]} #{address[:address2]}"
|
|
307
|
+
tokens = full_address.split(/\s+/)
|
|
308
|
+
|
|
309
|
+
element = REXML::Element.new('avs_info')
|
|
310
|
+
element.add_element('avs_street_number').text = tokens.select { |x| x =~ /\d/ }.join(' ')
|
|
311
|
+
element.add_element('avs_street_name').text = tokens.reject { |x| x =~ /\d/ }.join(' ')
|
|
312
|
+
element.add_element('avs_zipcode').text = address[:zip]
|
|
313
|
+
element
|
|
314
|
+
end
|
|
315
|
+
|
|
246
316
|
def cvd_element(cvd_value)
|
|
247
317
|
element = REXML::Element.new('cvd_info')
|
|
248
318
|
if cvd_value
|
|
249
|
-
element.add_element('cvd_indicator').text =
|
|
319
|
+
element.add_element('cvd_indicator').text = '1'
|
|
250
320
|
element.add_element('cvd_value').text = cvd_value
|
|
251
321
|
else
|
|
252
|
-
element.add_element('cvd_indicator').text =
|
|
322
|
+
element.add_element('cvd_indicator').text = '0'
|
|
253
323
|
end
|
|
254
324
|
element
|
|
255
325
|
end
|
|
256
326
|
|
|
257
|
-
def
|
|
258
|
-
|
|
259
|
-
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
|
327
|
+
def cof_details_present?(parameters)
|
|
328
|
+
parameters[:issuer_id] && parameters[:payment_indicator] && parameters[:payment_information]
|
|
260
329
|
end
|
|
261
330
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
331
|
+
def credential_on_file(parameters)
|
|
332
|
+
issuer_id = parameters[:issuer_id]
|
|
333
|
+
payment_indicator = parameters[:payment_indicator]
|
|
334
|
+
payment_information = parameters[:payment_information]
|
|
335
|
+
|
|
336
|
+
cof_info = REXML::Element.new('cof_info')
|
|
337
|
+
cof_info.add_element('issuer_id').text = issuer_id
|
|
338
|
+
cof_info.add_element('payment_indicator').text = payment_indicator
|
|
339
|
+
cof_info.add_element('payment_information').text = payment_information
|
|
340
|
+
cof_info
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def wallet_indicator(token_source)
|
|
344
|
+
return 'APP' if token_source == 'apple_pay'
|
|
345
|
+
return 'ANP' if token_source == 'android_pay'
|
|
346
|
+
nil
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
def message_from(message)
|
|
350
|
+
return 'Unspecified error' if message.blank?
|
|
351
|
+
message.gsub(/[^\w]/, ' ').split.join(' ').capitalize
|
|
270
352
|
end
|
|
271
353
|
|
|
272
354
|
def actions
|
|
273
355
|
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
356
|
+
'purchase' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code, :cof_info],
|
|
357
|
+
'preauth' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code, :cof_info],
|
|
358
|
+
'command' => [:order_id],
|
|
359
|
+
'refund' => [:order_id, :amount, :txn_number, :crypt_type],
|
|
360
|
+
'indrefund' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
|
361
|
+
'completion' => [:order_id, :comp_amount, :txn_number, :crypt_type],
|
|
362
|
+
'purchasecorrection' => [:order_id, :txn_number, :crypt_type],
|
|
363
|
+
'cavv_preauth' => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
|
|
364
|
+
'cavv_purchase' => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
|
|
365
|
+
'transact' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
|
366
|
+
'Batchcloseall' => [],
|
|
367
|
+
'opentotals' => [:ecr_number],
|
|
368
|
+
'batchclose' => [:ecr_number],
|
|
369
|
+
'res_add_cc' => [:pan, :expdate, :crypt_type, :cof_info],
|
|
370
|
+
'res_delete' => [:data_key],
|
|
371
|
+
'res_update_cc' => [:data_key, :pan, :expdate, :crypt_type],
|
|
372
|
+
'res_purchase_cc' => [:data_key, :order_id, :cust_id, :amount, :crypt_type, :cof_info],
|
|
373
|
+
'res_preauth_cc' => [:data_key, :order_id, :cust_id, :amount, :crypt_type, :cof_info]
|
|
292
374
|
}
|
|
293
375
|
end
|
|
294
376
|
end
|