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
|
@@ -20,8 +20,8 @@ module ActiveMerchant #:nodoc:
|
|
|
20
20
|
|
|
21
21
|
class_attribute :test_url, :live_url
|
|
22
22
|
|
|
23
|
-
self.test_url =
|
|
24
|
-
self.live_url =
|
|
23
|
+
self.test_url = 'https://secure.metricsglobalgateway.com/gateway/transact.dll?testing=true'
|
|
24
|
+
self.live_url = 'https://secure.metricsglobalgateway.com/gateway/transact.dll'
|
|
25
25
|
|
|
26
26
|
class_attribute :duplicate_window
|
|
27
27
|
|
|
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
|
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
def credit(money, identification, options = {})
|
|
153
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
153
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
154
154
|
refund(money, identification, options)
|
|
155
155
|
end
|
|
156
156
|
|
|
@@ -213,14 +213,14 @@ module ActiveMerchant #:nodoc:
|
|
|
213
213
|
post[:version] = API_VERSION
|
|
214
214
|
post[:login] = @options[:login]
|
|
215
215
|
post[:tran_key] = @options[:password]
|
|
216
|
-
post[:relay_response] =
|
|
216
|
+
post[:relay_response] = 'FALSE'
|
|
217
217
|
post[:type] = action
|
|
218
|
-
post[:delim_data] =
|
|
219
|
-
post[:delim_char] =
|
|
220
|
-
post[:encap_char] =
|
|
221
|
-
post[:solution_ID] = application_id if application_id
|
|
218
|
+
post[:delim_data] = 'TRUE'
|
|
219
|
+
post[:delim_char] = ','
|
|
220
|
+
post[:encap_char] = '$'
|
|
221
|
+
post[:solution_ID] = application_id if application_id
|
|
222
222
|
|
|
223
|
-
request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join(
|
|
223
|
+
request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
224
224
|
request
|
|
225
225
|
end
|
|
226
226
|
|
|
@@ -284,39 +284,20 @@ module ActiveMerchant #:nodoc:
|
|
|
284
284
|
end
|
|
285
285
|
end
|
|
286
286
|
|
|
287
|
-
# Make a ruby type out of the response string
|
|
288
|
-
def normalize(field)
|
|
289
|
-
case field
|
|
290
|
-
when "true" then true
|
|
291
|
-
when "false" then false
|
|
292
|
-
when "" then nil
|
|
293
|
-
when "null" then nil
|
|
294
|
-
else field
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
|
-
|
|
298
287
|
def message_from(results)
|
|
299
288
|
if results[:response_code] == DECLINED
|
|
300
|
-
return CVVResult.messages[
|
|
289
|
+
return CVVResult.messages[results[:card_code]] if CARD_CODE_ERRORS.include?(results[:card_code])
|
|
301
290
|
if AVS_REASON_CODES.include?(results[:response_reason_code]) && AVS_ERRORS.include?(results[:avs_result_code])
|
|
302
|
-
return AVSResult.messages[
|
|
291
|
+
return AVSResult.messages[results[:avs_result_code]]
|
|
303
292
|
end
|
|
304
293
|
end
|
|
305
294
|
|
|
306
295
|
(results[:response_reason_text] ? results[:response_reason_text].chomp('.') : '')
|
|
307
296
|
end
|
|
308
297
|
|
|
309
|
-
def expdate(creditcard)
|
|
310
|
-
year = sprintf("%.4i", creditcard.year)
|
|
311
|
-
month = sprintf("%.2i", creditcard.month)
|
|
312
|
-
|
|
313
|
-
"#{month}#{year[-2..-1]}"
|
|
314
|
-
end
|
|
315
|
-
|
|
316
298
|
def split(response)
|
|
317
299
|
response[1..-2].split(/\$,\$/)
|
|
318
300
|
end
|
|
319
|
-
|
|
320
301
|
end
|
|
321
302
|
end
|
|
322
303
|
end
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class MicropaymentGateway < Gateway
|
|
4
|
+
|
|
5
|
+
self.display_name = 'micropayment'
|
|
6
|
+
self.homepage_url = 'https://www.micropayment.de/'
|
|
7
|
+
|
|
8
|
+
self.test_url = self.live_url = 'https://sipg.micropayment.de/public/creditcardpsp/v1/nvp/'
|
|
9
|
+
|
|
10
|
+
self.supported_countries = %w(DE)
|
|
11
|
+
self.default_currency = 'EUR'
|
|
12
|
+
self.money_format = :cents
|
|
13
|
+
self.supported_cardtypes = [:visa, :master, :american_express]
|
|
14
|
+
|
|
15
|
+
def initialize(options={})
|
|
16
|
+
requires!(options, :access_key)
|
|
17
|
+
super
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def purchase(amount, payment_method, options={})
|
|
21
|
+
post = {}
|
|
22
|
+
add_invoice(post, amount, options)
|
|
23
|
+
add_payment_method(post, payment_method, options)
|
|
24
|
+
add_customer_data(post, options)
|
|
25
|
+
add_address(post, options)
|
|
26
|
+
commit('purchase', post)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def authorize(amount, payment_method, options={})
|
|
30
|
+
post = {}
|
|
31
|
+
add_invoice(post, amount, options)
|
|
32
|
+
add_payment_method(post, payment_method, options)
|
|
33
|
+
add_customer_data(post, options)
|
|
34
|
+
add_address(post, options)
|
|
35
|
+
commit('authorize', post)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def capture(amount, authorization, options={})
|
|
39
|
+
post = {}
|
|
40
|
+
add_reference(post, authorization)
|
|
41
|
+
add_invoice(post, amount, options)
|
|
42
|
+
commit('capture', post)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def void(authorization, options={})
|
|
46
|
+
post = {}
|
|
47
|
+
add_reference(post, authorization)
|
|
48
|
+
commit('void', post)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def refund(amount, authorization, options={})
|
|
52
|
+
post = {}
|
|
53
|
+
add_reference(post, authorization)
|
|
54
|
+
add_invoice(post, amount, options)
|
|
55
|
+
commit('refund', post)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def verify(credit_card, options={})
|
|
59
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
60
|
+
r.process { authorize(250, credit_card, options) }
|
|
61
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def supports_scrubbing?
|
|
66
|
+
true
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def scrub(transcript)
|
|
70
|
+
transcript.
|
|
71
|
+
gsub(%r((accessKey=)\w+), '\1[FILTERED]').
|
|
72
|
+
gsub(%r((number=)\d+), '\1[FILTERED]').
|
|
73
|
+
gsub(%r((cvc2=)\d+), '\1[FILTERED]')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
private
|
|
77
|
+
|
|
78
|
+
def add_invoice(post, money, options)
|
|
79
|
+
if money
|
|
80
|
+
post[:amount] = amount(money)
|
|
81
|
+
post[:currency] = options[:currency] || currency(money)
|
|
82
|
+
end
|
|
83
|
+
post[:project] = options[:project] if options[:project]
|
|
84
|
+
post['params[title]'] = options[:description] if options[:description]
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def add_payment_method(post, payment_method, options={})
|
|
88
|
+
post[:number] = payment_method.number
|
|
89
|
+
post[:recurring] = 1 if options[:recurring] == true
|
|
90
|
+
post[:cvc2] = payment_method.verification_value
|
|
91
|
+
post[:expiryYear] = format(payment_method.year, :four_digits)
|
|
92
|
+
post[:expiryMonth] = format(payment_method.month, :two_digits)
|
|
93
|
+
|
|
94
|
+
post['params[firstname]'] = payment_method.first_name
|
|
95
|
+
post['params[surname]'] = payment_method.last_name
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def add_customer_data(post, options)
|
|
99
|
+
post['params[email]'] = options[:email] if options[:email]
|
|
100
|
+
post['params[ip]'] = options[:ip] || '1.1.1.1'
|
|
101
|
+
post['params[sendMail]'] = options[:send_mail] || 'false'
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def add_address(post, options)
|
|
105
|
+
address = options[:billing_address]
|
|
106
|
+
return unless address
|
|
107
|
+
|
|
108
|
+
post['params[address]'] = address[:address1] if address[:address1]
|
|
109
|
+
post['params[zipcode]'] = address[:zip] if address[:zip]
|
|
110
|
+
post['params[town]'] = address[:city] if address[:city]
|
|
111
|
+
post['params[country]'] = address[:country] if address[:country]
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def add_reference(post, authorization)
|
|
115
|
+
session_id, transaction_id = split_authorization(authorization)
|
|
116
|
+
post[:sessionId] = session_id
|
|
117
|
+
post[:transactionId] = transaction_id
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def commit(action, params)
|
|
121
|
+
params[:testMode] = 1 if test?
|
|
122
|
+
params[:accessKey] = @options[:access_key]
|
|
123
|
+
params[:apiKey] = @options[:api_key] || 'af1fd841af792f4c50131414ff76e004'
|
|
124
|
+
|
|
125
|
+
response = parse(ssl_post(url(action), post_data(action, params), headers))
|
|
126
|
+
|
|
127
|
+
Response.new(
|
|
128
|
+
succeeded = success_from(response),
|
|
129
|
+
message_from(succeeded, response),
|
|
130
|
+
response,
|
|
131
|
+
authorization: authorization_from(response, params),
|
|
132
|
+
avs_result: AVSResult.new(code: response['some_avs_result_key']),
|
|
133
|
+
cvv_result: CVVResult.new(response['some_cvv_result_key']),
|
|
134
|
+
test: test?
|
|
135
|
+
)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def headers
|
|
139
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' }
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def post_data(action, params)
|
|
143
|
+
params.map { |k, v| "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" }.join('&')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def url(action)
|
|
147
|
+
action_url = test? ? test_url : live_url
|
|
148
|
+
"#{action_url}?action=#{action}"
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def parse(body)
|
|
152
|
+
body.split(/\r?\n/).inject({}) do |acc, pair|
|
|
153
|
+
key, value = pair.split('=')
|
|
154
|
+
acc[key] = CGI.unescape(value)
|
|
155
|
+
acc
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def success_from(response)
|
|
160
|
+
response['error'] == '0' &&
|
|
161
|
+
response['transactionResultCode'] == '00' &&
|
|
162
|
+
response['transactionStatus'] == 'SUCCESS'
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def message_from(succeeded, response)
|
|
166
|
+
if succeeded
|
|
167
|
+
'Succeeded'
|
|
168
|
+
else
|
|
169
|
+
response['errorMessage'] || response['transactionResultMessage']
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def split_authorization(authorization)
|
|
174
|
+
authorization.split('|')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def authorization_from(response, request_params)
|
|
178
|
+
session_id = response['sessionId'] || request_params[:sessionId]
|
|
179
|
+
"#{session_id}|#{response["transactionId"]}"
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
|
|
3
|
-
require 'digest/md5' # Used in add_secure_hash
|
|
1
|
+
require 'active_merchant/billing/gateways/migs/migs_codes'
|
|
4
2
|
|
|
5
3
|
module ActiveMerchant #:nodoc:
|
|
6
4
|
module Billing #:nodoc:
|
|
@@ -19,12 +17,13 @@ module ActiveMerchant #:nodoc:
|
|
|
19
17
|
# MiGS is supported throughout Asia Pacific, Middle East and Africa
|
|
20
18
|
# MiGS is used in Australia (AU) by ANZ (eGate), CBA (CommWeb) and more
|
|
21
19
|
# Source of Country List: http://www.scribd.com/doc/17811923
|
|
22
|
-
self.supported_countries = %w(AU AE BD BN EG HK ID
|
|
20
|
+
self.supported_countries = %w(AU AE BD BN EG HK ID JO KW LB LK MU MV MY NZ OM PH QA SA SG TT VN)
|
|
23
21
|
|
|
24
22
|
# The card types supported by the payment gateway
|
|
25
23
|
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
|
|
26
24
|
|
|
27
25
|
self.money_format = :cents
|
|
26
|
+
self.currencies_without_fractions = %w(IDR)
|
|
28
27
|
|
|
29
28
|
# The homepage URL of the gateway
|
|
30
29
|
self.homepage_url = 'http://mastercard.com/mastercardsps'
|
|
@@ -58,10 +57,12 @@ module ActiveMerchant #:nodoc:
|
|
|
58
57
|
requires!(options, :order_id)
|
|
59
58
|
|
|
60
59
|
post = {}
|
|
61
|
-
|
|
60
|
+
|
|
61
|
+
add_amount(post, money, options)
|
|
62
62
|
add_invoice(post, options)
|
|
63
63
|
add_creditcard(post, creditcard)
|
|
64
64
|
add_standard_parameters('pay', post, options[:unique_id])
|
|
65
|
+
add_3ds(post, options)
|
|
65
66
|
|
|
66
67
|
commit(post)
|
|
67
68
|
end
|
|
@@ -78,7 +79,8 @@ module ActiveMerchant #:nodoc:
|
|
|
78
79
|
requires!(@options, :advanced_login, :advanced_password)
|
|
79
80
|
|
|
80
81
|
post = options.merge(:TransNo => authorization)
|
|
81
|
-
|
|
82
|
+
|
|
83
|
+
add_amount(post, money, options)
|
|
82
84
|
add_advanced_user(post)
|
|
83
85
|
add_standard_parameters('capture', post, options[:unique_id])
|
|
84
86
|
|
|
@@ -93,18 +95,37 @@ module ActiveMerchant #:nodoc:
|
|
|
93
95
|
requires!(@options, :advanced_login, :advanced_password)
|
|
94
96
|
|
|
95
97
|
post = options.merge(:TransNo => authorization)
|
|
96
|
-
|
|
98
|
+
|
|
99
|
+
add_amount(post, money, options)
|
|
97
100
|
add_advanced_user(post)
|
|
98
101
|
add_standard_parameters('refund', post, options[:unique_id])
|
|
99
102
|
|
|
100
103
|
commit(post)
|
|
101
104
|
end
|
|
102
105
|
|
|
106
|
+
def void(authorization, options = {})
|
|
107
|
+
requires!(@options, :advanced_login, :advanced_password)
|
|
108
|
+
|
|
109
|
+
post = options.merge(:TransNo => authorization)
|
|
110
|
+
|
|
111
|
+
add_advanced_user(post)
|
|
112
|
+
add_standard_parameters('voidAuthorisation', post, options[:unique_id])
|
|
113
|
+
|
|
114
|
+
commit(post)
|
|
115
|
+
end
|
|
116
|
+
|
|
103
117
|
def credit(money, authorization, options = {})
|
|
104
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
118
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
105
119
|
refund(money, authorization, options)
|
|
106
120
|
end
|
|
107
121
|
|
|
122
|
+
def verify(credit_card, options={})
|
|
123
|
+
MultiResponse.run do |r|
|
|
124
|
+
r.process { authorize(100, credit_card, options) }
|
|
125
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
108
129
|
# Checks the status of a previous transaction
|
|
109
130
|
# This can be useful when a response is not received due to network issues
|
|
110
131
|
#
|
|
@@ -143,14 +164,13 @@ module ActiveMerchant #:nodoc:
|
|
|
143
164
|
requires!(@options, :secure_hash)
|
|
144
165
|
|
|
145
166
|
post = {}
|
|
146
|
-
|
|
167
|
+
|
|
168
|
+
add_amount(post, money, options)
|
|
147
169
|
add_invoice(post, options)
|
|
148
170
|
add_creditcard_type(post, options[:card_type]) if options[:card_type]
|
|
149
171
|
|
|
150
|
-
post
|
|
151
|
-
|
|
152
|
-
:ReturnURL => options[:return_url]
|
|
153
|
-
)
|
|
172
|
+
post[:Locale] = options[:locale] || 'en'
|
|
173
|
+
post[:ReturnURL] = options[:return_url]
|
|
154
174
|
|
|
155
175
|
add_standard_parameters('pay', post, options[:unique_id])
|
|
156
176
|
|
|
@@ -170,9 +190,9 @@ module ActiveMerchant #:nodoc:
|
|
|
170
190
|
|
|
171
191
|
response_hash = parse(data)
|
|
172
192
|
|
|
173
|
-
expected_secure_hash = calculate_secure_hash(response_hash
|
|
193
|
+
expected_secure_hash = calculate_secure_hash(response_hash, @options[:secure_hash])
|
|
174
194
|
unless response_hash[:SecureHash] == expected_secure_hash
|
|
175
|
-
raise SecurityError,
|
|
195
|
+
raise SecurityError, 'Secure Hash mismatch, response may be tampered with'
|
|
176
196
|
end
|
|
177
197
|
|
|
178
198
|
response_object(response_hash)
|
|
@@ -182,8 +202,27 @@ module ActiveMerchant #:nodoc:
|
|
|
182
202
|
@options[:login].start_with?('TEST')
|
|
183
203
|
end
|
|
184
204
|
|
|
205
|
+
def supports_scrubbing?
|
|
206
|
+
true
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
def scrub(transcript)
|
|
210
|
+
transcript.
|
|
211
|
+
gsub(%r((&?CardNum=)\d*(&?)), '\1[FILTERED]\2').
|
|
212
|
+
gsub(%r((&?CardSecurityCode=)\d*(&?)), '\1[FILTERED]\2').
|
|
213
|
+
gsub(%r((&?AccessCode=)[^&]*(&?)), '\1[FILTERED]\2').
|
|
214
|
+
gsub(%r((&?Password=)[^&]*(&?)), '\1[FILTERED]\2').
|
|
215
|
+
gsub(%r((&?3DSXID=)[^&]*(&?)), '\1[FILTERED]\2').
|
|
216
|
+
gsub(%r((&?VerToken=)[^&]*(&?)), '\1[FILTERED]\2')
|
|
217
|
+
end
|
|
218
|
+
|
|
185
219
|
private
|
|
186
220
|
|
|
221
|
+
def add_amount(post, money, options)
|
|
222
|
+
post[:Amount] = localized_amount(money, options[:currency])
|
|
223
|
+
post[:Currency] = options[:currency] if options[:currency]
|
|
224
|
+
end
|
|
225
|
+
|
|
187
226
|
def add_advanced_user(post)
|
|
188
227
|
post[:User] = @options[:advanced_login]
|
|
189
228
|
post[:Password] = @options[:advanced_password]
|
|
@@ -193,6 +232,15 @@ module ActiveMerchant #:nodoc:
|
|
|
193
232
|
post[:OrderInfo] = options[:order_id]
|
|
194
233
|
end
|
|
195
234
|
|
|
235
|
+
def add_3ds(post, options)
|
|
236
|
+
post[:VerType] = options[:ver_type] if options[:ver_type]
|
|
237
|
+
post[:VerToken] = options[:ver_token] if options[:ver_token]
|
|
238
|
+
post['3DSXID'] = options[:three_ds_xid] if options[:three_ds_xid]
|
|
239
|
+
post['3DSECI'] = options[:three_ds_eci] if options[:three_ds_eci]
|
|
240
|
+
post['3DSenrolled'] = options[:three_ds_enrolled] if options[:three_ds_enrolled]
|
|
241
|
+
post['3DSstatus'] = options[:three_ds_status] if options[:three_ds_status]
|
|
242
|
+
end
|
|
243
|
+
|
|
196
244
|
def add_creditcard(post, creditcard)
|
|
197
245
|
post[:CardNum] = creditcard.number
|
|
198
246
|
post[:CardSecurityCode] = creditcard.verification_value if creditcard.verification_value?
|
|
@@ -201,7 +249,7 @@ module ActiveMerchant #:nodoc:
|
|
|
201
249
|
|
|
202
250
|
def add_creditcard_type(post, card_type)
|
|
203
251
|
post[:Gateway] = 'ssl'
|
|
204
|
-
post[:card] = CARD_TYPES.detect{|ct| ct.am_code == card_type}.migs_long_code
|
|
252
|
+
post[:card] = CARD_TYPES.detect { |ct| ct.am_code == card_type }.migs_long_code
|
|
205
253
|
end
|
|
206
254
|
|
|
207
255
|
def parse(body)
|
|
@@ -214,18 +262,25 @@ module ActiveMerchant #:nodoc:
|
|
|
214
262
|
end
|
|
215
263
|
|
|
216
264
|
def commit(post)
|
|
265
|
+
add_secure_hash(post) if @options[:secure_hash]
|
|
217
266
|
data = ssl_post self.merchant_hosted_url, post_data(post)
|
|
218
267
|
response_hash = parse(data)
|
|
219
268
|
response_object(response_hash)
|
|
220
269
|
end
|
|
221
270
|
|
|
222
271
|
def response_object(response)
|
|
272
|
+
avs_response_code = response[:AVSResultCode]
|
|
273
|
+
avs_response_code = 'S' if avs_response_code == 'Unsupported'
|
|
274
|
+
|
|
275
|
+
cvv_result_code = response[:CSCResultCode]
|
|
276
|
+
cvv_result_code = 'P' if cvv_result_code == 'Unsupported'
|
|
277
|
+
|
|
223
278
|
Response.new(success?(response), response[:Message], response,
|
|
224
279
|
:test => test?,
|
|
225
280
|
:authorization => response[:TransactionNo],
|
|
226
281
|
:fraud_review => fraud_review?(response),
|
|
227
|
-
:avs_result => { :code =>
|
|
228
|
-
:cvv_result =>
|
|
282
|
+
:avs_result => { :code => avs_response_code },
|
|
283
|
+
:cvv_result => cvv_result_code
|
|
229
284
|
)
|
|
230
285
|
end
|
|
231
286
|
|
|
@@ -248,17 +303,21 @@ module ActiveMerchant #:nodoc:
|
|
|
248
303
|
end
|
|
249
304
|
|
|
250
305
|
def post_data(post)
|
|
251
|
-
post.collect { |key, value| "vpc_#{key}=#{CGI.escape(value.to_s)}" }.join(
|
|
306
|
+
post.collect { |key, value| "vpc_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
252
307
|
end
|
|
253
308
|
|
|
254
309
|
def add_secure_hash(post)
|
|
255
310
|
post[:SecureHash] = calculate_secure_hash(post, @options[:secure_hash])
|
|
311
|
+
post[:SecureHashType] = 'SHA256'
|
|
256
312
|
end
|
|
257
313
|
|
|
258
314
|
def calculate_secure_hash(post, secure_hash)
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
315
|
+
input = post.
|
|
316
|
+
reject { |k| %i[SecureHash SecureHashType].include?(k) }.
|
|
317
|
+
sort.
|
|
318
|
+
map { |(k, v)| "vpc_#{k}=#{v}" }.
|
|
319
|
+
join('&')
|
|
320
|
+
OpenSSL::HMAC.hexdigest('SHA256', [secure_hash].pack('H*'), input).upcase
|
|
262
321
|
end
|
|
263
322
|
end
|
|
264
323
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'active_merchant/billing/gateways/modern_payments_cim'
|
|
2
2
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
@@ -19,7 +19,7 @@ module ActiveMerchant #:nodoc:
|
|
|
19
19
|
customer_response = cim.create_customer(options)
|
|
20
20
|
return customer_response unless customer_response.success?
|
|
21
21
|
|
|
22
|
-
customer_id = customer_response.params[
|
|
22
|
+
customer_id = customer_response.params['create_customer_result']
|
|
23
23
|
|
|
24
24
|
card_response = cim.modify_customer_credit_card(customer_id, credit_card)
|
|
25
25
|
return card_response unless card_response.success?
|
|
@@ -28,10 +28,10 @@ module ActiveMerchant #:nodoc:
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
private
|
|
31
|
+
|
|
31
32
|
def cim
|
|
32
33
|
@cim ||= ModernPaymentsCimGateway.new(@options)
|
|
33
34
|
end
|
|
34
35
|
end
|
|
35
36
|
end
|
|
36
37
|
end
|
|
37
|
-
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
|
3
3
|
class ModernPaymentsCimGateway < Gateway #:nodoc:
|
|
4
|
-
self.test_url =
|
|
4
|
+
self.test_url = 'https://secure.modpay.com/netservices/test/ModpayTest.asmx'
|
|
5
5
|
self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'
|
|
6
6
|
|
|
7
|
-
LIVE_XMLNS =
|
|
8
|
-
TEST_XMLNS =
|
|
7
|
+
LIVE_XMLNS = 'https://secure.modpay.com/ws/'
|
|
8
|
+
TEST_XMLNS = 'https://secure.modpay.com/netservices/test/'
|
|
9
9
|
|
|
10
10
|
self.supported_countries = ['US']
|
|
11
11
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
|
12
12
|
self.homepage_url = 'http://www.modpay.com'
|
|
13
13
|
self.display_name = 'Modern Payments'
|
|
14
14
|
|
|
15
|
-
SUCCESS_MESSAGE =
|
|
16
|
-
FAILURE_MESSAGE =
|
|
17
|
-
ERROR_MESSAGE =
|
|
15
|
+
SUCCESS_MESSAGE = 'Transaction accepted'
|
|
16
|
+
FAILURE_MESSAGE = 'Transaction failed'
|
|
17
|
+
ERROR_MESSAGE = 'Transaction error'
|
|
18
18
|
|
|
19
19
|
PAYMENT_METHOD = {
|
|
20
20
|
:check => 1,
|
|
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def modify_customer_credit_card(customer_id, credit_card)
|
|
38
|
-
raise ArgumentError,
|
|
38
|
+
raise ArgumentError, 'The customer_id cannot be blank' if customer_id.blank?
|
|
39
39
|
|
|
40
40
|
post = {}
|
|
41
41
|
add_customer_id(post, customer_id)
|
|
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def authorize_credit_card_payment(customer_id, amount)
|
|
48
|
-
raise ArgumentError,
|
|
48
|
+
raise ArgumentError, 'The customer_id cannot be blank' if customer_id.blank?
|
|
49
49
|
|
|
50
50
|
post = {}
|
|
51
51
|
add_customer_id(post, customer_id)
|
|
@@ -55,7 +55,7 @@ module ActiveMerchant #:nodoc:
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def create_payment(customer_id, amount, options = {})
|
|
58
|
-
raise ArgumentError,
|
|
58
|
+
raise ArgumentError, 'The customer_id cannot be blank' if customer_id.blank?
|
|
59
59
|
|
|
60
60
|
post = {}
|
|
61
61
|
add_customer_id(post, customer_id)
|
|
@@ -66,8 +66,9 @@ module ActiveMerchant #:nodoc:
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
private
|
|
69
|
+
|
|
69
70
|
def add_payment_details(post, options)
|
|
70
|
-
post[:pmtDate] = (options[:payment_date] || Time.now.utc).strftime(
|
|
71
|
+
post[:pmtDate] = (options[:payment_date] || Time.now.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
71
72
|
post[:pmtType] = PAYMENT_METHOD[options[:payment_method] || :credit_card]
|
|
72
73
|
end
|
|
73
74
|
|
|
@@ -87,9 +88,7 @@ module ActiveMerchant #:nodoc:
|
|
|
87
88
|
address = options[:billing_address] || options[:address] || {}
|
|
88
89
|
|
|
89
90
|
if name = address[:name]
|
|
90
|
-
|
|
91
|
-
post[:lastName] = segments.pop
|
|
92
|
-
post[:firstName] = segments.join(' ')
|
|
91
|
+
post[:firstName], post[:lastName] = split_names(name)
|
|
93
92
|
else
|
|
94
93
|
post[:firstName] = address[:first_name]
|
|
95
94
|
post[:lastName] = address[:last_name]
|
|
@@ -120,10 +119,10 @@ module ActiveMerchant #:nodoc:
|
|
|
120
119
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } do
|
|
121
120
|
|
|
122
121
|
xml.tag! 'env:Body' do
|
|
123
|
-
xml.tag! action, {
|
|
124
|
-
xml.tag!
|
|
125
|
-
xml.tag!
|
|
126
|
-
params.each {|key, value| xml.tag! key, value }
|
|
122
|
+
xml.tag! action, { 'xmlns' => xmlns(action) } do
|
|
123
|
+
xml.tag! 'clientId', @options[:login]
|
|
124
|
+
xml.tag! 'clientCode', @options[:password]
|
|
125
|
+
params.each { |key, value| xml.tag! key, value }
|
|
127
126
|
end
|
|
128
127
|
end
|
|
129
128
|
end
|
|
@@ -148,9 +147,9 @@ module ActiveMerchant #:nodoc:
|
|
|
148
147
|
|
|
149
148
|
def commit(action, params)
|
|
150
149
|
data = ssl_post(url(action), build_request(action, params),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
{ 'Content-Type' =>'text/xml; charset=utf-8',
|
|
151
|
+
'SOAPAction' => "#{xmlns(action)}#{action}" }
|
|
152
|
+
)
|
|
154
153
|
|
|
155
154
|
response = parse(action, data)
|
|
156
155
|
Response.new(successful?(action, response), message_from(action, response), response,
|
|
@@ -165,14 +164,14 @@ module ActiveMerchant #:nodoc:
|
|
|
165
164
|
end
|
|
166
165
|
|
|
167
166
|
def authorization_key(action)
|
|
168
|
-
action ==
|
|
167
|
+
action == 'AuthorizeCreditCardPayment' ? :trans_id : "#{action.underscore}_result".to_sym
|
|
169
168
|
end
|
|
170
169
|
|
|
171
170
|
def successful?(action, response)
|
|
172
171
|
key = authorization_key(action)
|
|
173
172
|
|
|
174
173
|
if key == :trans_id
|
|
175
|
-
response[:approved] ==
|
|
174
|
+
response[:approved] == 'true'
|
|
176
175
|
else
|
|
177
176
|
response[key].to_i > 0
|
|
178
177
|
end
|
|
@@ -197,7 +196,7 @@ module ActiveMerchant #:nodoc:
|
|
|
197
196
|
root.elements.to_a.each do |node|
|
|
198
197
|
parse_element(response, node)
|
|
199
198
|
end
|
|
200
|
-
elsif root = REXML::XPath.first(xml,
|
|
199
|
+
elsif root = REXML::XPath.first(xml, '//soap:Fault')
|
|
201
200
|
root.elements.to_a.each do |node|
|
|
202
201
|
response[node.name.underscore.to_sym] = node.text
|
|
203
202
|
end
|
|
@@ -208,7 +207,7 @@ module ActiveMerchant #:nodoc:
|
|
|
208
207
|
|
|
209
208
|
def parse_element(response, node)
|
|
210
209
|
if node.has_elements?
|
|
211
|
-
node.elements.each{|e| parse_element(response, e) }
|
|
210
|
+
node.elements.each { |e| parse_element(response, e) }
|
|
212
211
|
else
|
|
213
212
|
response[node.name.underscore.to_sym] = node.text.to_s.strip
|
|
214
213
|
end
|
|
@@ -216,4 +215,3 @@ module ActiveMerchant #:nodoc:
|
|
|
216
215
|
end
|
|
217
216
|
end
|
|
218
217
|
end
|
|
219
|
-
|