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,356 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class CredoraxGateway < Gateway
|
|
4
|
+
class_attribute :test_url, :live_na_url, :live_eu_url
|
|
5
|
+
|
|
6
|
+
self.display_name = 'Credorax Gateway'
|
|
7
|
+
self.homepage_url = 'https://www.credorax.com/'
|
|
8
|
+
|
|
9
|
+
self.test_url = 'https://intconsole.credorax.com/intenv/service/gateway'
|
|
10
|
+
|
|
11
|
+
# The live URL is assigned on a per merchant basis once certification has passed
|
|
12
|
+
# See the Credorax remote tests for the full certification test suite
|
|
13
|
+
#
|
|
14
|
+
# Once you have your assigned subdomain, you can override the live URL in your application via:
|
|
15
|
+
# ActiveMerchant::Billing::CredoraxGateway.live_url = "https://assigned-subdomain.credorax.net/crax_gate/service/gateway"
|
|
16
|
+
self.live_url = 'https://assigned-subdomain.credorax.net/crax_gate/service/gateway'
|
|
17
|
+
|
|
18
|
+
self.supported_countries = %w(DE GB FR IT ES PL NL BE GR CZ PT SE HU RS AT CH BG DK FI SK NO IE HR BA AL LT MK SI LV EE ME LU MT IS AD MC LI SM)
|
|
19
|
+
self.default_currency = 'EUR'
|
|
20
|
+
self.currencies_without_fractions = %w(CLP JPY KRW PYG VND)
|
|
21
|
+
self.currencies_with_three_decimal_places = %w(BHD JOD KWD OMR RSD TND)
|
|
22
|
+
|
|
23
|
+
self.money_format = :cents
|
|
24
|
+
self.supported_cardtypes = [:visa, :master, :maestro]
|
|
25
|
+
|
|
26
|
+
RESPONSE_MESSAGES = {
|
|
27
|
+
'00' => 'Approved or completed successfully',
|
|
28
|
+
'01' => 'Refer to card issuer',
|
|
29
|
+
'02' => 'Refer to card issuer special condition',
|
|
30
|
+
'03' => 'Invalid merchant',
|
|
31
|
+
'04' => 'Pick up card',
|
|
32
|
+
'05' => 'Do not Honour',
|
|
33
|
+
'06' => 'Error',
|
|
34
|
+
'07' => 'Pick up card special condition',
|
|
35
|
+
'08' => 'Honour with identification',
|
|
36
|
+
'09' => 'Request in progress',
|
|
37
|
+
'10' => 'Approved for partial amount',
|
|
38
|
+
'11' => 'Approved (VIP)',
|
|
39
|
+
'12' => 'Invalid transaction',
|
|
40
|
+
'13' => 'Invalid amount',
|
|
41
|
+
'14' => 'Invalid card number',
|
|
42
|
+
'15' => 'No such issuer',
|
|
43
|
+
'16' => 'Approved, update track 3',
|
|
44
|
+
'17' => 'Customer cancellation',
|
|
45
|
+
'18' => 'Customer dispute',
|
|
46
|
+
'19' => 'Re-enter transaction',
|
|
47
|
+
'20' => 'Invalid response',
|
|
48
|
+
'21' => 'No action taken',
|
|
49
|
+
'22' => 'Suspected malfunction',
|
|
50
|
+
'23' => 'Unacceptable transaction fee',
|
|
51
|
+
'24' => 'File update not supported by receiver',
|
|
52
|
+
'25' => 'No such record',
|
|
53
|
+
'26' => 'Duplicate record update, old record replaced',
|
|
54
|
+
'27' => 'File update field edit error',
|
|
55
|
+
'28' => 'File locked out while update',
|
|
56
|
+
'29' => 'File update error, contact acquirer',
|
|
57
|
+
'30' => 'Format error',
|
|
58
|
+
'31' => 'Issuer signed-off',
|
|
59
|
+
'32' => 'Completed partially',
|
|
60
|
+
'33' => 'Pick-up, expired card',
|
|
61
|
+
'34' => 'Suspect Fraud',
|
|
62
|
+
'35' => 'Pick-up, card acceptor contact acquirer',
|
|
63
|
+
'36' => 'Pick up, card restricted',
|
|
64
|
+
'37' => 'Pick up, call acquirer security',
|
|
65
|
+
'38' => 'Pick up, Allowable PIN tries exceeded',
|
|
66
|
+
'39' => 'Transaction Not Allowed',
|
|
67
|
+
'40' => 'Requested function not supported',
|
|
68
|
+
'41' => 'Lost Card, Pickup',
|
|
69
|
+
'42' => 'No universal account',
|
|
70
|
+
'43' => 'Pick up, stolen card',
|
|
71
|
+
'44' => 'No investment account',
|
|
72
|
+
'50' => 'Do not renew',
|
|
73
|
+
'51' => 'Not sufficient funds',
|
|
74
|
+
'52' => 'No checking Account',
|
|
75
|
+
'53' => 'No savings account',
|
|
76
|
+
'54' => 'Expired card',
|
|
77
|
+
'55' => 'Pin incorrect',
|
|
78
|
+
'56' => 'No card record',
|
|
79
|
+
'57' => 'Transaction not allowed for cardholder',
|
|
80
|
+
'58' => 'Transaction not allowed for merchant',
|
|
81
|
+
'59' => 'Suspected Fraud',
|
|
82
|
+
'60' => 'Card acceptor contact acquirer',
|
|
83
|
+
'61' => 'Exceeds withdrawal amount limit',
|
|
84
|
+
'62' => 'Restricted card',
|
|
85
|
+
'63' => 'Security violation',
|
|
86
|
+
'64' => 'Wrong original amount',
|
|
87
|
+
'65' => 'Activity count limit exceeded',
|
|
88
|
+
'66' => 'Call acquirers security department',
|
|
89
|
+
'67' => 'Card to be picked up at ATM',
|
|
90
|
+
'68' => 'Response received too late.',
|
|
91
|
+
'70' => 'Invalid transaction; contact card issuer',
|
|
92
|
+
'71' => 'Decline PIN not changed',
|
|
93
|
+
'75' => 'Pin tries exceeded',
|
|
94
|
+
'76' => 'Wrong PIN, number of PIN tries exceeded',
|
|
95
|
+
'77' => 'Wrong Reference No.',
|
|
96
|
+
'78' => 'Record Not Found',
|
|
97
|
+
'79' => 'Already reversed',
|
|
98
|
+
'80' => 'Network error',
|
|
99
|
+
'81' => 'Foreign network error / PIN cryptographic error',
|
|
100
|
+
'82' => 'Time out at issuer system',
|
|
101
|
+
'83' => 'Transaction failed',
|
|
102
|
+
'84' => 'Pre-authorization timed out',
|
|
103
|
+
'85' => 'No reason to decline',
|
|
104
|
+
'86' => 'Cannot verify pin',
|
|
105
|
+
'87' => 'Purchase amount only, no cashback allowed',
|
|
106
|
+
'88' => 'MAC sync Error',
|
|
107
|
+
'89' => 'Authentication failure',
|
|
108
|
+
'91' => 'Issuer not available',
|
|
109
|
+
'92' => 'Unable to route at acquirer Module',
|
|
110
|
+
'93' => 'Cannot be completed, violation of law',
|
|
111
|
+
'94' => 'Duplicate Transmission',
|
|
112
|
+
'95' => 'Reconcile error / Auth Not found',
|
|
113
|
+
'96' => 'System malfunction',
|
|
114
|
+
'R0' => 'Stop Payment Order',
|
|
115
|
+
'R1' => 'Revocation of Authorisation Order',
|
|
116
|
+
'R3' => 'Revocation of all Authorisations Order'
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
def initialize(options={})
|
|
120
|
+
requires!(options, :merchant_id, :cipher_key)
|
|
121
|
+
super
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def purchase(amount, payment_method, options={})
|
|
125
|
+
post = {}
|
|
126
|
+
add_invoice(post, amount, options)
|
|
127
|
+
add_payment_method(post, payment_method)
|
|
128
|
+
add_customer_data(post, options)
|
|
129
|
+
add_email(post, options)
|
|
130
|
+
add_3d_secure(post, options)
|
|
131
|
+
add_echo(post, options)
|
|
132
|
+
add_submerchant_id(post, options)
|
|
133
|
+
add_transaction_type(post, options)
|
|
134
|
+
|
|
135
|
+
commit(:purchase, post)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def authorize(amount, payment_method, options={})
|
|
139
|
+
post = {}
|
|
140
|
+
add_invoice(post, amount, options)
|
|
141
|
+
add_payment_method(post, payment_method)
|
|
142
|
+
add_customer_data(post, options)
|
|
143
|
+
add_email(post, options)
|
|
144
|
+
add_3d_secure(post, options)
|
|
145
|
+
add_echo(post, options)
|
|
146
|
+
add_submerchant_id(post, options)
|
|
147
|
+
add_transaction_type(post, options)
|
|
148
|
+
|
|
149
|
+
commit(:authorize, post)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
def capture(amount, authorization, options={})
|
|
153
|
+
post = {}
|
|
154
|
+
add_invoice(post, amount, options)
|
|
155
|
+
add_reference(post, authorization)
|
|
156
|
+
add_customer_data(post, options)
|
|
157
|
+
add_echo(post, options)
|
|
158
|
+
add_submerchant_id(post, options)
|
|
159
|
+
|
|
160
|
+
commit(:capture, post)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def void(authorization, options={})
|
|
164
|
+
post = {}
|
|
165
|
+
add_customer_data(post, options)
|
|
166
|
+
reference_action = add_reference(post, authorization)
|
|
167
|
+
add_echo(post, options)
|
|
168
|
+
add_submerchant_id(post, options)
|
|
169
|
+
post[:a1] = generate_unique_id
|
|
170
|
+
|
|
171
|
+
commit(:void, post, reference_action)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def refund(amount, authorization, options={})
|
|
175
|
+
post = {}
|
|
176
|
+
add_invoice(post, amount, options)
|
|
177
|
+
add_reference(post, authorization)
|
|
178
|
+
add_customer_data(post, options)
|
|
179
|
+
add_echo(post, options)
|
|
180
|
+
add_submerchant_id(post, options)
|
|
181
|
+
|
|
182
|
+
commit(:refund, post)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def credit(amount, payment_method, options={})
|
|
186
|
+
post = {}
|
|
187
|
+
add_invoice(post, amount, options)
|
|
188
|
+
add_payment_method(post, payment_method)
|
|
189
|
+
add_customer_data(post, options)
|
|
190
|
+
add_email(post, options)
|
|
191
|
+
add_echo(post, options)
|
|
192
|
+
add_submerchant_id(post, options)
|
|
193
|
+
add_transaction_type(post, options)
|
|
194
|
+
|
|
195
|
+
commit(:credit, post)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def verify(credit_card, options={})
|
|
199
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
200
|
+
r.process { authorize(100, credit_card, options) }
|
|
201
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def supports_scrubbing?
|
|
206
|
+
true
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
def scrub(transcript)
|
|
210
|
+
transcript.
|
|
211
|
+
gsub(%r((b1=)\d+), '\1[FILTERED]').
|
|
212
|
+
gsub(%r((b5=)\d+), '\1[FILTERED]')
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
private
|
|
216
|
+
|
|
217
|
+
def add_invoice(post, money, options)
|
|
218
|
+
currency = options[:currency] || currency(money)
|
|
219
|
+
|
|
220
|
+
post[:a4] = localized_amount(money, currency)
|
|
221
|
+
post[:a1] = generate_unique_id
|
|
222
|
+
post[:a5] = currency
|
|
223
|
+
post[:h9] = options[:order_id]
|
|
224
|
+
post[:i2] = options[:billing_descriptor] if options[:billing_descriptor]
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
CARD_TYPES = {
|
|
228
|
+
'visa' => '1',
|
|
229
|
+
'mastercard' => '2',
|
|
230
|
+
'maestro' => '9'
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
def add_payment_method(post, payment_method)
|
|
234
|
+
post[:c1] = payment_method.name
|
|
235
|
+
post[:b2] = CARD_TYPES[payment_method.brand] || ''
|
|
236
|
+
post[:b1] = payment_method.number
|
|
237
|
+
post[:b5] = payment_method.verification_value
|
|
238
|
+
post[:b4] = format(payment_method.year, :two_digits)
|
|
239
|
+
post[:b3] = format(payment_method.month, :two_digits)
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def add_customer_data(post, options)
|
|
243
|
+
post[:d1] = options[:ip] || '127.0.0.1'
|
|
244
|
+
if (billing_address = options[:billing_address])
|
|
245
|
+
post[:c5] = billing_address[:address1]
|
|
246
|
+
post[:c7] = billing_address[:city]
|
|
247
|
+
post[:c10] = billing_address[:zip]
|
|
248
|
+
post[:c8] = billing_address[:state]
|
|
249
|
+
post[:c9] = billing_address[:country]
|
|
250
|
+
post[:c2] = billing_address[:phone]
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
def add_reference(post, authorization)
|
|
255
|
+
response_id, authorization_code, request_id, action = authorization.split(';')
|
|
256
|
+
post[:g2] = response_id
|
|
257
|
+
post[:g3] = authorization_code
|
|
258
|
+
post[:g4] = request_id
|
|
259
|
+
action || :authorize
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
def add_email(post, options)
|
|
263
|
+
post[:c3] = options[:email] || 'unspecified@example.com'
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
def add_3d_secure(post, options)
|
|
267
|
+
return unless options[:eci] && options[:xid]
|
|
268
|
+
post[:i8] = "#{options[:eci]}:#{(options[:cavv] || "none")}:#{options[:xid]}"
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
def add_echo(post, options)
|
|
272
|
+
# The d2 parameter is used during the certification process
|
|
273
|
+
# See remote tests for full certification test suite
|
|
274
|
+
post[:d2] = options[:echo] unless options[:echo].blank?
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
def add_submerchant_id(post, options)
|
|
278
|
+
post[:h3] = options[:submerchant_id] if options[:submerchant_id]
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
def add_transaction_type(post, options)
|
|
282
|
+
post[:a9] = options[:transaction_type] if options[:transaction_type]
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
ACTIONS = {
|
|
286
|
+
purchase: '1',
|
|
287
|
+
authorize: '2',
|
|
288
|
+
capture: '3',
|
|
289
|
+
authorize_void: '4',
|
|
290
|
+
refund: '5',
|
|
291
|
+
credit: '6',
|
|
292
|
+
purchase_void: '7',
|
|
293
|
+
refund_void: '8',
|
|
294
|
+
capture_void: '9'
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
def commit(action, params, reference_action = nil)
|
|
298
|
+
raw_response = ssl_post(url, post_data(action, params, reference_action))
|
|
299
|
+
response = parse(raw_response)
|
|
300
|
+
|
|
301
|
+
Response.new(
|
|
302
|
+
success_from(response),
|
|
303
|
+
message_from(response),
|
|
304
|
+
response,
|
|
305
|
+
authorization: "#{response["Z1"]};#{response["Z4"]};#{response["A1"]};#{action}",
|
|
306
|
+
avs_result: AVSResult.new(code: response['Z9']),
|
|
307
|
+
cvv_result: CVVResult.new(response['Z14']),
|
|
308
|
+
test: test?
|
|
309
|
+
)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
def sign_request(params)
|
|
313
|
+
params = params.sort
|
|
314
|
+
params.each { |param| param[1].gsub!(/[<>()\\]/, ' ') }
|
|
315
|
+
values = params.map { |param| param[1].strip }
|
|
316
|
+
Digest::MD5.hexdigest(values.join + @options[:cipher_key])
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
def post_data(action, params, reference_action)
|
|
320
|
+
params.keys.each { |key| params[key] = params[key].to_s }
|
|
321
|
+
params[:M] = @options[:merchant_id]
|
|
322
|
+
params[:O] = request_action(action, reference_action)
|
|
323
|
+
params[:K] = sign_request(params)
|
|
324
|
+
params.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
def request_action(action, reference_action)
|
|
328
|
+
if reference_action
|
|
329
|
+
ACTIONS["#{reference_action}_#{action}".to_sym]
|
|
330
|
+
else
|
|
331
|
+
ACTIONS[action]
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
def url
|
|
336
|
+
test? ? test_url : live_url
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
def parse(body)
|
|
340
|
+
Hash[CGI::parse(body).map { |k, v| [k.upcase, v.first] }]
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def success_from(response)
|
|
344
|
+
response['Z2'] == '0'
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def message_from(response)
|
|
348
|
+
if success_from(response)
|
|
349
|
+
'Succeeded'
|
|
350
|
+
else
|
|
351
|
+
RESPONSE_MESSAGES[response['Z6']] || response['Z3'] || 'Unable to read error message'
|
|
352
|
+
end
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
end
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class CtPaymentGateway < Gateway
|
|
4
|
+
self.test_url = 'https://test.ctpaiement.ca/v1/'
|
|
5
|
+
self.live_url = 'https://www.ctpaiement.com/v1/'
|
|
6
|
+
|
|
7
|
+
self.supported_countries = ['US', 'CA']
|
|
8
|
+
self.default_currency = 'CAD'
|
|
9
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
|
|
10
|
+
|
|
11
|
+
self.homepage_url = 'http://www.ct-payment.com/'
|
|
12
|
+
self.display_name = 'CT Payment'
|
|
13
|
+
|
|
14
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
|
15
|
+
'14' => STANDARD_ERROR_CODE[:invalid_number],
|
|
16
|
+
'05' => STANDARD_ERROR_CODE[:card_declined],
|
|
17
|
+
'M6' => STANDARD_ERROR_CODE[:card_declined],
|
|
18
|
+
'9068' => STANDARD_ERROR_CODE[:incorrect_number],
|
|
19
|
+
'9067' => STANDARD_ERROR_CODE[:incorrect_number]
|
|
20
|
+
}
|
|
21
|
+
CARD_BRAND = {
|
|
22
|
+
'american_express' => 'A',
|
|
23
|
+
'master' => 'M',
|
|
24
|
+
'diners_club' => 'I',
|
|
25
|
+
'visa' => 'V',
|
|
26
|
+
'discover' => 'O'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
def initialize(options={})
|
|
30
|
+
requires!(options, :api_key, :company_number, :merchant_number)
|
|
31
|
+
super
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def purchase(money, payment, options={})
|
|
35
|
+
requires!(options, :order_id)
|
|
36
|
+
post = {}
|
|
37
|
+
add_terminal_number(post, options)
|
|
38
|
+
add_money(post, money)
|
|
39
|
+
add_operator_id(post, options)
|
|
40
|
+
add_invoice(post, money, options)
|
|
41
|
+
add_payment(post, payment)
|
|
42
|
+
add_address(post, payment, options)
|
|
43
|
+
add_customer_data(post, options)
|
|
44
|
+
|
|
45
|
+
payment.is_a?(String) ? commit('purchaseWithToken', post) : commit('purchase', post)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def authorize(money, payment, options={})
|
|
49
|
+
requires!(options, :order_id)
|
|
50
|
+
post = {}
|
|
51
|
+
add_money(post, money)
|
|
52
|
+
add_terminal_number(post, options)
|
|
53
|
+
add_operator_id(post, options)
|
|
54
|
+
add_invoice(post, money, options)
|
|
55
|
+
add_payment(post, payment)
|
|
56
|
+
add_address(post, payment, options)
|
|
57
|
+
add_customer_data(post, options)
|
|
58
|
+
|
|
59
|
+
payment.is_a?(String) ? commit('preAuthorizationWithToken', post) : commit('preAuthorization', post)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def capture(money, authorization, options={})
|
|
63
|
+
requires!(options, :order_id)
|
|
64
|
+
post = {}
|
|
65
|
+
add_invoice(post, money, options)
|
|
66
|
+
add_money(post, money)
|
|
67
|
+
add_customer_data(post, options)
|
|
68
|
+
transaction_number, authorization_number, invoice_number = split_authorization(authorization)
|
|
69
|
+
post[:OriginalTransactionNumber] = transaction_number
|
|
70
|
+
post[:OriginalAuthorizationNumber] = authorization_number
|
|
71
|
+
post[:OriginalInvoiceNumber] = invoice_number
|
|
72
|
+
|
|
73
|
+
commit('completion', post)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def refund(money, authorization, options={})
|
|
77
|
+
requires!(options, :order_id)
|
|
78
|
+
post = {}
|
|
79
|
+
add_invoice(post, money, options)
|
|
80
|
+
add_money(post, money)
|
|
81
|
+
add_customer_data(post, options)
|
|
82
|
+
transaction_number, _, invoice_number = split_authorization(authorization)
|
|
83
|
+
post[:OriginalTransactionNumber] = transaction_number
|
|
84
|
+
post[:OriginalInvoiceNumber] = invoice_number
|
|
85
|
+
|
|
86
|
+
commit('refundWithoutCard', post)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def credit(money, payment, options={})
|
|
90
|
+
requires!(options, :order_id)
|
|
91
|
+
post = {}
|
|
92
|
+
add_terminal_number(post, options)
|
|
93
|
+
add_money(post, money)
|
|
94
|
+
add_operator_id(post, options)
|
|
95
|
+
add_invoice(post, money, options)
|
|
96
|
+
add_payment(post, payment)
|
|
97
|
+
add_address(post, payment, options)
|
|
98
|
+
add_customer_data(post, options)
|
|
99
|
+
|
|
100
|
+
payment.is_a?(String) ? commit('refundWithToken', post) : commit('refund', post)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def void(authorization, options={})
|
|
104
|
+
post = {}
|
|
105
|
+
post[:InputType] = 'I'
|
|
106
|
+
post[:LanguageCode] = 'E'
|
|
107
|
+
transaction_number, _, invoice_number = split_authorization(authorization)
|
|
108
|
+
post[:OriginalTransactionNumber] = transaction_number
|
|
109
|
+
post[:OriginalInvoiceNumber] = invoice_number
|
|
110
|
+
add_operator_id(post, options)
|
|
111
|
+
add_customer_data(post, options)
|
|
112
|
+
|
|
113
|
+
commit('void', post)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def verify(credit_card, options={})
|
|
117
|
+
requires!(options, :order_id)
|
|
118
|
+
post = {}
|
|
119
|
+
add_terminal_number(post, options)
|
|
120
|
+
add_operator_id(post, options)
|
|
121
|
+
add_invoice(post, 0, options)
|
|
122
|
+
add_payment(post, credit_card)
|
|
123
|
+
add_address(post, credit_card, options)
|
|
124
|
+
add_customer_data(post, options)
|
|
125
|
+
|
|
126
|
+
commit('verifyAccount', post)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def store(credit_card, options={})
|
|
130
|
+
requires!(options, :email)
|
|
131
|
+
post = {
|
|
132
|
+
LanguageCode: 'E',
|
|
133
|
+
Name: credit_card.name.rjust(50, ' '),
|
|
134
|
+
Email: options[:email].rjust(240, ' ')
|
|
135
|
+
}
|
|
136
|
+
add_operator_id(post, options)
|
|
137
|
+
add_payment(post, credit_card)
|
|
138
|
+
add_customer_data(post, options)
|
|
139
|
+
|
|
140
|
+
commit('recur/AddUser', post)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def supports_scrubbing?
|
|
144
|
+
true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def scrub(transcript)
|
|
148
|
+
transcript.
|
|
149
|
+
gsub(%r((&?auth-api-key=)[^&]*)i, '\1[FILTERED]').
|
|
150
|
+
gsub(%r((&?payload=)[a-zA-Z%0-9=]+)i, '\1[FILTERED]').
|
|
151
|
+
gsub(%r((&?token:)[^&]*)i, '\1[FILTERED]').
|
|
152
|
+
gsub(%r((&?cardNumber:)[^&]*)i, '\1[FILTERED]')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
private
|
|
156
|
+
|
|
157
|
+
def add_terminal_number(post, options)
|
|
158
|
+
post[:MerchantTerminalNumber] = options[:merchant_terminal_number] || ' ' * 5
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def add_money(post, money)
|
|
162
|
+
post[:Amount] = money.to_s.rjust(11, '0')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def add_operator_id(post, options)
|
|
166
|
+
post[:OperatorID] = options[:operator_id] || '0' * 8
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def add_customer_data(post, options)
|
|
170
|
+
post[:CustomerNumber] = options[:customer_number] || '0' * 8
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def add_address(post, creditcard, options)
|
|
174
|
+
if address = options[:billing_address] || options[:address]
|
|
175
|
+
post[:CardHolderAddress] = "#{address[:address1]} #{address[:address2]} #{address[:city]} #{address[:state]}".rjust(20, ' ')
|
|
176
|
+
post[:CardHolderPostalCode] = address[:zip].gsub(/\s+/, '').rjust(9, ' ')
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def add_invoice(post, money, options)
|
|
181
|
+
post[:CurrencyCode] = options[:currency] || (currency(money) if money)
|
|
182
|
+
post[:InvoiceNumber] = options[:order_id].rjust(12, '0')
|
|
183
|
+
post[:InputType] = 'I'
|
|
184
|
+
post[:LanguageCode] = 'E'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def add_payment(post, payment)
|
|
188
|
+
if payment.is_a?(String)
|
|
189
|
+
post[:Token] = split_authorization(payment)[3].strip
|
|
190
|
+
else
|
|
191
|
+
post[:CardType] = CARD_BRAND[payment.brand] || ' '
|
|
192
|
+
post[:CardNumber] = payment.number.rjust(40, ' ')
|
|
193
|
+
post[:ExpirationDate] = expdate(payment)
|
|
194
|
+
post[:Cvv2Cvc2Number] = payment.verification_value
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def parse(body)
|
|
199
|
+
JSON.parse(body)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def split_authorization(authorization)
|
|
203
|
+
authorization.split(';')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def commit_raw(action, parameters)
|
|
207
|
+
url = (test? ? test_url : live_url) + action
|
|
208
|
+
response = parse(ssl_post(url, post_data(action, parameters)))
|
|
209
|
+
|
|
210
|
+
Response.new(
|
|
211
|
+
success_from(response),
|
|
212
|
+
message_from(response),
|
|
213
|
+
response,
|
|
214
|
+
authorization: authorization_from(response),
|
|
215
|
+
avs_result: AVSResult.new(code: response['avsStatus']),
|
|
216
|
+
cvv_result: CVVResult.new(response['cvv2Cvc2Status']),
|
|
217
|
+
test: test?,
|
|
218
|
+
error_code: error_code_from(response)
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def commit(action, parameters)
|
|
223
|
+
if action == 'void'
|
|
224
|
+
commit_raw(action, parameters)
|
|
225
|
+
else
|
|
226
|
+
MultiResponse.run(true) do |r|
|
|
227
|
+
r.process { commit_raw(action, parameters) }
|
|
228
|
+
r.process {
|
|
229
|
+
split_auth = split_authorization(r.authorization)
|
|
230
|
+
auth = (action.include?('recur')? split_auth[4] : split_auth[0])
|
|
231
|
+
action.include?('recur') ? commit_raw('recur/ack', {ID: auth}) : commit_raw('ack', {TransactionNumber: auth})
|
|
232
|
+
}
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
def success_from(response)
|
|
238
|
+
return true if response['returnCode'] == ' 00'
|
|
239
|
+
return true if response['returnCode'] == 'true'
|
|
240
|
+
return true if response['recurReturnCode'] == ' 00'
|
|
241
|
+
return false
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def message_from(response)
|
|
245
|
+
response['errorDescription'] || response['terminalDisp']&.strip
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def authorization_from(response)
|
|
249
|
+
"#{response['transactionNumber']};#{response['authorizationNumber']};"\
|
|
250
|
+
"#{response['invoiceNumber']};#{response['token']};#{response['id']}"
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
def post_data(action, parameters = {})
|
|
254
|
+
parameters[:CompanyNumber] = @options[:company_number]
|
|
255
|
+
parameters[:MerchantNumber] = @options[:merchant_number]
|
|
256
|
+
parameters = parameters.collect do |key, value|
|
|
257
|
+
"#{key}=#{value}" unless value.nil? || value.empty?
|
|
258
|
+
end.join('&')
|
|
259
|
+
payload = Base64.strict_encode64(parameters)
|
|
260
|
+
"auth-api-key=#{@options[:api_key]}&payload=#{payload}".strip
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
def error_code_from(response)
|
|
264
|
+
STANDARD_ERROR_CODE_MAPPING[response['returnCode'].strip || response['recurReturnCode'.strip]] unless success_from(response)
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|