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,264 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class SecurionPayGateway < Gateway
|
|
4
|
+
self.test_url = 'https://api.securionpay.com/'
|
|
5
|
+
self.live_url = 'https://api.securionpay.com/'
|
|
6
|
+
|
|
7
|
+
self.supported_countries = %w(AL AD AT BY BE BG HR CY CZ RE DK EE IS FI FR DE GI GR HU IS IE IT IL LV LI LT LU
|
|
8
|
+
MK MT MD MC NL NO PL PT RO RU MA RS SK SI ES SE CH UA GB KI CI ME)
|
|
9
|
+
|
|
10
|
+
self.default_currency = 'USD'
|
|
11
|
+
self.money_format = :cents
|
|
12
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
|
|
13
|
+
|
|
14
|
+
self.homepage_url = 'https://securionpay.com/'
|
|
15
|
+
self.display_name = 'SecurionPay'
|
|
16
|
+
|
|
17
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
|
18
|
+
'incorrect_number' => STANDARD_ERROR_CODE[:incorrect_number],
|
|
19
|
+
'invalid_number' => STANDARD_ERROR_CODE[:invalid_number],
|
|
20
|
+
'invalid_expiry_month' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
|
21
|
+
'invalid_expiry_year' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
|
22
|
+
'invalid_cvc' => STANDARD_ERROR_CODE[:invalid_cvc],
|
|
23
|
+
'expired_card' => STANDARD_ERROR_CODE[:expired_card],
|
|
24
|
+
'insufficient_funds' => STANDARD_ERROR_CODE[:card_declined],
|
|
25
|
+
'incorrect_cvc' => STANDARD_ERROR_CODE[:incorrect_cvc],
|
|
26
|
+
'incorrect_zip' => STANDARD_ERROR_CODE[:incorrect_zip],
|
|
27
|
+
'card_declined' => STANDARD_ERROR_CODE[:card_declined],
|
|
28
|
+
'processing_error' => STANDARD_ERROR_CODE[:processing_error],
|
|
29
|
+
'lost_or_stolen' => STANDARD_ERROR_CODE[:card_declined],
|
|
30
|
+
'suspected_fraud' => STANDARD_ERROR_CODE[:card_declined],
|
|
31
|
+
'expired_token' => STANDARD_ERROR_CODE[:card_declined]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
def initialize(options={})
|
|
35
|
+
requires!(options, :secret_key)
|
|
36
|
+
super
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def purchase(money, payment, options={})
|
|
40
|
+
post = create_post_for_auth_or_purchase(money, payment, options)
|
|
41
|
+
commit('charges', post, options)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def authorize(money, payment, options={})
|
|
45
|
+
post = create_post_for_auth_or_purchase(money, payment, options)
|
|
46
|
+
post[:captured] = 'false'
|
|
47
|
+
commit('charges', post, options)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def capture(money, authorization, options = {})
|
|
51
|
+
post = {}
|
|
52
|
+
add_amount(post, money, options)
|
|
53
|
+
commit("charges/#{CGI.escape(authorization)}/capture", post, options)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def refund(money, authorization, options = {})
|
|
57
|
+
post = {}
|
|
58
|
+
add_amount(post, money, options)
|
|
59
|
+
commit("charges/#{CGI.escape(authorization)}/refund", post, options)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def void(authorization, options = {})
|
|
63
|
+
commit("charges/#{CGI.escape(authorization)}/refund", {}, options)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def verify(credit_card, options={})
|
|
67
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
68
|
+
r.process { authorize(100, credit_card, options) }
|
|
69
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def store(credit_card, options = {})
|
|
74
|
+
if options[:customer_id].blank?
|
|
75
|
+
MultiResponse.run() do |r|
|
|
76
|
+
# create charge object
|
|
77
|
+
r.process { authorize(100, credit_card, options) }
|
|
78
|
+
# create customer and save card
|
|
79
|
+
r.process { create_customer_add_card(r.authorization, options) }
|
|
80
|
+
# void the charge
|
|
81
|
+
r.process(:ignore_result) { void(r.params['metadata']['chargeId'], options) }
|
|
82
|
+
end
|
|
83
|
+
else
|
|
84
|
+
verify(credit_card, options)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def customer(options = {})
|
|
89
|
+
if options[:customer_id].blank?
|
|
90
|
+
return nil
|
|
91
|
+
else
|
|
92
|
+
commit("customers/#{CGI.escape(options[:customer_id])}", nil, options, :get)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def supports_scrubbing?
|
|
97
|
+
true
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def scrub(transcript)
|
|
101
|
+
transcript.
|
|
102
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
|
103
|
+
gsub(%r((card\[number\]=)\d+), '\1[FILTERED]').
|
|
104
|
+
gsub(%r((card\[cvc\]=)\d+), '\1[FILTERED]')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
private
|
|
108
|
+
|
|
109
|
+
def create_customer_add_card(authorization, options)
|
|
110
|
+
post = {}
|
|
111
|
+
post[:email] = options[:email]
|
|
112
|
+
post[:description] = options[:description]
|
|
113
|
+
post[:card] = authorization
|
|
114
|
+
post[:metadata] = {}
|
|
115
|
+
post[:metadata][:chargeId] = authorization
|
|
116
|
+
commit('customers', post, options)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def add_customer(post, payment, options)
|
|
120
|
+
post[:customerId] = options[:customer_id] if options[:customer_id]
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def add_customer_data(post, options)
|
|
124
|
+
post[:description] = options[:description]
|
|
125
|
+
post[:ip] = options[:ip]
|
|
126
|
+
post[:user_agent] = options[:user_agent]
|
|
127
|
+
post[:referrer] = options[:referrer]
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def create_post_for_auth_or_purchase(money, payment, options)
|
|
131
|
+
post = {}
|
|
132
|
+
add_amount(post, money, options, true)
|
|
133
|
+
add_creditcard(post, payment, options)
|
|
134
|
+
add_customer(post, payment, options)
|
|
135
|
+
add_customer_data(post, options)
|
|
136
|
+
if options[:email]
|
|
137
|
+
post[:metadata] = {}
|
|
138
|
+
post[:metadata][:email] = options[:email]
|
|
139
|
+
end
|
|
140
|
+
post
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def add_amount(post, money, options, include_currency = false)
|
|
144
|
+
currency = (options[:currency] || default_currency)
|
|
145
|
+
post[:amount] = localized_amount(money, currency)
|
|
146
|
+
post[:currency] = currency.downcase if include_currency
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def add_creditcard(post, creditcard, options)
|
|
150
|
+
card = {}
|
|
151
|
+
if creditcard.respond_to?(:number)
|
|
152
|
+
card[:number] = creditcard.number
|
|
153
|
+
card[:expMonth] = creditcard.month
|
|
154
|
+
card[:expYear] = creditcard.year
|
|
155
|
+
card[:cvc] = creditcard.verification_value if creditcard.verification_value?
|
|
156
|
+
card[:cardholderName] = creditcard.name if creditcard.name
|
|
157
|
+
|
|
158
|
+
post[:card] = card
|
|
159
|
+
add_address(post, options)
|
|
160
|
+
elsif creditcard.kind_of?(String)
|
|
161
|
+
post[:card] = creditcard
|
|
162
|
+
else
|
|
163
|
+
raise ArgumentError.new("Unhandled payment method #{creditcard.class}.")
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def add_address(post, options)
|
|
168
|
+
return unless post[:card]&.kind_of?(Hash)
|
|
169
|
+
if address = options[:billing_address]
|
|
170
|
+
post[:card][:addressLine1] = address[:address1] if address[:address1]
|
|
171
|
+
post[:card][:addressLine2] = address[:address2] if address[:address2]
|
|
172
|
+
post[:card][:addressCountry] = address[:country] if address[:country]
|
|
173
|
+
post[:card][:addressZip] = address[:zip] if address[:zip]
|
|
174
|
+
post[:card][:addressState] = address[:state] if address[:state]
|
|
175
|
+
post[:card][:addressCity] = address[:city] if address[:city]
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def parse(body)
|
|
180
|
+
JSON.parse(body)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def commit(url, parameters = nil, options = {}, method = nil)
|
|
184
|
+
response = api_request(url, parameters, options, method)
|
|
185
|
+
success = !response.key?('error')
|
|
186
|
+
|
|
187
|
+
Response.new(success,
|
|
188
|
+
(success ? 'Transaction approved' : response['error']['message']),
|
|
189
|
+
response,
|
|
190
|
+
test: test?,
|
|
191
|
+
authorization: (success ? response['id'] : response['error']['charge']),
|
|
192
|
+
error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['error']['code']])
|
|
193
|
+
)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def headers(options = {})
|
|
197
|
+
secret_key = options[:secret_key] || @options[:secret_key]
|
|
198
|
+
|
|
199
|
+
headers = {
|
|
200
|
+
'Authorization' => 'Basic ' + Base64.encode64(secret_key.to_s + ':').strip,
|
|
201
|
+
'User-Agent' => "SecurionPay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
|
|
202
|
+
}
|
|
203
|
+
headers
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def response_error(raw_response)
|
|
207
|
+
parse(raw_response)
|
|
208
|
+
rescue JSON::ParserError
|
|
209
|
+
json_error(raw_response)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def post_data(params)
|
|
213
|
+
return nil unless params
|
|
214
|
+
|
|
215
|
+
params.map do |key, value|
|
|
216
|
+
next if value.blank?
|
|
217
|
+
if value.is_a?(Hash)
|
|
218
|
+
h = {}
|
|
219
|
+
value.each do |k, v|
|
|
220
|
+
h["#{key}[#{k}]"] = v unless v.blank?
|
|
221
|
+
end
|
|
222
|
+
post_data(h)
|
|
223
|
+
elsif value.is_a?(Array)
|
|
224
|
+
value.map { |v| "#{key}[]=#{CGI.escape(v.to_s)}" }.join('&')
|
|
225
|
+
else
|
|
226
|
+
"#{key}=#{CGI.escape(value.to_s)}"
|
|
227
|
+
end
|
|
228
|
+
end.compact.join('&')
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
def api_request(endpoint, parameters = nil, options = {}, method = nil)
|
|
232
|
+
raw_response = response = nil
|
|
233
|
+
begin
|
|
234
|
+
if method.blank?
|
|
235
|
+
raw_response = ssl_post(self.live_url + endpoint, post_data(parameters), headers(options))
|
|
236
|
+
else
|
|
237
|
+
raw_response = ssl_request(method, self.live_url + endpoint, post_data(parameters), headers(options))
|
|
238
|
+
end
|
|
239
|
+
response = parse(raw_response)
|
|
240
|
+
rescue ResponseError => e
|
|
241
|
+
raw_response = e.response.body
|
|
242
|
+
response = response_error(raw_response)
|
|
243
|
+
rescue JSON::ParserError
|
|
244
|
+
response = json_error(raw_response)
|
|
245
|
+
end
|
|
246
|
+
response
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def json_error(raw_response)
|
|
250
|
+
msg = 'Invalid response received from the SecurionPay API.'
|
|
251
|
+
msg += " (The raw response returned by the API was #{raw_response.inspect})"
|
|
252
|
+
{
|
|
253
|
+
'error' => {
|
|
254
|
+
'message' => msg
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def test?
|
|
260
|
+
(@options[:secret_key]&.include?('_test_'))
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
end
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!ruby19
|
|
2
1
|
# encoding: utf-8
|
|
3
2
|
|
|
4
3
|
module ActiveMerchant #:nodoc:
|
|
@@ -6,11 +5,11 @@ module ActiveMerchant #:nodoc:
|
|
|
6
5
|
class SkipJackGateway < Gateway
|
|
7
6
|
API_VERSION = '?.?'
|
|
8
7
|
|
|
9
|
-
self.live_url =
|
|
10
|
-
self.test_url =
|
|
8
|
+
self.live_url = 'https://www.skipjackic.com'
|
|
9
|
+
self.test_url = 'https://developer.skipjackic.com'
|
|
11
10
|
|
|
12
|
-
BASIC_PATH =
|
|
13
|
-
ADVANCED_PATH =
|
|
11
|
+
BASIC_PATH = '/scripts/evolvcc.dll'
|
|
12
|
+
ADVANCED_PATH = '/evolvcc/evolvcc.aspx'
|
|
14
13
|
|
|
15
14
|
ACTIONS = {
|
|
16
15
|
:authorization => 'AuthorizeAPI',
|
|
@@ -25,35 +24,34 @@ module ActiveMerchant #:nodoc:
|
|
|
25
24
|
CARD_CODE_ERRORS = %w( N S "" )
|
|
26
25
|
|
|
27
26
|
CARD_CODE_MESSAGES = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
'M' => 'Card verification number matched',
|
|
28
|
+
'N' => "Card verification number didn't match",
|
|
29
|
+
'P' => 'Card verification number was not processed',
|
|
30
|
+
'S' => 'Card verification number should be on card but was not indicated',
|
|
31
|
+
'U' => 'Issuer was not certified for card verification',
|
|
32
|
+
'' => 'Transaction failed because incorrect card verification number was entered or no number was entered'
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
AVS_ERRORS = %w( A B C E I N O P R W Z )
|
|
37
36
|
|
|
38
37
|
AVS_MESSAGES = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"Z" => "5-digit zip/postal code matches billing information, street address does not",
|
|
38
|
+
'A' => 'Street address matches billing information, zip/postal code does not',
|
|
39
|
+
'B' => 'Street address match for international transaction. Postal code not verified due to incompatible formats',
|
|
40
|
+
'C' => 'Street address and postal code not verified for internation transaction due to incompatible formats',
|
|
41
|
+
'D' => 'Street address and postal code match for international transaction',
|
|
42
|
+
'E' => 'Address verification service error',
|
|
43
|
+
'I' => 'Address information not verified by international issuer',
|
|
44
|
+
'M' => 'Street address and postal code match for international transaction',
|
|
45
|
+
'N' => 'Neither street address nor zip/postal match billing information',
|
|
46
|
+
'O' => 'Non-US issuer does not participate',
|
|
47
|
+
'P' => 'Postal codes match for international transaction but street address not verified due to incompatible formats',
|
|
48
|
+
'R' => 'Payment gateway was unavailable or timed out',
|
|
49
|
+
'S' => 'Address verification service not supported by issuer',
|
|
50
|
+
'U' => 'Address information is unavailable',
|
|
51
|
+
'W' => '9-digit zip/postal code matches billing information, street address does not',
|
|
52
|
+
'X' => 'Street address and 9-digit zip/postal code matches billing information',
|
|
53
|
+
'Y' => 'Street address and 5-digit zip/postal code matches billing information',
|
|
54
|
+
'Z' => '5-digit zip/postal code matches billing information, street address does not',
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
CHANGE_STATUS_ERROR_MESSAGES = {
|
|
@@ -195,7 +193,6 @@ module ActiveMerchant #:nodoc:
|
|
|
195
193
|
end
|
|
196
194
|
|
|
197
195
|
def purchase(money, creditcard, options = {})
|
|
198
|
-
post = {}
|
|
199
196
|
authorization = authorize(money, creditcard, options)
|
|
200
197
|
if authorization.success?
|
|
201
198
|
capture(money, authorization.authorization)
|
|
@@ -240,7 +237,7 @@ module ActiveMerchant #:nodoc:
|
|
|
240
237
|
end
|
|
241
238
|
|
|
242
239
|
def credit(money, identification, options = {})
|
|
243
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
240
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
244
241
|
refund(money, identification, options)
|
|
245
242
|
end
|
|
246
243
|
|
|
@@ -263,7 +260,7 @@ module ActiveMerchant #:nodoc:
|
|
|
263
260
|
end
|
|
264
261
|
|
|
265
262
|
def commit(action, money, parameters)
|
|
266
|
-
response = parse(
|
|
263
|
+
response = parse(ssl_post(url_for(action), post_data(action, money, parameters)), action)
|
|
267
264
|
|
|
268
265
|
# Pass along the original transaction id in the case an update transaction
|
|
269
266
|
Response.new(response[:success], message_from(response, action), response,
|
|
@@ -277,7 +274,7 @@ module ActiveMerchant #:nodoc:
|
|
|
277
274
|
def url_for(action)
|
|
278
275
|
result = test? ? self.test_url : self.live_url
|
|
279
276
|
result += advanced? && action == :authorization ? ADVANCED_PATH : BASIC_PATH
|
|
280
|
-
result
|
|
277
|
+
result + "?#{ACTIONS[action]}"
|
|
281
278
|
end
|
|
282
279
|
|
|
283
280
|
def add_credentials(params, action)
|
|
@@ -320,7 +317,7 @@ module ActiveMerchant #:nodoc:
|
|
|
320
317
|
def authorize_response_map(body)
|
|
321
318
|
lines = split_lines(body)
|
|
322
319
|
keys, values = split_line(lines[0]), split_line(lines[1])
|
|
323
|
-
Hash[*
|
|
320
|
+
Hash[*keys.zip(values).flatten].symbolize_keys
|
|
324
321
|
end
|
|
325
322
|
|
|
326
323
|
def parse_authorization_response(body)
|
|
@@ -335,7 +332,7 @@ module ActiveMerchant #:nodoc:
|
|
|
335
332
|
keys = [ :szSerialNumber, :szErrorCode, :szNumberRecords]
|
|
336
333
|
values = split_line(lines[0])[0..2]
|
|
337
334
|
|
|
338
|
-
result = Hash[*
|
|
335
|
+
result = Hash[*keys.zip(values).flatten]
|
|
339
336
|
|
|
340
337
|
result[:szErrorMessage] = ''
|
|
341
338
|
result[:success] = (result[:szErrorCode] == '0')
|
|
@@ -356,8 +353,8 @@ module ActiveMerchant #:nodoc:
|
|
|
356
353
|
def post_data(action, money, params = {})
|
|
357
354
|
add_credentials(params, action)
|
|
358
355
|
add_amount(params, action, money)
|
|
359
|
-
sorted_params = params.to_a.
|
|
360
|
-
sorted_params.collect { |key, value| "#{key
|
|
356
|
+
sorted_params = params.to_a.sort_by(&:to_s).reverse
|
|
357
|
+
sorted_params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
361
358
|
end
|
|
362
359
|
|
|
363
360
|
def add_transaction_id(post, transaction_id)
|
|
@@ -371,7 +368,7 @@ module ActiveMerchant #:nodoc:
|
|
|
371
368
|
post[:OrderDescription] = options[:description]
|
|
372
369
|
|
|
373
370
|
if order_items = options[:items]
|
|
374
|
-
post[:OrderString] = order_items.collect { |item| "#{item[:sku]}~#{item[:description].tr('~','-')}~#{item[:declared_value]}~#{item[:quantity]}~#{item[:taxable]}~~~~~~~~#{item[:tax_rate]}~||"}.join
|
|
371
|
+
post[:OrderString] = order_items.collect { |item| "#{item[:sku]}~#{item[:description].tr('~', '-')}~#{item[:declared_value]}~#{item[:quantity]}~#{item[:taxable]}~~~~~~~~#{item[:tax_rate]}~||" }.join
|
|
375
372
|
else
|
|
376
373
|
post[:OrderString] = '1~None~0.00~0~N~||'
|
|
377
374
|
end
|
|
@@ -23,9 +23,9 @@ module ActiveMerchant #:nodoc:
|
|
|
23
23
|
def authorize(money, creditcard, options = {})
|
|
24
24
|
post = {}
|
|
25
25
|
add_invoice(post, options)
|
|
26
|
-
add_payment_source(post, creditcard,options)
|
|
26
|
+
add_payment_source(post, creditcard, options)
|
|
27
27
|
add_address(post, options[:billing_address] || options[:address])
|
|
28
|
-
add_address(post, options[:shipping_address],
|
|
28
|
+
add_address(post, options[:shipping_address], 'shipping')
|
|
29
29
|
add_customer_data(post, options)
|
|
30
30
|
add_currency(post, money, options)
|
|
31
31
|
add_taxes(post, options)
|
|
@@ -38,11 +38,12 @@ module ActiveMerchant #:nodoc:
|
|
|
38
38
|
add_invoice(post, options)
|
|
39
39
|
add_payment_source(post, payment_source, options)
|
|
40
40
|
add_address(post, options[:billing_address] || options[:address])
|
|
41
|
-
add_address(post, options[:shipping_address],
|
|
41
|
+
add_address(post, options[:shipping_address], 'shipping')
|
|
42
42
|
add_customer_data(post, options)
|
|
43
43
|
add_currency(post, money, options)
|
|
44
44
|
add_taxes(post, options)
|
|
45
45
|
add_processor(post, options)
|
|
46
|
+
add_eci(post, options)
|
|
46
47
|
commit('sale', money, post)
|
|
47
48
|
end
|
|
48
49
|
|
|
@@ -64,7 +65,7 @@ module ActiveMerchant #:nodoc:
|
|
|
64
65
|
add_payment_source(post, payment_source, options)
|
|
65
66
|
add_address(post, options[:billing_address] || options[:address])
|
|
66
67
|
add_customer_data(post, options)
|
|
67
|
-
add_sku(post,options)
|
|
68
|
+
add_sku(post, options)
|
|
68
69
|
add_currency(post, money, options)
|
|
69
70
|
add_processor(post, options)
|
|
70
71
|
commit('credit', money, post)
|
|
@@ -76,13 +77,19 @@ module ActiveMerchant #:nodoc:
|
|
|
76
77
|
commit('refund', money, post)
|
|
77
78
|
end
|
|
78
79
|
|
|
80
|
+
def verify(credit_card, options = {})
|
|
81
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
82
|
+
r.process { authorize(100, credit_card, options) }
|
|
83
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
84
|
+
end
|
|
85
|
+
end
|
|
79
86
|
|
|
80
87
|
# Update the values (such as CC expiration) stored at
|
|
81
88
|
# the gateway. The CC number must be supplied in the
|
|
82
89
|
# CreditCard object.
|
|
83
90
|
def update(vault_id, creditcard, options = {})
|
|
84
91
|
post = {}
|
|
85
|
-
post[:customer_vault] =
|
|
92
|
+
post[:customer_vault] = 'update_customer'
|
|
86
93
|
add_customer_vault_id(post, vault_id)
|
|
87
94
|
add_creditcard(post, creditcard, options)
|
|
88
95
|
add_address(post, options[:billing_address] || options[:address])
|
|
@@ -99,10 +106,9 @@ module ActiveMerchant #:nodoc:
|
|
|
99
106
|
commit('update', nil, post)
|
|
100
107
|
end
|
|
101
108
|
|
|
102
|
-
|
|
103
109
|
def delete(vault_id)
|
|
104
110
|
post = {}
|
|
105
|
-
post[:customer_vault] =
|
|
111
|
+
post[:customer_vault] = 'delete_customer'
|
|
106
112
|
add_customer_vault_id(post, vault_id)
|
|
107
113
|
commit(nil, nil, post)
|
|
108
114
|
end
|
|
@@ -121,6 +127,7 @@ module ActiveMerchant #:nodoc:
|
|
|
121
127
|
alias_method :unstore, :delete
|
|
122
128
|
|
|
123
129
|
private
|
|
130
|
+
|
|
124
131
|
def add_customer_data(post, options)
|
|
125
132
|
if options.has_key? :email
|
|
126
133
|
post[:email] = options[:email]
|
|
@@ -131,17 +138,17 @@ module ActiveMerchant #:nodoc:
|
|
|
131
138
|
end
|
|
132
139
|
end
|
|
133
140
|
|
|
134
|
-
def add_address(post, address,prefix=
|
|
135
|
-
prefix +=
|
|
141
|
+
def add_address(post, address, prefix='')
|
|
142
|
+
prefix +='_' unless prefix.blank?
|
|
136
143
|
unless address.blank? or address.values.blank?
|
|
137
|
-
post[prefix+
|
|
138
|
-
post[prefix+
|
|
139
|
-
post[prefix+
|
|
140
|
-
post[prefix+
|
|
141
|
-
post[prefix+
|
|
142
|
-
post[prefix+
|
|
143
|
-
post[prefix+
|
|
144
|
-
post[prefix+
|
|
144
|
+
post[prefix+'address1'] = address[:address1].to_s
|
|
145
|
+
post[prefix+'address2'] = address[:address2].to_s unless address[:address2].blank?
|
|
146
|
+
post[prefix+'company'] = address[:company].to_s
|
|
147
|
+
post[prefix+'phone'] = address[:phone].to_s
|
|
148
|
+
post[prefix+'zip'] = address[:zip].to_s
|
|
149
|
+
post[prefix+'city'] = address[:city].to_s
|
|
150
|
+
post[prefix+'country'] = address[:country].to_s
|
|
151
|
+
post[prefix+'state'] = address[:state].blank? ? 'n/a' : address[:state]
|
|
145
152
|
end
|
|
146
153
|
end
|
|
147
154
|
|
|
@@ -175,7 +182,7 @@ module ActiveMerchant #:nodoc:
|
|
|
175
182
|
|
|
176
183
|
def add_creditcard(post, creditcard, options)
|
|
177
184
|
if options[:store]
|
|
178
|
-
post[:customer_vault] =
|
|
185
|
+
post[:customer_vault] = 'add_customer'
|
|
179
186
|
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
|
180
187
|
end
|
|
181
188
|
post[:ccnumber] = creditcard.number
|
|
@@ -187,7 +194,7 @@ module ActiveMerchant #:nodoc:
|
|
|
187
194
|
|
|
188
195
|
def add_check(post, check, options)
|
|
189
196
|
if options[:store]
|
|
190
|
-
post[:customer_vault] =
|
|
197
|
+
post[:customer_vault] = 'add_customer'
|
|
191
198
|
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
|
192
199
|
end
|
|
193
200
|
|
|
@@ -199,18 +206,22 @@ module ActiveMerchant #:nodoc:
|
|
|
199
206
|
post[:account_type] = check.account_type # The customer's type of ACH account
|
|
200
207
|
end
|
|
201
208
|
|
|
202
|
-
def add_sku(post,options)
|
|
203
|
-
post[
|
|
209
|
+
def add_sku(post, options)
|
|
210
|
+
post['product_sku_#'] = options[:sku] || options['product_sku_#']
|
|
204
211
|
end
|
|
205
212
|
|
|
206
213
|
def add_transaction(post, auth)
|
|
207
214
|
post[:transactionid] = auth
|
|
208
215
|
end
|
|
209
216
|
|
|
217
|
+
def add_eci(post, options)
|
|
218
|
+
post[:billing_method] = options[:eci] if options[:eci]
|
|
219
|
+
end
|
|
220
|
+
|
|
210
221
|
def parse(body)
|
|
211
222
|
results = {}
|
|
212
223
|
body.split(/&/).each do |pair|
|
|
213
|
-
key,val = pair.split(/=/)
|
|
224
|
+
key, val = pair.split(/=/)
|
|
214
225
|
results[key] = val
|
|
215
226
|
end
|
|
216
227
|
|
|
@@ -218,33 +229,31 @@ module ActiveMerchant #:nodoc:
|
|
|
218
229
|
end
|
|
219
230
|
|
|
220
231
|
def commit(action, money, parameters)
|
|
221
|
-
parameters[:amount] =
|
|
222
|
-
response = parse(
|
|
223
|
-
Response.new(response[
|
|
224
|
-
:authorization => (response[
|
|
232
|
+
parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money
|
|
233
|
+
response = parse(ssl_post(self.live_url, post_data(action, parameters)))
|
|
234
|
+
Response.new(response['response'] == '1', message_from(response), response,
|
|
235
|
+
:authorization => (response['transactionid'] || response['customer_vault_id']),
|
|
225
236
|
:test => test?,
|
|
226
|
-
:cvv_result => response[
|
|
227
|
-
:avs_result => { :code => response[
|
|
237
|
+
:cvv_result => response['cvvresponse'],
|
|
238
|
+
:avs_result => { :code => response['avsresponse'] }
|
|
228
239
|
)
|
|
229
|
-
|
|
230
240
|
end
|
|
231
241
|
|
|
232
242
|
def expdate(creditcard)
|
|
233
|
-
year = sprintf(
|
|
234
|
-
month = sprintf(
|
|
243
|
+
year = sprintf('%.04i', creditcard.year)
|
|
244
|
+
month = sprintf('%.02i', creditcard.month)
|
|
235
245
|
|
|
236
246
|
"#{month}#{year[-2..-1]}"
|
|
237
247
|
end
|
|
238
248
|
|
|
239
|
-
|
|
240
249
|
def message_from(response)
|
|
241
|
-
case response[
|
|
242
|
-
when
|
|
243
|
-
|
|
244
|
-
when
|
|
245
|
-
|
|
250
|
+
case response['responsetext']
|
|
251
|
+
when 'SUCCESS', 'Approved', nil # This is dubious, but responses from UPDATE are nil.
|
|
252
|
+
'This transaction has been approved'
|
|
253
|
+
when 'DECLINE'
|
|
254
|
+
'This transaction has been declined'
|
|
246
255
|
else
|
|
247
|
-
response[
|
|
256
|
+
response['responsetext']
|
|
248
257
|
end
|
|
249
258
|
end
|
|
250
259
|
|
|
@@ -254,19 +263,18 @@ module ActiveMerchant #:nodoc:
|
|
|
254
263
|
post[:password] = @options[:password]
|
|
255
264
|
post[:type] = action if action
|
|
256
265
|
|
|
257
|
-
request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join(
|
|
266
|
+
request = post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
258
267
|
request
|
|
259
268
|
end
|
|
260
269
|
|
|
261
270
|
def determine_funding_source(source)
|
|
262
271
|
case
|
|
263
272
|
when source.is_a?(String) then :vault
|
|
264
|
-
when CreditCard.card_companies.
|
|
273
|
+
when CreditCard.card_companies.include?(card_brand(source)) then :credit_card
|
|
265
274
|
when card_brand(source) == 'check' then :check
|
|
266
|
-
else raise ArgumentError,
|
|
275
|
+
else raise ArgumentError, 'Unsupported funding source provided'
|
|
267
276
|
end
|
|
268
277
|
end
|
|
269
278
|
end
|
|
270
279
|
end
|
|
271
280
|
end
|
|
272
|
-
|