activemerchant 1.38.0 → 1.78.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1344 -3
- data/CONTRIBUTORS +154 -0
- data/README.md +157 -144
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/base.rb +21 -17
- data/lib/active_merchant/billing/check.rb +32 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +215 -67
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +149 -52
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +170 -24
- data/lib/active_merchant/billing/gateways/adyen.rb +284 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +899 -606
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +43 -18
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +134 -346
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +13 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +325 -0
- data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +96 -15
- data/lib/active_merchant/billing/gateways/beanstream.rb +52 -9
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -8
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -501
- data/lib/active_merchant/billing/gateways/blue_snap.rb +343 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +94 -50
- data/lib/active_merchant/billing/gateways/borgun.rb +222 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +14 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +372 -137
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +245 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +269 -118
- data/lib/active_merchant/billing/gateways/cardknox.rb +328 -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 +45 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +239 -0
- 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 +226 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +23 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +222 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +224 -0
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +345 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +228 -98
- data/lib/active_merchant/billing/gateways/data_cash.rb +41 -314
- data/lib/active_merchant/billing/gateways/dibs.rb +205 -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 +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +143 -142
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +23 -12
- data/lib/active_merchant/billing/gateways/eway.rb +12 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +417 -204
- data/lib/active_merchant/billing/gateways/exact.rb +10 -1
- data/lib/active_merchant/billing/gateways/ezic.rb +196 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +65 -37
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +109 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +155 -29
- 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 +256 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +11 -5
- data/lib/active_merchant/billing/gateways/global_collect.rb +334 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- 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/ideal/ideal_base.rb +2 -5
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +1 -1
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -10
- data/lib/active_merchant/billing/gateways/instapay.rb +0 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +210 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +176 -49
- 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 +227 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +17 -13
- data/lib/active_merchant/billing/gateways/litle.rb +329 -439
- data/lib/active_merchant/billing/gateways/mastercard.rb +268 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +15 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -15
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +24 -13
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +74 -29
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -21
- data/lib/active_merchant/billing/gateways/micropayment.rb +185 -0
- data/lib/active_merchant/billing/gateways/migs.rb +74 -13
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -3
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +119 -36
- data/lib/active_merchant/billing/gateways/moneris_us.rb +146 -45
- data/lib/active_merchant/billing/gateways/money_movers.rb +152 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +78 -53
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +289 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +61 -26
- data/lib/active_merchant/billing/gateways/netpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/network_merchants.rb +242 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +265 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +85 -27
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +227 -0
- data/lib/active_merchant/billing/gateways/opp.rb +372 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +59 -28
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -56
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +207 -0
- data/lib/active_merchant/billing/gateways/pagarme.rb +248 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +246 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -14
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +19 -25
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +16 -12
- data/lib/active_merchant/billing/gateways/payeezy.rb +386 -0
- data/lib/active_merchant/billing/gateways/payex.rb +412 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +38 -17
- data/lib/active_merchant/billing/gateways/payflow.rb +100 -19
- data/lib/active_merchant/billing/gateways/payflow_express.rb +22 -22
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +6 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +15 -3
- data/lib/active_merchant/billing/gateways/paymentez.rb +283 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +41 -8
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +18 -4
- data/lib/active_merchant/billing/gateways/paypal.rb +49 -20
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +6 -5
- 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 +162 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +22 -24
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +440 -0
- data/lib/active_merchant/billing/gateways/pin.rb +68 -13
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +3 -14
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +299 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -319
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +27 -25
- data/lib/active_merchant/billing/gateways/redsys.rb +212 -80
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +258 -0
- data/lib/active_merchant/billing/gateways/sage.rb +412 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +176 -59
- data/lib/active_merchant/billing/gateways/secure_net.rb +35 -29
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -9
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +21 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/securion_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +13 -2
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +36 -11
- data/lib/active_merchant/billing/gateways/stripe.rb +461 -82
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +156 -0
- data/lib/active_merchant/billing/gateways/telr.rb +275 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +142 -28
- 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/transnational.rb +2 -231
- data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +17 -11
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +193 -75
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +150 -63
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -15
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +209 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +45 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +238 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +167 -49
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +131 -36
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +218 -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 +24 -17
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +177 -0
- data/lib/active_merchant/country.rb +334 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/network_connection_retries.rb +79 -0
- data/lib/active_merchant/post_data.rb +24 -0
- data/lib/active_merchant/posts_data.rb +84 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +24 -21
- data/lib/certs/cacert.pem +3951 -0
- data/lib/support/gateway_support.rb +16 -10
- data/lib/support/outbound_hosts.rb +13 -10
- metadata +161 -306
- data/gem-public_cert.pem +0 -20
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -155
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- 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 -73
- 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/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/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/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 -114
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -95
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -19
- 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 -129
- 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/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 -28
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -165
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -43
- 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 -74
- 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 -91
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -139
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -17
- 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/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 -0
@@ -0,0 +1,343 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module ActiveMerchant
|
4
|
+
module Billing
|
5
|
+
class BlueSnapGateway < Gateway
|
6
|
+
self.test_url = "https://sandbox.bluesnap.com/services/2"
|
7
|
+
self.live_url = "https://ws.bluesnap.com/services/2"
|
8
|
+
self.supported_countries = %w(US CA GB AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE)
|
9
|
+
|
10
|
+
self.default_currency = 'USD'
|
11
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro]
|
12
|
+
|
13
|
+
self.homepage_url = 'https://home.bluesnap.com/'
|
14
|
+
self.display_name = 'BlueSnap'
|
15
|
+
|
16
|
+
TRANSACTIONS = {
|
17
|
+
purchase: "AUTH_CAPTURE",
|
18
|
+
authorize: "AUTH_ONLY",
|
19
|
+
capture: "CAPTURE",
|
20
|
+
void: "AUTH_REVERSAL",
|
21
|
+
refund: "REFUND"
|
22
|
+
}
|
23
|
+
|
24
|
+
CVC_CODE_TRANSLATOR = {
|
25
|
+
'MA' => 'M',
|
26
|
+
'NC' => 'U',
|
27
|
+
'ND' => 'P',
|
28
|
+
'NM' => 'N',
|
29
|
+
'NP' => 'S'
|
30
|
+
}
|
31
|
+
|
32
|
+
AVS_CODE_TRANSLATOR = {
|
33
|
+
'line1: U, zip: U, name: U' => 'I',
|
34
|
+
'line1: U, zip: U, name: M' => 'I',
|
35
|
+
'line1: U, zip: U, name: N' => 'I',
|
36
|
+
'line1: U, zip: M, name: U' => 'P',
|
37
|
+
'line1: U, zip: M, name: M' => 'P',
|
38
|
+
'line1: U, zip: M, name: N' => 'F',
|
39
|
+
'line1: U, zip: N, name: U' => 'O',
|
40
|
+
'line1: U, zip: N, name: M' => 'O',
|
41
|
+
'line1: U, zip: N, name: N' => 'O',
|
42
|
+
'line1: M, zip: U, name: U' => 'B',
|
43
|
+
'line1: M, zip: U, name: M' => 'B',
|
44
|
+
'line1: M, zip: U, name: N' => 'T',
|
45
|
+
'line1: M, zip: M, name: U' => 'M',
|
46
|
+
'line1: M, zip: M, name: M' => 'V',
|
47
|
+
'line1: M, zip: M, name: N' => 'H',
|
48
|
+
'line1: M, zip: N, name: U' => 'A',
|
49
|
+
'line1: M, zip: N, name: M' => 'O',
|
50
|
+
'line1: M, zip: N, name: N' => 'A',
|
51
|
+
'line1: N, zip: U, name: U' => 'C',
|
52
|
+
'line1: N, zip: U, name: M' => 'C',
|
53
|
+
'line1: N, zip: U, name: N' => 'C',
|
54
|
+
'line1: N, zip: M, name: U' => 'W',
|
55
|
+
'line1: N, zip: M, name: M' => 'L',
|
56
|
+
'line1: N, zip: M, name: N' => 'W',
|
57
|
+
'line1: N, zip: N, name: U' => 'N',
|
58
|
+
'line1: N, zip: N, name: M' => 'K',
|
59
|
+
'line1: N, zip: N, name: N' => 'N',
|
60
|
+
}
|
61
|
+
|
62
|
+
def initialize(options={})
|
63
|
+
requires!(options, :api_username, :api_password)
|
64
|
+
super
|
65
|
+
end
|
66
|
+
|
67
|
+
def purchase(money, payment_method, options={})
|
68
|
+
commit(:purchase) do |doc|
|
69
|
+
add_auth_purchase(doc, money, payment_method, options)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def authorize(money, payment_method, options={})
|
74
|
+
commit(:authorize) do |doc|
|
75
|
+
add_auth_purchase(doc, money, payment_method, options)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def capture(money, authorization, options={})
|
80
|
+
commit(:capture, :put) do |doc|
|
81
|
+
add_authorization(doc, authorization)
|
82
|
+
add_order(doc, options)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def refund(money, authorization, options={})
|
87
|
+
commit(:refund, :put) do |doc|
|
88
|
+
add_authorization(doc, authorization)
|
89
|
+
add_amount(doc, money, options)
|
90
|
+
add_order(doc, options)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def void(authorization, options={})
|
95
|
+
commit(:void, :put) do |doc|
|
96
|
+
add_authorization(doc, authorization)
|
97
|
+
add_order(doc, options)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def verify(payment_method, options={})
|
102
|
+
authorize(0, payment_method, options)
|
103
|
+
end
|
104
|
+
|
105
|
+
def store(credit_card, options = {})
|
106
|
+
commit(:store) do |doc|
|
107
|
+
add_personal_info(doc, credit_card, options)
|
108
|
+
doc.send("payment-sources") do
|
109
|
+
doc.send("credit-card-info") do
|
110
|
+
add_credit_card(doc, credit_card)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
add_order(doc, options)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def verify_credentials
|
118
|
+
begin
|
119
|
+
ssl_get("#{url}/nonexistent", headers)
|
120
|
+
rescue ResponseError => e
|
121
|
+
return false if e.response.code.to_i == 401
|
122
|
+
end
|
123
|
+
|
124
|
+
true
|
125
|
+
end
|
126
|
+
|
127
|
+
def supports_scrubbing?
|
128
|
+
true
|
129
|
+
end
|
130
|
+
|
131
|
+
def scrub(transcript)
|
132
|
+
transcript.
|
133
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
134
|
+
gsub(%r((<card-number>).+(</card-number>)), '\1[FILTERED]\2').
|
135
|
+
gsub(%r((<security-code>).+(</security-code>)), '\1[FILTERED]\2')
|
136
|
+
end
|
137
|
+
|
138
|
+
private
|
139
|
+
|
140
|
+
def add_auth_purchase(doc, money, payment_method, options)
|
141
|
+
doc.send("recurring-transaction", options[:recurring] ? "RECURRING" : "ECOMMERCE")
|
142
|
+
add_order(doc, options)
|
143
|
+
add_amount(doc, money, options)
|
144
|
+
doc.send("transaction-fraud-info") do
|
145
|
+
doc.send("shopper-ip-address", options[:ip]) if options[:ip]
|
146
|
+
end
|
147
|
+
|
148
|
+
if payment_method.is_a?(String)
|
149
|
+
doc.send("vaulted-shopper-id", payment_method)
|
150
|
+
else
|
151
|
+
doc.send("card-holder-info") do
|
152
|
+
add_personal_info(doc, payment_method, options)
|
153
|
+
end
|
154
|
+
add_credit_card(doc, payment_method)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def add_amount(doc, money, options)
|
159
|
+
doc.amount(amount(money))
|
160
|
+
doc.currency(options[:currency] || currency(money))
|
161
|
+
end
|
162
|
+
|
163
|
+
def add_personal_info(doc, credit_card, options)
|
164
|
+
doc.send("first-name", credit_card.first_name)
|
165
|
+
doc.send("last-name", credit_card.last_name)
|
166
|
+
doc.email(options[:email]) if options[:email]
|
167
|
+
add_address(doc, options)
|
168
|
+
end
|
169
|
+
|
170
|
+
def add_credit_card(doc, card)
|
171
|
+
doc.send("credit-card") do
|
172
|
+
doc.send("card-number", card.number)
|
173
|
+
doc.send("security-code", card.verification_value)
|
174
|
+
doc.send("expiration-month", card.month)
|
175
|
+
doc.send("expiration-year", card.year)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def add_description(doc, description)
|
180
|
+
doc.send("transaction-meta-data") do
|
181
|
+
doc.send("meta-data") do
|
182
|
+
doc.send("meta-key", "description")
|
183
|
+
doc.send("meta-value", truncate(description, 500))
|
184
|
+
doc.send("meta-description", "Description")
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def add_order(doc, options)
|
190
|
+
doc.send("merchant-transaction-id", truncate(options[:order_id], 50)) if options[:order_id]
|
191
|
+
doc.send("soft-descriptor", options[:soft_descriptor]) if options[:soft_descriptor]
|
192
|
+
add_description(doc, options[:description]) if options[:description]
|
193
|
+
end
|
194
|
+
|
195
|
+
def add_address(doc, options)
|
196
|
+
address = options[:billing_address]
|
197
|
+
return unless address
|
198
|
+
|
199
|
+
doc.country(address[:country]) if address[:country]
|
200
|
+
doc.state(address[:state]) if address[:state]
|
201
|
+
doc.address(address[:address]) if address[:address]
|
202
|
+
doc.city(address[:city]) if address[:city]
|
203
|
+
doc.zip(address[:zip]) if address[:zip]
|
204
|
+
end
|
205
|
+
|
206
|
+
def add_authorization(doc, authorization)
|
207
|
+
doc.send("transaction-id", authorization)
|
208
|
+
end
|
209
|
+
|
210
|
+
def parse(response)
|
211
|
+
return bad_authentication_response if response.code.to_i == 401
|
212
|
+
|
213
|
+
parsed = {}
|
214
|
+
doc = Nokogiri::XML(response.body)
|
215
|
+
doc.root.xpath('*').each do |node|
|
216
|
+
if (node.elements.empty?)
|
217
|
+
parsed[node.name.downcase] = node.text
|
218
|
+
else
|
219
|
+
node.elements.each do |childnode|
|
220
|
+
parse_element(parsed, childnode)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
parsed["content-location-header"] = response['content-location']
|
226
|
+
parsed
|
227
|
+
end
|
228
|
+
|
229
|
+
def parse_element(parsed, node)
|
230
|
+
if !node.elements.empty?
|
231
|
+
node.elements.each {|e| parse_element(parsed, e) }
|
232
|
+
else
|
233
|
+
parsed[node.name.downcase] = node.text
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
def api_request(action, request, verb)
|
238
|
+
begin
|
239
|
+
ssl_request(verb, url(action), request, headers)
|
240
|
+
rescue ResponseError => e
|
241
|
+
e.response
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
def commit(action, verb = :post)
|
246
|
+
request = build_xml_request(action) { |doc| yield(doc) }
|
247
|
+
response = api_request(action, request, verb)
|
248
|
+
parsed = parse(response)
|
249
|
+
|
250
|
+
succeeded = success_from(action, response)
|
251
|
+
Response.new(
|
252
|
+
succeeded,
|
253
|
+
message_from(succeeded, parsed),
|
254
|
+
parsed,
|
255
|
+
authorization: authorization_from(action, parsed),
|
256
|
+
avs_result: avs_result(parsed),
|
257
|
+
cvv_result: cvv_result(parsed),
|
258
|
+
error_code: error_code_from(parsed),
|
259
|
+
test: test?,
|
260
|
+
)
|
261
|
+
end
|
262
|
+
|
263
|
+
def url(action = nil)
|
264
|
+
base = test? ? test_url : live_url
|
265
|
+
resource = (action == :store) ? "vaulted-shoppers" : "transactions"
|
266
|
+
"#{base}/#{resource}"
|
267
|
+
end
|
268
|
+
|
269
|
+
def cvv_result(parsed)
|
270
|
+
CVVResult.new(CVC_CODE_TRANSLATOR[parsed["cvv-response-code"]])
|
271
|
+
end
|
272
|
+
|
273
|
+
def avs_result(parsed)
|
274
|
+
AVSResult.new(code: AVS_CODE_TRANSLATOR[avs_lookup_key(parsed)])
|
275
|
+
end
|
276
|
+
|
277
|
+
def avs_lookup_key(p)
|
278
|
+
"line1: #{p['avs-response-code-address']}, zip: #{p['avs-response-code-zip']}, name: #{p['avs-response-code-name']}"
|
279
|
+
end
|
280
|
+
|
281
|
+
def success_from(action, response)
|
282
|
+
(200...300).include?(response.code.to_i)
|
283
|
+
end
|
284
|
+
|
285
|
+
def message_from(succeeded, parsed_response)
|
286
|
+
return "Success" if succeeded
|
287
|
+
parsed_response["description"]
|
288
|
+
end
|
289
|
+
|
290
|
+
def authorization_from(action, parsed_response)
|
291
|
+
(action == :store) ? vaulted_shopper_id(parsed_response) : parsed_response["transaction-id"]
|
292
|
+
end
|
293
|
+
|
294
|
+
def vaulted_shopper_id(parsed_response)
|
295
|
+
return nil unless parsed_response["content-location-header"]
|
296
|
+
parsed_response["content-location-header"].split("/").last
|
297
|
+
end
|
298
|
+
|
299
|
+
def error_code_from(parsed_response)
|
300
|
+
parsed_response["code"]
|
301
|
+
end
|
302
|
+
|
303
|
+
def root_attributes
|
304
|
+
{
|
305
|
+
xmlns: "http://ws.plimus.com"
|
306
|
+
}
|
307
|
+
end
|
308
|
+
|
309
|
+
def root_element(action)
|
310
|
+
(action == :store) ? "vaulted-shopper" : "card-transaction"
|
311
|
+
end
|
312
|
+
|
313
|
+
def headers
|
314
|
+
{
|
315
|
+
'Content-Type' => 'application/xml',
|
316
|
+
'Authorization' => ('Basic ' + Base64.strict_encode64("#{@options[:api_username]}:#{@options[:api_password]}").strip),
|
317
|
+
}
|
318
|
+
end
|
319
|
+
|
320
|
+
def build_xml_request(action)
|
321
|
+
builder = Nokogiri::XML::Builder.new
|
322
|
+
builder.__send__(root_element(action), root_attributes) do |doc|
|
323
|
+
doc.send("card-transaction-type", TRANSACTIONS[action]) if TRANSACTIONS[action]
|
324
|
+
yield(doc)
|
325
|
+
end
|
326
|
+
builder.doc.root.to_xml
|
327
|
+
end
|
328
|
+
|
329
|
+
def handle_response(response)
|
330
|
+
case response.code.to_i
|
331
|
+
when 200...300
|
332
|
+
response
|
333
|
+
else
|
334
|
+
raise ResponseError.new(response)
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
338
|
+
def bad_authentication_response
|
339
|
+
{ "description" => "Unable to authenticate. Please check your credentials." }
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|
@@ -4,70 +4,54 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
class BogusGateway < Gateway
|
5
5
|
AUTHORIZATION = '53433'
|
6
6
|
|
7
|
+
AUTHORIZATION_EMV_SUCCESS = '8A023030'
|
8
|
+
AUTHORIZATION_EMV_DECLINE = '8A023035'
|
9
|
+
|
7
10
|
SUCCESS_MESSAGE = "Bogus Gateway: Forced success"
|
8
11
|
FAILURE_MESSAGE = "Bogus Gateway: Forced failure"
|
9
|
-
|
10
|
-
|
12
|
+
NUMBER_ERROR_MESSAGE = "Bogus Gateway: Use CreditCard number ending in 1 for success, 2 for exception and anything else for error"
|
13
|
+
AMOUNT_ERROR_MESSAGE = "Bogus Gateway: Use amount ending in 00 for success, 05 for failure and anything else for exception"
|
11
14
|
UNSTORE_ERROR_MESSAGE = "Bogus Gateway: Use trans_id ending in 1 for success, 2 for exception and anything else for error"
|
12
15
|
CAPTURE_ERROR_MESSAGE = "Bogus Gateway: Use authorization number ending in 1 for exception, 2 for error and anything else for success"
|
13
16
|
VOID_ERROR_MESSAGE = "Bogus Gateway: Use authorization number ending in 1 for exception, 2 for error and anything else for success"
|
14
17
|
REFUND_ERROR_MESSAGE = "Bogus Gateway: Use trans_id number ending in 1 for exception, 2 for error and anything else for success"
|
18
|
+
CHECK_ERROR_MESSAGE = "Bogus Gateway: Use bank account number ending in 1 for success, 2 for exception and anything else for error"
|
15
19
|
|
16
|
-
self.supported_countries = [
|
20
|
+
self.supported_countries = []
|
17
21
|
self.supported_cardtypes = [:bogus]
|
18
22
|
self.homepage_url = 'http://example.com'
|
19
23
|
self.display_name = 'Bogus'
|
20
24
|
|
21
|
-
def authorize(money,
|
22
|
-
|
23
|
-
|
24
|
-
when /1$/
|
25
|
-
Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money}, :test => true, :authorization => AUTHORIZATION )
|
26
|
-
when /2$/
|
27
|
-
Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money, :error => FAILURE_MESSAGE }, :test => true)
|
25
|
+
def authorize(money, paysource, options = {})
|
26
|
+
if paysource.respond_to?(:emv?) && paysource.emv?
|
27
|
+
authorize_emv(money, paysource, options)
|
28
28
|
else
|
29
|
-
|
29
|
+
authorize_swipe(money, paysource, options)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def purchase(money,
|
34
|
-
|
35
|
-
|
36
|
-
when /1$/, AUTHORIZATION
|
37
|
-
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true, :authorization => AUTHORIZATION)
|
38
|
-
when /2$/
|
39
|
-
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
|
33
|
+
def purchase(money, paysource, options = {})
|
34
|
+
if paysource.respond_to?(:emv?) && paysource.emv?
|
35
|
+
purchase_emv(money, paysource, options)
|
40
36
|
else
|
41
|
-
|
37
|
+
purchase_swipe(money, paysource, options)
|
42
38
|
end
|
43
39
|
end
|
44
40
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
|
50
|
-
when /2$/
|
51
|
-
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
|
52
|
-
else
|
53
|
-
raise Error, ERROR_MESSAGE
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def credit(money, credit_card_or_reference, options = {})
|
58
|
-
if credit_card_or_reference.is_a?(String)
|
59
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
60
|
-
return refund(money, credit_card_or_reference, options)
|
41
|
+
def credit(money, paysource, options = {})
|
42
|
+
if paysource.is_a?(String)
|
43
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
44
|
+
return refund(money, paysource, options)
|
61
45
|
end
|
62
46
|
|
63
47
|
money = amount(money)
|
64
|
-
case normalize(
|
48
|
+
case normalize(paysource)
|
65
49
|
when /1$/
|
66
50
|
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true )
|
67
51
|
when /2$/
|
68
|
-
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
|
52
|
+
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
69
53
|
else
|
70
|
-
raise Error,
|
54
|
+
raise Error, error_message(paysource)
|
71
55
|
end
|
72
56
|
end
|
73
57
|
|
@@ -77,7 +61,7 @@ module ActiveMerchant #:nodoc:
|
|
77
61
|
when /1$/
|
78
62
|
raise Error, REFUND_ERROR_MESSAGE
|
79
63
|
when /2$/
|
80
|
-
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
|
64
|
+
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
81
65
|
else
|
82
66
|
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
|
83
67
|
end
|
@@ -89,7 +73,7 @@ module ActiveMerchant #:nodoc:
|
|
89
73
|
when /1$/
|
90
74
|
raise Error, CAPTURE_ERROR_MESSAGE
|
91
75
|
when /2$/
|
92
|
-
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
|
76
|
+
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
93
77
|
else
|
94
78
|
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
|
95
79
|
end
|
@@ -100,20 +84,20 @@ module ActiveMerchant #:nodoc:
|
|
100
84
|
when /1$/
|
101
85
|
raise Error, VOID_ERROR_MESSAGE
|
102
86
|
when /2$/
|
103
|
-
Response.new(false, FAILURE_MESSAGE, {:authorization => reference, :error => FAILURE_MESSAGE }, :test => true)
|
87
|
+
Response.new(false, FAILURE_MESSAGE, {:authorization => reference, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
104
88
|
else
|
105
89
|
Response.new(true, SUCCESS_MESSAGE, {:authorization => reference}, :test => true)
|
106
90
|
end
|
107
91
|
end
|
108
92
|
|
109
|
-
def store(
|
110
|
-
case normalize(
|
93
|
+
def store(paysource, options = {})
|
94
|
+
case normalize(paysource)
|
111
95
|
when /1$/
|
112
96
|
Response.new(true, SUCCESS_MESSAGE, {:billingid => '1'}, :test => true, :authorization => AUTHORIZATION)
|
113
97
|
when /2$/
|
114
|
-
Response.new(false, FAILURE_MESSAGE, {:billingid => nil, :error => FAILURE_MESSAGE }, :test => true)
|
98
|
+
Response.new(false, FAILURE_MESSAGE, {:billingid => nil, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
115
99
|
else
|
116
|
-
raise Error,
|
100
|
+
raise Error, error_message(paysource)
|
117
101
|
end
|
118
102
|
end
|
119
103
|
|
@@ -122,7 +106,7 @@ module ActiveMerchant #:nodoc:
|
|
122
106
|
when /1$/
|
123
107
|
Response.new(true, SUCCESS_MESSAGE, {}, :test => true)
|
124
108
|
when /2$/
|
125
|
-
Response.new(false, FAILURE_MESSAGE, {:error => FAILURE_MESSAGE },:test => true)
|
109
|
+
Response.new(false, FAILURE_MESSAGE, {:error => FAILURE_MESSAGE },:test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
126
110
|
else
|
127
111
|
raise Error, UNSTORE_ERROR_MESSAGE
|
128
112
|
end
|
@@ -130,11 +114,71 @@ module ActiveMerchant #:nodoc:
|
|
130
114
|
|
131
115
|
private
|
132
116
|
|
133
|
-
def
|
134
|
-
|
135
|
-
|
117
|
+
def authorize_emv(money, paysource, options = {})
|
118
|
+
money = amount(money)
|
119
|
+
case money
|
120
|
+
when /00$/
|
121
|
+
Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money}, :test => true, :authorization => AUTHORIZATION, :emv_authorization => AUTHORIZATION_EMV_SUCCESS)
|
122
|
+
when /05$/
|
123
|
+
Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error], :emv_authorization => AUTHORIZATION_EMV_DECLINE)
|
124
|
+
else
|
125
|
+
raise Error, error_message(paysource)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def authorize_swipe(money, paysource, options = {})
|
130
|
+
money = amount(money)
|
131
|
+
case normalize(paysource)
|
132
|
+
when /1$/
|
133
|
+
Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money}, :test => true, :authorization => AUTHORIZATION )
|
134
|
+
when /2$/
|
135
|
+
Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
136
|
+
else
|
137
|
+
raise Error, error_message(paysource)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def purchase_emv(money, paysource, options = {})
|
142
|
+
money = amount(money)
|
143
|
+
case money
|
144
|
+
when /00$/
|
145
|
+
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true, :authorization => AUTHORIZATION, :emv_authorization => AUTHORIZATION_EMV_SUCCESS)
|
146
|
+
when /05$/
|
147
|
+
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error], :emv_authorization => AUTHORIZATION_EMV_DECLINE)
|
136
148
|
else
|
137
|
-
|
149
|
+
raise Error, error_message(paysource)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def purchase_swipe(money, paysource, options = {})
|
154
|
+
money = amount(money)
|
155
|
+
case normalize(paysource)
|
156
|
+
when /1$/, AUTHORIZATION
|
157
|
+
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true, :authorization => AUTHORIZATION)
|
158
|
+
when /2$/
|
159
|
+
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true, :error_code => STANDARD_ERROR_CODE[:processing_error])
|
160
|
+
else
|
161
|
+
raise Error, error_message(paysource)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def normalize(paysource)
|
166
|
+
if paysource.respond_to?(:account_number) && (paysource.try(:number).blank? || paysource.number.blank?)
|
167
|
+
paysource.account_number
|
168
|
+
elsif paysource.respond_to?(:number)
|
169
|
+
paysource.number
|
170
|
+
else
|
171
|
+
paysource.to_s
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def error_message(paysource)
|
176
|
+
if paysource.respond_to?(:emv?) && paysource.emv?
|
177
|
+
AMOUNT_ERROR_MESSAGE
|
178
|
+
elsif paysource.respond_to?(:account_number)
|
179
|
+
CHECK_ERROR_MESSAGE
|
180
|
+
elsif paysource.respond_to?(:number)
|
181
|
+
NUMBER_ERROR_MESSAGE
|
138
182
|
end
|
139
183
|
end
|
140
184
|
end
|