activemerchant 1.38.0 → 1.79.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1402 -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 +152 -53
- 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 +299 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +904 -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 +326 -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 +221 -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 +387 -139
- 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 +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +23 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +225 -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 +237 -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 +110 -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 +26 -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 +33 -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 +73 -14
- 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/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +81 -56
- 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 +276 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -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 +37 -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 +32 -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 +14 -14
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/qbms.rb +12 -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 +40 -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 +262 -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 +14 -3
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +74 -14
- data/lib/active_merchant/billing/gateways/stripe.rb +472 -83
- 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 +156 -64
- 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 +171 -45
- 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 +208 -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/net_http_ssl_connection.rb +9 -0
- data/lib/active_merchant/network_connection_retries.rb +81 -0
- data/lib/active_merchant/post_data.rb +24 -0
- data/lib/active_merchant/posts_data.rb +94 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +22 -22
- data/lib/certs/cacert.pem +3951 -0
- data/lib/support/gateway_support.rb +16 -10
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_version.rb +87 -0
- metadata +164 -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
@@ -1,5 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require "cgi"
|
1
|
+
require 'json'
|
3
2
|
|
4
3
|
module ActiveMerchant #:nodoc:
|
5
4
|
module Billing #:nodoc:
|
@@ -8,214 +7,269 @@ module ActiveMerchant #:nodoc:
|
|
8
7
|
self.live_url = "https://api.ewaypayments.com/"
|
9
8
|
|
10
9
|
self.money_format = :cents
|
11
|
-
self.supported_countries = [
|
12
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
10
|
+
self.supported_countries = ['AU', 'NZ', 'GB', 'SG', 'MY', 'HK']
|
11
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
|
13
12
|
self.homepage_url = "http://www.eway.com.au/"
|
14
|
-
self.display_name = "eWAY Rapid 3.
|
13
|
+
self.display_name = "eWAY Rapid 3.1"
|
15
14
|
self.default_currency = "AUD"
|
16
15
|
|
16
|
+
class_attribute :partner_id
|
17
|
+
|
17
18
|
def initialize(options = {})
|
18
19
|
requires!(options, :login, :password)
|
19
20
|
super
|
20
21
|
end
|
21
22
|
|
22
|
-
# Public: Run a purchase transaction.
|
23
|
-
# redirect as an API endpoint in order to conform to the standard
|
24
|
-
# ActiveMerchant #purchase API.
|
23
|
+
# Public: Run a purchase transaction.
|
25
24
|
#
|
26
|
-
# amount
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
25
|
+
# amount - The monetary amount of the transaction in cents.
|
26
|
+
# payment_method - The payment method or authorization token returned from store.
|
27
|
+
# options - A standard ActiveMerchant options hash:
|
28
|
+
# :transaction_type - One of: Purchase (default), MOTO
|
29
|
+
# or Recurring. For stored card payments (aka - TokenPayments),
|
30
|
+
# this must be either MOTO or Recurring.
|
31
|
+
# :invoice - The merchant’s invoice number for this
|
32
|
+
# transaction (optional).
|
33
|
+
# :order_id - A merchant-supplied identifier for the
|
34
|
+
# transaction (optional).
|
35
|
+
# :description - A merchant-supplied description of the
|
36
|
+
# transaction (optional).
|
37
|
+
# :currency - Three letter currency code for the
|
38
|
+
# transaction (default: "AUD")
|
39
|
+
# :billing_address - Standard ActiveMerchant address hash
|
40
|
+
# (optional).
|
41
|
+
# :shipping_address - Standard ActiveMerchant address hash
|
42
|
+
# (optional).
|
43
|
+
# :ip - The ip of the consumer initiating the
|
44
|
+
# transaction (optional).
|
45
|
+
# :application_id - A string identifying the application
|
46
|
+
# submitting the transaction
|
47
|
+
# (default: "https://github.com/activemerchant/active_merchant")
|
43
48
|
#
|
44
|
-
# Returns an ActiveMerchant::Billing::Response object
|
49
|
+
# Returns an ActiveMerchant::Billing::Response object where authorization is the Transaction ID on success
|
45
50
|
def purchase(amount, payment_method, options={})
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
r.process{status(r.authorization)}
|
54
|
-
end
|
51
|
+
params = {}
|
52
|
+
add_metadata(params, options)
|
53
|
+
add_invoice(params, amount, options)
|
54
|
+
add_customer_data(params, options)
|
55
|
+
add_credit_card(params, payment_method, options)
|
56
|
+
params['Method'] = payment_method.respond_to?(:number) ? 'ProcessPayment' : 'TokenPayment'
|
57
|
+
commit(url_for('Transaction'), params)
|
55
58
|
end
|
56
59
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
# :ip - The ip of the consumer initiating the
|
75
|
-
# transaction (optional).
|
76
|
-
# :application_id - A string identifying the application
|
77
|
-
# submitting the transaction
|
78
|
-
# (default: "https://github.com/Shopify/active_merchant")
|
79
|
-
#
|
80
|
-
# Returns an EwayRapidResponse object, which conforms to the
|
81
|
-
# ActiveMerchant::Billing::Response API, but also exposes #form_url.
|
82
|
-
def setup_purchase(amount, options={})
|
83
|
-
requires!(options, :redirect_url)
|
84
|
-
request = build_xml_request("CreateAccessCodeRequest") do |doc|
|
85
|
-
add_metadata(doc, options)
|
86
|
-
add_invoice(doc, amount, options)
|
87
|
-
add_customer_data(doc, options)
|
88
|
-
end
|
60
|
+
def authorize(amount, payment_method, options={})
|
61
|
+
params = {}
|
62
|
+
add_metadata(params, options)
|
63
|
+
add_invoice(params, amount, options)
|
64
|
+
add_customer_data(params, options)
|
65
|
+
add_credit_card(params, payment_method, options)
|
66
|
+
params['Method'] = 'Authorise'
|
67
|
+
commit(url_for('Authorisation'), params)
|
68
|
+
end
|
69
|
+
|
70
|
+
def capture(amount, identification, options = {})
|
71
|
+
params = {}
|
72
|
+
add_metadata(params, options)
|
73
|
+
add_invoice(params, amount, options)
|
74
|
+
add_reference(params, identification)
|
75
|
+
commit(url_for("CapturePayment"), params)
|
76
|
+
end
|
89
77
|
|
90
|
-
|
78
|
+
def void(identification, options = {})
|
79
|
+
params = {}
|
80
|
+
add_reference(params, identification)
|
81
|
+
commit(url_for("CancelAuthorisation"), params)
|
91
82
|
end
|
92
83
|
|
93
|
-
# Public:
|
84
|
+
# Public: Refund a transaction.
|
94
85
|
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
86
|
+
# amount - The monetary amount of the transaction in cents
|
87
|
+
# identification - The transaction id which is returned in the
|
88
|
+
# authorization of the successful purchase transaction
|
89
|
+
# options - A standard ActiveMerchant options hash:
|
90
|
+
# :invoice - The merchant’s invoice number for this
|
91
|
+
# transaction (optional).
|
92
|
+
# :order_id - A merchant-supplied identifier for the
|
93
|
+
# transaction (optional).
|
94
|
+
# :description - A merchant-supplied description of the
|
95
|
+
# transaction (optional).
|
96
|
+
# :currency - Three letter currency code for the
|
97
|
+
# transaction (default: "AUD")
|
98
|
+
# :billing_address - Standard ActiveMerchant address hash
|
99
|
+
# (optional).
|
100
|
+
# :shipping_address - Standard ActiveMerchant address hash
|
101
|
+
# (optional).
|
102
|
+
# :ip - The ip of the consumer initiating the
|
103
|
+
# transaction (optional).
|
104
|
+
# :application_id - A string identifying the application
|
105
|
+
# submitting the transaction
|
106
|
+
# (default: "https://github.com/activemerchant/active_merchant")
|
98
107
|
#
|
99
|
-
# Returns an
|
100
|
-
def
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
108
|
+
# Returns an ActiveMerchant::Billing::Response object
|
109
|
+
def refund(amount, identification, options = {})
|
110
|
+
params = {}
|
111
|
+
add_metadata(params, options)
|
112
|
+
add_invoice(params, amount, options, "Refund")
|
113
|
+
add_reference(params["Refund"], identification)
|
114
|
+
add_customer_data(params, options)
|
115
|
+
commit(url_for("Transaction/#{identification}/Refund"), params)
|
105
116
|
end
|
106
117
|
|
107
118
|
# Public: Store card details and return a valid token
|
108
119
|
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
120
|
+
# payment_method - The payment method or nil if :customer_token is provided
|
121
|
+
# options - A supplemented ActiveMerchant options hash:
|
122
|
+
# :order_id - A merchant-supplied identifier for the
|
123
|
+
# transaction (optional).
|
124
|
+
# :description - A merchant-supplied description of the
|
125
|
+
# transaction (optional).
|
126
|
+
# :billing_address - Standard ActiveMerchant address hash
|
127
|
+
# (required).
|
128
|
+
# :ip - The ip of the consumer initiating the
|
129
|
+
# transaction (optional).
|
130
|
+
# :application_id - A string identifying the application
|
131
|
+
# submitting the transaction
|
132
|
+
# (default: "https://github.com/activemerchant/active_merchant")
|
133
|
+
#
|
134
|
+
# Returns an ActiveMerchant::Billing::Response object where the authorization is the customer_token on success
|
119
135
|
def store(payment_method, options = {})
|
120
136
|
requires!(options, :billing_address)
|
121
|
-
|
137
|
+
params = {}
|
138
|
+
add_metadata(params, options)
|
139
|
+
add_invoice(params, 0, options)
|
140
|
+
add_customer_data(params, options)
|
141
|
+
add_credit_card(params, payment_method, options)
|
142
|
+
params['Method'] = 'CreateTokenCustomer'
|
143
|
+
commit(url_for("Transaction"), params)
|
122
144
|
end
|
123
145
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
146
|
+
# Public: Update a customer's data
|
147
|
+
#
|
148
|
+
# customer_token - The customer token returned in the authorization of
|
149
|
+
# a successful store transaction.
|
150
|
+
# payment_method - The payment method or nil if :customer_token is provided
|
151
|
+
# options - A supplemented ActiveMerchant options hash:
|
152
|
+
# :order_id - A merchant-supplied identifier for the
|
153
|
+
# transaction (optional).
|
154
|
+
# :description - A merchant-supplied description of the
|
155
|
+
# transaction (optional).
|
156
|
+
# :billing_address - Standard ActiveMerchant address hash
|
157
|
+
# (optional).
|
158
|
+
# :ip - The ip of the consumer initiating the
|
159
|
+
# transaction (optional).
|
160
|
+
# :application_id - A string identifying the application
|
161
|
+
# submitting the transaction
|
162
|
+
# (default: "https://github.com/activemerchant/active_merchant")
|
163
|
+
#
|
164
|
+
# Returns an ActiveMerchant::Billing::Response object where the authorization is the customer_token on success
|
165
|
+
def update(customer_token, payment_method, options = {})
|
166
|
+
params = {}
|
167
|
+
add_metadata(params, options)
|
168
|
+
add_invoice(params, 0, options)
|
169
|
+
add_customer_data(params, options)
|
170
|
+
add_credit_card(params, payment_method, options)
|
171
|
+
add_customer_token(params, customer_token)
|
172
|
+
params['Method'] = 'UpdateTokenCustomer'
|
173
|
+
commit(url_for("Transaction"), params)
|
174
|
+
end
|
131
175
|
|
132
|
-
|
176
|
+
def supports_scrubbing
|
177
|
+
true
|
133
178
|
end
|
134
179
|
|
135
|
-
def
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
180
|
+
def scrub(transcript)
|
181
|
+
transcript.
|
182
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
183
|
+
gsub(%r(("Number\\?":\\?")[^"]*)i, '\1[FILTERED]').
|
184
|
+
gsub(%r(("CVN\\?":\\?"?)[^",]*)i, '\1[FILTERED]')
|
140
185
|
end
|
141
186
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
187
|
+
private
|
188
|
+
|
189
|
+
def add_metadata(params, options)
|
190
|
+
params['RedirectUrl'] = options[:redirect_url] || 'http://example.com'
|
191
|
+
params['CustomerIP'] = options[:ip] if options[:ip]
|
192
|
+
params['TransactionType'] = options[:transaction_type] || 'Purchase'
|
193
|
+
params['DeviceID'] = options[:application_id] || application_id
|
194
|
+
if partner = options[:partner_id] || partner_id
|
195
|
+
params['PartnerID'] = truncate(partner, 50)
|
149
196
|
end
|
197
|
+
params
|
150
198
|
end
|
151
199
|
|
152
|
-
def
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
200
|
+
def add_invoice(params, money, options, key = "Payment")
|
201
|
+
currency_code = options[:currency] || currency(money)
|
202
|
+
params[key] = {
|
203
|
+
'TotalAmount' => localized_amount(money, currency_code),
|
204
|
+
'InvoiceReference' => truncate(options[:order_id], 50),
|
205
|
+
'InvoiceNumber' => truncate(options[:invoice] || options[:order_id], 12),
|
206
|
+
'InvoiceDescription' => truncate(options[:description], 64),
|
207
|
+
'CurrencyCode' => currency_code,
|
208
|
+
}
|
159
209
|
end
|
160
210
|
|
161
|
-
def
|
162
|
-
|
163
|
-
if name = address[:name]
|
164
|
-
parts = name.split(/\s+/)
|
165
|
-
doc.FirstName parts.shift if parts.size > 1
|
166
|
-
doc.LastName parts.join(" ")
|
167
|
-
end
|
168
|
-
doc.Title address[:title]
|
169
|
-
doc.CompanyName address[:company] unless options[:skip_company]
|
170
|
-
doc.Street1 address[:address1]
|
171
|
-
doc.Street2 address[:address2]
|
172
|
-
doc.City address[:city]
|
173
|
-
doc.State address[:state]
|
174
|
-
doc.PostalCode address[:zip]
|
175
|
-
doc.Country address[:country].to_s.downcase
|
176
|
-
doc.Phone address[:phone]
|
177
|
-
doc.Fax address[:fax]
|
178
|
-
doc.Email options[:email]
|
211
|
+
def add_reference(params, reference)
|
212
|
+
params['TransactionID'] = reference
|
179
213
|
end
|
180
214
|
|
181
|
-
def
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
post["cardcvn"] = credit_card.verification_value
|
215
|
+
def add_customer_data(params, options)
|
216
|
+
params['Customer'] ||= {}
|
217
|
+
add_address(params['Customer'], (options[:billing_address] || options[:address]), {:email => options[:email]})
|
218
|
+
params['ShippingAddress'] = {}
|
219
|
+
add_address(params['ShippingAddress'], options[:shipping_address], {:skip_company => true})
|
187
220
|
end
|
188
221
|
|
189
|
-
def
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
222
|
+
def add_address(params, address, options={})
|
223
|
+
return unless address
|
224
|
+
|
225
|
+
params['FirstName'], params['LastName'] = split_names(address[:name])
|
226
|
+
params['Title'] = address[:title]
|
227
|
+
params['CompanyName'] = address[:company] unless options[:skip_company]
|
228
|
+
params['Street1'] = truncate(address[:address1], 50)
|
229
|
+
params['Street2'] = truncate(address[:address2], 50)
|
230
|
+
params['City'] = truncate(address[:city], 50)
|
231
|
+
params['State'] = address[:state]
|
232
|
+
params['PostalCode'] = address[:zip]
|
233
|
+
params['Country'] = address[:country].to_s.downcase
|
234
|
+
params['Phone'] = address[:phone]
|
235
|
+
params['Fax'] = address[:fax]
|
236
|
+
params['Email'] = options[:email]
|
195
237
|
end
|
196
238
|
|
197
|
-
def
|
198
|
-
|
199
|
-
|
200
|
-
|
239
|
+
def add_credit_card(params, credit_card, options)
|
240
|
+
return unless credit_card
|
241
|
+
params['Customer'] ||= {}
|
242
|
+
if credit_card.respond_to? :number
|
243
|
+
card_details = params['Customer']['CardDetails'] = {}
|
244
|
+
card_details['Name'] = truncate(credit_card.name, 50)
|
245
|
+
card_details['Number'] = credit_card.number
|
246
|
+
card_details['ExpiryMonth'] = "%02d" % (credit_card.month || 0)
|
247
|
+
card_details['ExpiryYear'] = "%02d" % (credit_card.year || 0)
|
248
|
+
card_details['CVN'] = credit_card.verification_value
|
249
|
+
else
|
250
|
+
add_customer_token(params, credit_card)
|
201
251
|
end
|
202
|
-
|
252
|
+
end
|
253
|
+
|
254
|
+
def add_customer_token(params, token)
|
255
|
+
params['Customer'] ||= {}
|
256
|
+
params['Customer']['TokenCustomerID'] = token
|
203
257
|
end
|
204
258
|
|
205
259
|
def url_for(action)
|
206
|
-
(test? ? test_url : live_url) + action
|
260
|
+
(test? ? test_url : live_url) + action
|
207
261
|
end
|
208
262
|
|
209
|
-
def commit(url,
|
263
|
+
def commit(url, params)
|
210
264
|
headers = {
|
211
265
|
"Authorization" => ("Basic " + Base64.strict_encode64(@options[:login].to_s + ":" + @options[:password].to_s).chomp),
|
212
|
-
"Content-Type" => "
|
266
|
+
"Content-Type" => "application/json"
|
213
267
|
}
|
214
|
-
|
268
|
+
request = params.to_json
|
215
269
|
raw = parse(ssl_post(url, request, headers))
|
216
270
|
|
217
271
|
succeeded = success?(raw)
|
218
|
-
|
272
|
+
ActiveMerchant::Billing::Response.new(
|
219
273
|
succeeded,
|
220
274
|
message_from(succeeded, raw),
|
221
275
|
raw,
|
@@ -225,57 +279,37 @@ module ActiveMerchant #:nodoc:
|
|
225
279
|
:cvv_result => cvv_result_from(raw)
|
226
280
|
)
|
227
281
|
rescue ActiveMerchant::ResponseError => e
|
228
|
-
return
|
282
|
+
return ActiveMerchant::Billing::Response.new(false, e.response.message, {:status_code => e.response.code}, :test => test?)
|
229
283
|
end
|
230
284
|
|
231
|
-
def
|
232
|
-
|
233
|
-
|
234
|
-
success = (http_response.code.to_s == "302")
|
235
|
-
message = (success ? "Succeeded" : http_response.body)
|
236
|
-
if success
|
237
|
-
authorization = CGI.unescape(http_response["Location"].split("=").last)
|
238
|
-
end
|
239
|
-
Response.new(success, message, {:location => http_response["Location"]}, :authorization => authorization, :test => test?)
|
240
|
-
end
|
241
|
-
|
242
|
-
def parse(xml)
|
243
|
-
response = {}
|
244
|
-
|
245
|
-
doc = Nokogiri::XML(xml)
|
246
|
-
doc.root.xpath("*").each do |node|
|
247
|
-
if (node.elements.size == 0)
|
248
|
-
response[node.name.downcase.to_sym] = node.text
|
249
|
-
else
|
250
|
-
node.elements.each do |childnode|
|
251
|
-
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
252
|
-
response[name.to_sym] = childnode.text
|
253
|
-
end
|
254
|
-
end
|
255
|
-
end unless doc.root.nil?
|
256
|
-
|
257
|
-
response
|
285
|
+
def parse(data)
|
286
|
+
JSON.parse(data)
|
258
287
|
end
|
259
288
|
|
260
289
|
def success?(response)
|
261
|
-
if response[
|
262
|
-
false
|
263
|
-
elsif response[:responsecode] == "00"
|
290
|
+
if response['ResponseCode'] == "00"
|
264
291
|
true
|
265
|
-
elsif response[
|
266
|
-
(response[
|
292
|
+
elsif response['TransactionStatus']
|
293
|
+
(response['TransactionStatus'] == true)
|
294
|
+
elsif response["Succeeded"]
|
295
|
+
(response["Succeeded"] == true)
|
267
296
|
else
|
268
|
-
|
297
|
+
false
|
269
298
|
end
|
270
299
|
end
|
271
300
|
|
301
|
+
def parse_errors(message)
|
302
|
+
errors = message.split(',').collect{|code| MESSAGES[code.strip]}.flatten.join(',')
|
303
|
+
errors.presence || message
|
304
|
+
end
|
305
|
+
|
272
306
|
def message_from(succeeded, response)
|
273
|
-
if response[
|
274
|
-
response[
|
275
|
-
elsif response[
|
276
|
-
|
277
|
-
elsif response[
|
278
|
-
response[
|
307
|
+
if response['Errors']
|
308
|
+
parse_errors(response['Errors'])
|
309
|
+
elsif response['ResponseMessage']
|
310
|
+
parse_errors(response['ResponseMessage'])
|
311
|
+
elsif response['ResponseCode']
|
312
|
+
ActiveMerchant::Billing::EwayGateway::MESSAGES[response['ResponseCode']]
|
279
313
|
elsif succeeded
|
280
314
|
"Succeeded"
|
281
315
|
else
|
@@ -284,11 +318,14 @@ module ActiveMerchant #:nodoc:
|
|
284
318
|
end
|
285
319
|
|
286
320
|
def authorization_from(response)
|
287
|
-
|
321
|
+
# Note: TransactionID is always null for store requests, but TokenCustomerID is also sent back for purchase from
|
322
|
+
# stored card transactions so we give precedence to TransactionID
|
323
|
+
response['TransactionID'] || response['Customer']['TokenCustomerID']
|
288
324
|
end
|
289
325
|
|
290
326
|
def avs_result_from(response)
|
291
|
-
|
327
|
+
verification = response['Verification'] || {}
|
328
|
+
code = case verification['Address']
|
292
329
|
when "Valid"
|
293
330
|
"M"
|
294
331
|
when "Invalid"
|
@@ -300,7 +337,8 @@ module ActiveMerchant #:nodoc:
|
|
300
337
|
end
|
301
338
|
|
302
339
|
def cvv_result_from(response)
|
303
|
-
|
340
|
+
verification = response['Verification'] || {}
|
341
|
+
case verification['CVN']
|
304
342
|
when "Valid"
|
305
343
|
"M"
|
306
344
|
when "Invalid"
|
@@ -310,11 +348,186 @@ module ActiveMerchant #:nodoc:
|
|
310
348
|
end
|
311
349
|
end
|
312
350
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
351
|
+
MESSAGES = {
|
352
|
+
'A2000' => 'Transaction Approved Successful',
|
353
|
+
'A2008' => 'Honour With Identification Successful',
|
354
|
+
'A2010' => 'Approved For Partial Amount Successful',
|
355
|
+
'A2011' => 'Approved, VIP Successful',
|
356
|
+
'A2016' => 'Approved, Update Track 3 Successful',
|
357
|
+
'D4401' => 'Refer to Issuer Failed',
|
358
|
+
'D4402' => 'Refer to Issuer, special Failed',
|
359
|
+
'D4403' => 'No Merchant Failed',
|
360
|
+
'D4404' => 'Pick Up Card Failed',
|
361
|
+
'D4405' => 'Do Not Honour Failed',
|
362
|
+
'D4406' => 'Error Failed',
|
363
|
+
'D4407' => 'Pick Up Card, Special Failed',
|
364
|
+
'D4409' => 'Request In Progress Failed',
|
365
|
+
'D4412' => 'Invalid Transaction Failed',
|
366
|
+
'D4413' => 'Invalid Amount Failed',
|
367
|
+
'D4414' => 'Invalid Card Number Failed',
|
368
|
+
'D4415' => 'No Issuer Failed',
|
369
|
+
'D4419' => 'Re-enter Last Transaction Failed',
|
370
|
+
'D4421' => 'No Action Taken Failed',
|
371
|
+
'D4422' => 'Suspected Malfunction Failed',
|
372
|
+
'D4423' => 'Unacceptable Transaction Fee Failed',
|
373
|
+
'D4425' => 'Unable to Locate Record On File Failed',
|
374
|
+
'D4430' => 'Format Error Failed ',
|
375
|
+
'D4431' => 'Bank Not Supported By Switch Failed',
|
376
|
+
'D4433' => 'Expired Card, Capture Failed ',
|
377
|
+
'D4434' => 'Suspected Fraud, Retain Card Failed',
|
378
|
+
'D4435' => 'Card Acceptor, Contact Acquirer, Retain Card Failed',
|
379
|
+
'D4436' => 'Restricted Card, Retain Card Failed',
|
380
|
+
'D4437' => 'Contact Acquirer Security Department, Retain Card Failed',
|
381
|
+
'D4438' => 'PIN Tries Exceeded, Capture Failed',
|
382
|
+
'D4439' => 'No Credit Account Failed',
|
383
|
+
'D4440' => 'Function Not Supported Failed',
|
384
|
+
'D4441' => 'Lost Card Failed',
|
385
|
+
'D4442' => 'No Universal Account Failed',
|
386
|
+
'D4443' => 'Stolen Card Failed',
|
387
|
+
'D4444' => 'No Investment Account Failed',
|
388
|
+
'D4451' => 'Insufficient Funds Failed',
|
389
|
+
'D4452' => 'No Cheque Account Failed',
|
390
|
+
'D4453' => 'No Savings Account Failed',
|
391
|
+
'D4454' => 'Expired Card Failed',
|
392
|
+
'D4455' => 'Incorrect PIN Failed',
|
393
|
+
'D4456' => 'No Card Record Failed',
|
394
|
+
'D4457' => 'Function Not Permitted to Cardholder Failed',
|
395
|
+
'D4458' => 'Function Not Permitted to Terminal Failed',
|
396
|
+
'D4459' => 'Suspected Fraud Failed',
|
397
|
+
'D4460' => 'Acceptor Contact Acquirer Failed',
|
398
|
+
'D4461' => 'Exceeds Withdrawal Limit Failed',
|
399
|
+
'D4462' => 'Restricted Card Failed',
|
400
|
+
'D4463' => 'Security Violation Failed',
|
401
|
+
'D4464' => 'Original Amount Incorrect Failed',
|
402
|
+
'D4466' => 'Acceptor Contact Acquirer, Security Failed',
|
403
|
+
'D4467' => 'Capture Card Failed',
|
404
|
+
'D4475' => 'PIN Tries Exceeded Failed',
|
405
|
+
'D4482' => 'CVV Validation Error Failed',
|
406
|
+
'D4490' => 'Cut off In Progress Failed',
|
407
|
+
'D4491' => 'Card Issuer Unavailable Failed',
|
408
|
+
'D4492' => 'Unable To Route Transaction Failed',
|
409
|
+
'D4493' => 'Cannot Complete, Violation Of The Law Failed',
|
410
|
+
'D4494' => 'Duplicate Transaction Failed',
|
411
|
+
'D4496' => 'System Error Failed',
|
412
|
+
'D4497' => 'MasterPass Error Failed',
|
413
|
+
'D4498' => 'PayPal Create Transaction Error Failed',
|
414
|
+
'D4499' => 'Invalid Transaction for Auth/Void Failed',
|
415
|
+
'S5000' => 'System Error',
|
416
|
+
'S5011' => 'PayPal Connection Error',
|
417
|
+
'S5012' => 'PayPal Settings Error',
|
418
|
+
'S5085' => 'Started 3dSecure',
|
419
|
+
'S5086' => 'Routed 3dSecure',
|
420
|
+
'S5087' => 'Completed 3dSecure',
|
421
|
+
'S5088' => 'PayPal Transaction Created',
|
422
|
+
'S5099' => 'Incomplete (Access Code in progress/incomplete)',
|
423
|
+
'S5010' => 'Unknown error returned by gateway',
|
424
|
+
'V6000' => 'Validation error',
|
425
|
+
'V6001' => 'Invalid CustomerIP',
|
426
|
+
'V6002' => 'Invalid DeviceID',
|
427
|
+
'V6003' => 'Invalid Request PartnerID',
|
428
|
+
'V6004' => 'Invalid Request Method',
|
429
|
+
'V6010' => 'Invalid TransactionType, account not certified for eCome only MOTO or Recurring available',
|
430
|
+
'V6011' => 'Invalid Payment TotalAmount',
|
431
|
+
'V6012' => 'Invalid Payment InvoiceDescription',
|
432
|
+
'V6013' => 'Invalid Payment InvoiceNumber',
|
433
|
+
'V6014' => 'Invalid Payment InvoiceReference',
|
434
|
+
'V6015' => 'Invalid Payment CurrencyCode',
|
435
|
+
'V6016' => 'Payment Required',
|
436
|
+
'V6017' => 'Payment CurrencyCode Required',
|
437
|
+
'V6018' => 'Unknown Payment CurrencyCode',
|
438
|
+
'V6021' => 'EWAY_CARDHOLDERNAME Required',
|
439
|
+
'V6022' => 'EWAY_CARDNUMBER Required',
|
440
|
+
'V6023' => 'EWAY_CARDCVN Required',
|
441
|
+
'V6033' => 'Invalid Expiry Date',
|
442
|
+
'V6034' => 'Invalid Issue Number',
|
443
|
+
'V6035' => 'Invalid Valid From Date',
|
444
|
+
'V6040' => 'Invalid TokenCustomerID',
|
445
|
+
'V6041' => 'Customer Required',
|
446
|
+
'V6042' => 'Customer FirstName Required',
|
447
|
+
'V6043' => 'Customer LastName Required',
|
448
|
+
'V6044' => 'Customer CountryCode Required',
|
449
|
+
'V6045' => 'Customer Title Required ',
|
450
|
+
'V6046' => 'TokenCustomerID Required',
|
451
|
+
'V6047' => 'RedirectURL Required',
|
452
|
+
'V6048' => 'Invalid Checkout URL',
|
453
|
+
'V6051' => 'Invalid Customer FirstName',
|
454
|
+
'V6052' => 'Invalid Customer LastName',
|
455
|
+
'V6053' => 'Invalid Customer CountryCode',
|
456
|
+
'V6058' => 'Invalid Customer Title ',
|
457
|
+
'V6059' => 'Invalid RedirectURL',
|
458
|
+
'V6060' => 'Invalid TokenCustomerID',
|
459
|
+
'V6061' => 'Invalid Customer Reference',
|
460
|
+
'V6062' => 'Invalid Customer CompanyName',
|
461
|
+
'V6063' => 'Invalid Customer JobDescription',
|
462
|
+
'V6064' => 'Invalid Customer Street1',
|
463
|
+
'V6065' => 'Invalid Customer Street2',
|
464
|
+
'V6066' => 'Invalid Customer City',
|
465
|
+
'V6067' => 'Invalid Customer State',
|
466
|
+
'V6068' => 'Invalid Customer PostalCode',
|
467
|
+
'V6069' => 'Invalid Customer Email ',
|
468
|
+
'V6070' => 'Invalid Customer Phone',
|
469
|
+
'V6071' => 'Invalid Customer Mobile',
|
470
|
+
'V6072' => 'Invalid Customer Comments',
|
471
|
+
'V6073' => 'Invalid Customer Fax',
|
472
|
+
'V6074' => 'Invalid Customer URL',
|
473
|
+
'V6075' => 'Invalid ShippingAddress FirstName',
|
474
|
+
'V6076' => 'Invalid ShippingAddress LastName',
|
475
|
+
'V6077' => 'Invalid ShippingAddress Street1',
|
476
|
+
'V6078' => 'Invalid ShippingAddress Street2',
|
477
|
+
'V6079' => 'Invalid ShippingAddress City',
|
478
|
+
'V6080' => 'Invalid ShippingAddress State',
|
479
|
+
'V6081' => 'Invalid ShippingAddress PostalCode',
|
480
|
+
'V6082' => 'Invalid ShippingAddress Email',
|
481
|
+
'V6083' => 'Invalid ShippingAddress Phone',
|
482
|
+
'V6084' => 'Invalid ShippingAddress Country',
|
483
|
+
'V6085' => 'Invalid ShippingAddress ShippingMethod',
|
484
|
+
'V6086' => 'Invalid ShippingAddress Fax',
|
485
|
+
'V6091' => 'Unknown Customer CountryCode',
|
486
|
+
'V6092' => 'Unknown ShippingAddress CountryCode',
|
487
|
+
'V6100' => 'Invalid EWAY_CARDNAME',
|
488
|
+
'V6101' => 'Invalid EWAY_CARDEXPIRYMONTH',
|
489
|
+
'V6102' => 'Invalid EWAY_CARDEXPIRYYEAR ',
|
490
|
+
'V6103' => 'Invalid EWAY_CARDSTARTMONTH',
|
491
|
+
'V6104' => 'Invalid EWAY_CARDSTARTYEAR',
|
492
|
+
'V6105' => 'Invalid EWAY_CARDISSUENUMBER ',
|
493
|
+
'V6106' => 'Invalid EWAY_CARDCVN',
|
494
|
+
'V6107' => 'Invalid EWAY_ACCESSCODE',
|
495
|
+
'V6108' => 'Invalid CustomerHostAddress',
|
496
|
+
'V6109' => 'Invalid UserAgent',
|
497
|
+
'V6110' => 'Invalid EWAY_CARDNUMBER',
|
498
|
+
'V6111' => 'Unauthorised API Access, Account Not PCI Certified',
|
499
|
+
'V6112' => 'Redundant card details other than expiry year and month',
|
500
|
+
'V6113' => 'Invalid transaction for refund',
|
501
|
+
'V6114' => 'Gateway validation error',
|
502
|
+
'V6115' => 'Invalid DirectRefundRequest, Transaction ID',
|
503
|
+
'V6116' => 'Invalid card data on original TransactionID',
|
504
|
+
'V6117' => 'Invalid CreateAccessCodeSharedRequest, FooterText',
|
505
|
+
'V6118' => 'Invalid CreateAccessCodeSharedRequest, HeaderText',
|
506
|
+
'V6119' => 'Invalid CreateAccessCodeSharedRequest, Language',
|
507
|
+
'V6120' => 'Invalid CreateAccessCodeSharedRequest, LogoUrl ',
|
508
|
+
'V6121' => 'Invalid TransactionSearch, Filter Match Type',
|
509
|
+
'V6122' => 'Invalid TransactionSearch, Non numeric Transaction ID',
|
510
|
+
'V6123' => 'Invalid TransactionSearch,no TransactionID or AccessCode specified',
|
511
|
+
'V6124' => 'Invalid Line Items. The line items have been provided however the totals do not match the TotalAmount field',
|
512
|
+
'V6125' => 'Selected Payment Type not enabled',
|
513
|
+
'V6126' => 'Invalid encrypted card number, decryption failed',
|
514
|
+
'V6127' => 'Invalid encrypted cvn, decryption failed',
|
515
|
+
'V6128' => 'Invalid Method for Payment Type',
|
516
|
+
'V6129' => 'Transaction has not been authorised for Capture/Cancellation',
|
517
|
+
'V6130' => 'Generic customer information error ',
|
518
|
+
'V6131' => 'Generic shipping information error',
|
519
|
+
'V6132' => 'Transaction has already been completed or voided, operation not permitted',
|
520
|
+
'V6133' => 'Checkout not available for Payment Type',
|
521
|
+
'V6134' => 'Invalid Auth Transaction ID for Capture/Void',
|
522
|
+
'V6135' => 'PayPal Error Processing Refund',
|
523
|
+
'V6140' => 'Merchant account is suspended',
|
524
|
+
'V6141' => 'Invalid PayPal account details or API signature',
|
525
|
+
'V6142' => 'Authorise not available for Bank/Branch',
|
526
|
+
'V6150' => 'Invalid Refund Amount',
|
527
|
+
'V6151' => 'Refund amount greater than original transaction',
|
528
|
+
'V6152' => 'Original transaction already refunded for total amount',
|
529
|
+
'V6153' => 'Card type not support by merchant',
|
530
|
+
}
|
318
531
|
end
|
319
532
|
end
|
320
533
|
end
|