activemerchant 1.42.6 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/CHANGELOG +1420 -2
- data/CONTRIBUTORS +106 -0
- data/README.md +107 -103
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/avs_result.rb +12 -13
- data/lib/active_merchant/billing/base.rb +13 -16
- data/lib/active_merchant/billing/check.rb +35 -24
- data/lib/active_merchant/billing/compatibility.rb +117 -0
- data/lib/active_merchant/billing/credit_card.rb +196 -81
- data/lib/active_merchant/billing/credit_card_formatting.rb +6 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +199 -75
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +171 -39
- data/lib/active_merchant/billing/gateways/adyen.rb +380 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +933 -604
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +74 -54
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +130 -370
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +23 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +351 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +109 -32
- data/lib/active_merchant/billing/gateways/beanstream.rb +59 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -9
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -498
- data/lib/active_merchant/billing/gateways/blue_snap.rb +347 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +80 -46
- data/lib/active_merchant/billing/gateways/borgun.rb +220 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +15 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +311 -121
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +244 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +311 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +6 -7
- data/lib/active_merchant/billing/gateways/card_stream.rb +235 -89
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +50 -8
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -14
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +22 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +142 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +91 -97
- data/lib/active_merchant/billing/gateways/creditcall.rb +271 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +356 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +268 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +294 -158
- data/lib/active_merchant/billing/gateways/d_local.rb +226 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +59 -347
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +24 -39
- data/lib/active_merchant/billing/gateways/elavon.rb +146 -147
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +41 -31
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +79 -78
- data/lib/active_merchant/billing/gateways/eway_managed.rb +35 -36
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +369 -228
- data/lib/active_merchant/billing/gateways/exact.rb +32 -26
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +90 -64
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -14
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +142 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +128 -122
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +190 -64
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +446 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +270 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +29 -27
- data/lib/active_merchant/billing/gateways/global_collect.rb +340 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +35 -36
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +29 -32
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -6
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +247 -41
- data/lib/active_merchant/billing/gateways/itransact.rb +4 -5
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +198 -71
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +219 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +411 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +45 -43
- data/lib/active_merchant/billing/gateways/litle.rb +328 -444
- data/lib/active_merchant/billing/gateways/mastercard.rb +267 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +145 -115
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +277 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +37 -19
- data/lib/active_merchant/billing/gateways/merchant_one.rb +13 -15
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +57 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +59 -48
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +38 -19
- data/lib/active_merchant/billing/gateways/mercury.rb +77 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +11 -30
- data/lib/active_merchant/billing/gateways/micropayment.rb +183 -0
- data/lib/active_merchant/billing/gateways/migs.rb +81 -22
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +23 -25
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +146 -64
- data/lib/active_merchant/billing/gateways/moneris_us.rb +197 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -15
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +86 -64
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +11 -5
- data/lib/active_merchant/billing/gateways/netaxept.rb +21 -22
- data/lib/active_merchant/billing/gateways/netbanx.rb +290 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +70 -35
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -6
- data/lib/active_merchant/billing/gateways/network_merchants.rb +241 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +274 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +90 -47
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +48 -20
- data/lib/active_merchant/billing/gateways/opp.rb +369 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +79 -44
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -102
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +48 -29
- data/lib/active_merchant/billing/gateways/pagarme.rb +246 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +67 -48
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +20 -26
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +188 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +7 -15
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +40 -36
- data/lib/active_merchant/billing/gateways/payeezy.rb +410 -0
- data/lib/active_merchant/billing/gateways/payex.rb +38 -30
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +62 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +74 -27
- data/lib/active_merchant/billing/gateways/payflow_express.rb +77 -81
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +54 -45
- data/lib/active_merchant/billing/gateways/paymentez.rb +304 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +160 -66
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +54 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +17 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +36 -27
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +7 -6
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -88
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +445 -0
- data/lib/active_merchant/billing/gateways/payway.rb +8 -8
- data/lib/active_merchant/billing/gateways/pin.rb +74 -18
- data/lib/active_merchant/billing/gateways/plugnpay.rb +66 -76
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +30 -30
- data/lib/active_merchant/billing/gateways/psl_card.rb +27 -34
- data/lib/active_merchant/billing/gateways/qbms.rb +65 -54
- data/lib/active_merchant/billing/gateways/quantum.rb +18 -18
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +295 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -350
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +78 -48
- data/lib/active_merchant/billing/gateways/redsys.rb +310 -170
- data/lib/active_merchant/billing/gateways/s5.rb +246 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +415 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +195 -90
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -12
- data/lib/active_merchant/billing/gateways/secure_net.rb +51 -43
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -10
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -14
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +10 -18
- data/lib/active_merchant/billing/gateways/securion_pay.rb +264 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +35 -38
- data/lib/active_merchant/billing/gateways/smart_ps.rb +50 -42
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +9 -9
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +62 -12
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -103
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +12 -18
- data/lib/active_merchant/billing/gateways/telr.rb +274 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +143 -30
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transax.rb +5 -6
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -232
- data/lib/active_merchant/billing/gateways/trexle.rb +218 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +86 -57
- data/lib/active_merchant/billing/gateways/usa_epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +196 -89
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +157 -32
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +42 -49
- data/lib/active_merchant/billing/gateways/viaklix.rb +11 -24
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +233 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +26 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +237 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +153 -31
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +207 -63
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +215 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +31 -24
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +195 -0
- data/lib/active_merchant/country.rb +335 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +10 -0
- data/lib/active_merchant/network_connection_retries.rb +80 -0
- data/lib/active_merchant/post_data.rb +25 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +23 -27
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3988 -0
- data/lib/support/gateway_support.rb +7 -9
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +6 -7
- data/lib/support/ssl_version.rb +87 -0
- metadata +148 -323
- checksums.yaml.gz.sig +0 -0
- data/gem-public_cert.pem +0 -21
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/app55.rb +0 -185
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -249
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/alipay/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/alipay/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/alipay.rb +0 -18
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -64
- data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +0 -74
- data/lib/active_merchant/billing/integrations/bit_pay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus/notification.rb +0 -133
- data/lib/active_merchant/billing/integrations/citrus/return.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus.rb +0 -51
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/doku/helper.rb +0 -102
- data/lib/active_merchant/billing/integrations/doku/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/doku/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/doku.rb +0 -24
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -118
- data/lib/active_merchant/billing/integrations/ipay88/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -29
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -23
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -60
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -154
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +0 -19
- data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +0 -16
- data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +0 -30
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -107
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -171
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -58
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/common.rb +0 -104
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/helper.rb +0 -145
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb +0 -35
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page.rb +0 -39
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -1
|
@@ -1,34 +1,289 @@
|
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
|
3
|
-
class IatsPaymentsGateway <
|
|
4
|
-
|
|
3
|
+
class IatsPaymentsGateway < Gateway
|
|
4
|
+
class_attribute :live_na_url, :live_uk_url
|
|
5
5
|
|
|
6
|
-
self.
|
|
7
|
-
self.
|
|
6
|
+
self.live_na_url = 'https://www.iatspayments.com/NetGate'
|
|
7
|
+
self.live_uk_url = 'https://www.uk.iatspayments.com/NetGate'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
self.supported_countries = %w(AU BR CA CH DE DK ES FI FR GR HK IE IT NL NO PT SE SG TR GB US TH ID PH BE)
|
|
10
|
+
self.default_currency = 'USD'
|
|
11
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
|
12
|
+
|
|
13
|
+
self.homepage_url = 'http://home.iatspayments.com/'
|
|
14
|
+
self.display_name = 'iATS Payments'
|
|
15
|
+
|
|
16
|
+
ACTIONS = {
|
|
17
|
+
purchase: 'ProcessCreditCardV1',
|
|
18
|
+
purchase_check: 'ProcessACHEFTV1',
|
|
19
|
+
refund: 'ProcessCreditCardRefundWithTransactionIdV1',
|
|
20
|
+
refund_check: 'ProcessACHEFTRefundWithTransactionIdV1',
|
|
21
|
+
store: 'CreateCreditCardCustomerCodeV1',
|
|
22
|
+
unstore: 'DeleteCustomerCodeV1'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def initialize(options={})
|
|
26
|
+
if(options[:login])
|
|
27
|
+
ActiveMerchant.deprecated("The 'login' option is deprecated in favor of 'agent_code' and will be removed in a future version.")
|
|
28
|
+
options[:agent_code] = options[:login]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
options[:region] = 'na' unless options[:region]
|
|
32
|
+
|
|
33
|
+
requires!(options, :agent_code, :password, :region)
|
|
34
|
+
super
|
|
11
35
|
end
|
|
12
36
|
|
|
13
|
-
def
|
|
14
|
-
|
|
37
|
+
def purchase(money, payment, options={})
|
|
38
|
+
post = {}
|
|
39
|
+
add_invoice(post, money, options)
|
|
40
|
+
add_payment(post, payment)
|
|
41
|
+
add_address(post, options)
|
|
42
|
+
add_ip(post, options)
|
|
43
|
+
add_description(post, options)
|
|
44
|
+
|
|
45
|
+
commit((payment.is_a?(Check) ? :purchase_check : :purchase), post)
|
|
15
46
|
end
|
|
16
47
|
|
|
17
|
-
def
|
|
18
|
-
|
|
48
|
+
def refund(money, authorization, options={})
|
|
49
|
+
post = {}
|
|
50
|
+
transaction_id, payment_type = split_authorization(authorization)
|
|
51
|
+
post[:transaction_id] = transaction_id
|
|
52
|
+
add_invoice(post, -money, options)
|
|
53
|
+
add_ip(post, options)
|
|
54
|
+
add_description(post, options)
|
|
55
|
+
|
|
56
|
+
commit((payment_type == 'check' ? :refund_check : :refund), post)
|
|
19
57
|
end
|
|
20
58
|
|
|
21
|
-
def
|
|
22
|
-
|
|
59
|
+
def store(credit_card, options = {})
|
|
60
|
+
post = {}
|
|
61
|
+
add_payment(post, credit_card)
|
|
62
|
+
add_address(post, options)
|
|
63
|
+
add_ip(post, options)
|
|
64
|
+
add_description(post, options)
|
|
65
|
+
add_store_defaults(post)
|
|
66
|
+
|
|
67
|
+
commit(:store, post)
|
|
23
68
|
end
|
|
24
69
|
|
|
25
|
-
def
|
|
26
|
-
|
|
70
|
+
def unstore(authorization, options = {})
|
|
71
|
+
post = {}
|
|
72
|
+
post[:customer_code] = authorization
|
|
73
|
+
add_ip(post, options)
|
|
74
|
+
|
|
75
|
+
commit(:unstore, post)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def supports_scrubbing?
|
|
79
|
+
true
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def scrub(transcript)
|
|
83
|
+
transcript.
|
|
84
|
+
gsub(%r((<agentCode>).+(</agentCode>)), '\1[FILTERED]\2').
|
|
85
|
+
gsub(%r((<password>).+(</password>)), '\1[FILTERED]\2').
|
|
86
|
+
gsub(%r((<creditCardNum>).+(</creditCardNum>)), '\1[FILTERED]\2').
|
|
87
|
+
gsub(%r((<cvv2>).+(</cvv2>)), '\1[FILTERED]\2').
|
|
88
|
+
gsub(%r((<accountNum>).+(</accountNum>)), '\1[FILTERED]\2')
|
|
27
89
|
end
|
|
28
90
|
|
|
29
91
|
private
|
|
30
|
-
|
|
31
|
-
|
|
92
|
+
|
|
93
|
+
def add_ip(post, options)
|
|
94
|
+
post[:customer_ip_address] = options[:ip] if options.has_key?(:ip)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def add_address(post, options)
|
|
98
|
+
billing_address = options[:billing_address] || options[:address]
|
|
99
|
+
if(billing_address)
|
|
100
|
+
post[:address] = billing_address[:address1]
|
|
101
|
+
post[:city] = billing_address[:city]
|
|
102
|
+
post[:state] = billing_address[:state]
|
|
103
|
+
post[:zip_code] = billing_address[:zip]
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def add_invoice(post, money, options)
|
|
108
|
+
post[:invoice_num] = options[:order_id] if options[:order_id]
|
|
109
|
+
post[:total] = amount(money)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def add_description(post, options)
|
|
113
|
+
post[:comment] = options[:description] if options[:description]
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def add_payment(post, payment)
|
|
117
|
+
if payment.is_a?(Check)
|
|
118
|
+
add_check(post, payment)
|
|
119
|
+
else
|
|
120
|
+
add_credit_card(post, payment)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def add_credit_card(post, payment)
|
|
125
|
+
post[:first_name] = payment.first_name
|
|
126
|
+
post[:last_name] = payment.last_name
|
|
127
|
+
post[:credit_card_num] = payment.number
|
|
128
|
+
post[:credit_card_expiry] = expdate(payment)
|
|
129
|
+
post[:cvv2] = payment.verification_value if payment.verification_value?
|
|
130
|
+
post[:mop] = creditcard_brand(payment.brand)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def add_check(post, payment)
|
|
134
|
+
post[:first_name] = payment.first_name
|
|
135
|
+
post[:last_name] = payment.last_name
|
|
136
|
+
post[:account_num] = "#{payment.routing_number}#{payment.account_number}"
|
|
137
|
+
post[:account_type] = payment.account_type.upcase
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def add_store_defaults(post)
|
|
141
|
+
post[:recurring] = false
|
|
142
|
+
post[:begin_date] = Time.now.xmlschema
|
|
143
|
+
post[:end_date] = Time.now.xmlschema
|
|
144
|
+
post[:amount] = 0
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def expdate(creditcard)
|
|
148
|
+
year = sprintf('%.4i', creditcard.year)
|
|
149
|
+
month = sprintf('%.2i', creditcard.month)
|
|
150
|
+
|
|
151
|
+
"#{month}/#{year[-2..-1]}"
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def creditcard_brand(brand)
|
|
155
|
+
case brand
|
|
156
|
+
when 'visa' then 'VISA'
|
|
157
|
+
when 'master' then 'MC'
|
|
158
|
+
when 'discover' then 'DSC'
|
|
159
|
+
when 'american_express' then 'AMX'
|
|
160
|
+
when 'maestro' then 'MAESTR'
|
|
161
|
+
else
|
|
162
|
+
raise "Unhandled credit card brand #{brand}"
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def commit(action, parameters)
|
|
167
|
+
response = parse(ssl_post(url(action), post_data(action, parameters),
|
|
168
|
+
{ 'Content-Type' => 'application/soap+xml; charset=utf-8'}))
|
|
169
|
+
|
|
170
|
+
Response.new(
|
|
171
|
+
success_from(response),
|
|
172
|
+
message_from(response),
|
|
173
|
+
response,
|
|
174
|
+
authorization: authorization_from(action, response),
|
|
175
|
+
test: test?
|
|
176
|
+
)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def endpoints
|
|
180
|
+
{
|
|
181
|
+
purchase: 'ProcessLink.asmx',
|
|
182
|
+
purchase_check: 'ProcessLink.asmx',
|
|
183
|
+
refund: 'ProcessLink.asmx',
|
|
184
|
+
refund_check: 'ProcessLink.asmx',
|
|
185
|
+
store: 'CustomerLink.asmx',
|
|
186
|
+
unstore: 'CustomerLink.asmx'
|
|
187
|
+
}
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def url(action)
|
|
191
|
+
base_url = @options[:region] == 'uk' ? live_uk_url : live_na_url
|
|
192
|
+
"#{base_url}/#{endpoints[action]}?op=#{ACTIONS[action]}"
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
def parse(body)
|
|
196
|
+
response = {}
|
|
197
|
+
hashify_xml!(body, response)
|
|
198
|
+
response
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def dexmlize_param_name(name)
|
|
202
|
+
names = {
|
|
203
|
+
'AUTHORIZATIONRESULT' => :authorization_result,
|
|
204
|
+
'SETTLEMENTBATCHDATE' => :settlement_batch_date,
|
|
205
|
+
'SETTLEMENTDATE' => :settlement_date,
|
|
206
|
+
'TRANSACTIONID' => :transaction_id
|
|
207
|
+
}
|
|
208
|
+
names[name] || name.to_s.downcase.intern
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def hashify_xml!(xml, response)
|
|
212
|
+
xml = REXML::Document.new(xml)
|
|
213
|
+
|
|
214
|
+
xml.elements.each('//IATSRESPONSE/*') do |node|
|
|
215
|
+
recursively_parse_element(node, response)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
def recursively_parse_element(node, response)
|
|
220
|
+
if(node.has_elements?)
|
|
221
|
+
node.elements.each { |n| recursively_parse_element(n, response) }
|
|
222
|
+
else
|
|
223
|
+
response[dexmlize_param_name(node.name)] = (node.text ? node.text.strip : nil)
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
def successful_result_message?(response)
|
|
228
|
+
response[:authorization_result] ? response[:authorization_result].start_with?('OK') : false
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
def success_from(response)
|
|
232
|
+
response[:status] == 'Success' && successful_result_message?(response)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
def message_from(response)
|
|
236
|
+
if !successful_result_message?(response) && response[:authorization_result]
|
|
237
|
+
return response[:authorization_result].strip
|
|
238
|
+
elsif(response[:status] == 'Failure')
|
|
239
|
+
return response[:errors]
|
|
240
|
+
else
|
|
241
|
+
response[:status]
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
def authorization_from(action, response)
|
|
246
|
+
if [:store, :unstore].include?(action)
|
|
247
|
+
response[:customercode]
|
|
248
|
+
elsif [:purchase_check].include?(action)
|
|
249
|
+
response[:transaction_id] ? "#{response[:transaction_id]}|check" : nil
|
|
250
|
+
else
|
|
251
|
+
response[:transaction_id]
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def split_authorization(authorization)
|
|
256
|
+
authorization.split('|')
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def envelope_namespaces
|
|
260
|
+
{
|
|
261
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
|
262
|
+
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
|
263
|
+
'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'
|
|
264
|
+
}
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
def post_data(action, parameters = {})
|
|
268
|
+
xml = Builder::XmlMarkup.new
|
|
269
|
+
xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
|
270
|
+
xml.tag! 'soap12:Envelope', envelope_namespaces do
|
|
271
|
+
xml.tag! 'soap12:Body' do
|
|
272
|
+
xml.tag! ACTIONS[action], { 'xmlns' => 'https://www.iatspayments.com/NetGate/' } do
|
|
273
|
+
xml.tag!('agentCode', @options[:agent_code])
|
|
274
|
+
xml.tag!('password', @options[:password])
|
|
275
|
+
parameters.each do |name, value|
|
|
276
|
+
xml.tag!(xmlize_param_name(name), value)
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
xml.target!
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
def xmlize_param_name(name)
|
|
285
|
+
names = { customer_ip_address: 'customerIPAddress' }
|
|
286
|
+
names[name] || name.to_s.camelcase(:lower)
|
|
32
287
|
end
|
|
33
288
|
end
|
|
34
289
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class InContextPaypalExpressGateway < PaypalExpressGateway
|
|
4
|
+
self.test_redirect_url = 'https://www.sandbox.paypal.com/checkoutnow'
|
|
5
|
+
self.live_redirect_url = 'https://www.paypal.com/checkoutnow'
|
|
6
|
+
|
|
7
|
+
def redirect_url_for(token, options = {})
|
|
8
|
+
options = {review: true}.update(options)
|
|
9
|
+
url = "#{redirect_url}?token=#{token}"
|
|
10
|
+
url += '&useraction=commit' unless options[:review]
|
|
11
|
+
url
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -17,7 +17,7 @@ module ActiveMerchant #:nodoc:
|
|
|
17
17
|
# ==== Options
|
|
18
18
|
#
|
|
19
19
|
# * <tt>:login</tt> -- The Inspire Username.
|
|
20
|
-
# * <tt>:password</tt> -- The Inspire
|
|
20
|
+
# * <tt>:password</tt> -- The Inspire Password.
|
|
21
21
|
# See the Inspire Integration Guide for details. (default: +false+)
|
|
22
22
|
def initialize(options = {})
|
|
23
23
|
requires!(options, :login, :password)
|
|
@@ -33,7 +33,7 @@ module ActiveMerchant #:nodoc:
|
|
|
33
33
|
def authorize(money, creditcard, options = {})
|
|
34
34
|
post = {}
|
|
35
35
|
add_invoice(post, options)
|
|
36
|
-
add_payment_source(post, creditcard,options)
|
|
36
|
+
add_payment_source(post, creditcard, options)
|
|
37
37
|
add_address(post, creditcard, options)
|
|
38
38
|
add_customer_data(post, options)
|
|
39
39
|
|
|
@@ -62,12 +62,18 @@ module ActiveMerchant #:nodoc:
|
|
|
62
62
|
commit('void', nil, post)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
+
def refund(money, authorization, options = {})
|
|
66
|
+
post = {}
|
|
67
|
+
post[:transactionid] = authorization
|
|
68
|
+
commit('refund', money, post)
|
|
69
|
+
end
|
|
70
|
+
|
|
65
71
|
# Update the values (such as CC expiration) stored at
|
|
66
72
|
# InspireGateway. The CC number must be supplied in the
|
|
67
73
|
# CreditCard object.
|
|
68
74
|
def update(vault_id, creditcard, options = {})
|
|
69
75
|
post = {}
|
|
70
|
-
post[:customer_vault] =
|
|
76
|
+
post[:customer_vault] = 'update_customer'
|
|
71
77
|
add_customer_vault_id(post, vault_id)
|
|
72
78
|
add_creditcard(post, creditcard, options)
|
|
73
79
|
add_address(post, creditcard, options)
|
|
@@ -78,7 +84,7 @@ module ActiveMerchant #:nodoc:
|
|
|
78
84
|
|
|
79
85
|
def delete(vault_id)
|
|
80
86
|
post = {}
|
|
81
|
-
post[:customer_vault] =
|
|
87
|
+
post[:customer_vault] = 'delete_customer'
|
|
82
88
|
add_customer_vault_id(post, vault_id)
|
|
83
89
|
commit(nil, nil, post)
|
|
84
90
|
end
|
|
@@ -93,6 +99,7 @@ module ActiveMerchant #:nodoc:
|
|
|
93
99
|
alias_method :unstore, :delete
|
|
94
100
|
|
|
95
101
|
private
|
|
102
|
+
|
|
96
103
|
def add_customer_data(post, options)
|
|
97
104
|
if options.has_key? :email
|
|
98
105
|
post[:email] = options[:email]
|
|
@@ -129,13 +136,13 @@ module ActiveMerchant #:nodoc:
|
|
|
129
136
|
end
|
|
130
137
|
end
|
|
131
138
|
|
|
132
|
-
def add_customer_vault_id(params,vault_id)
|
|
139
|
+
def add_customer_vault_id(params, vault_id)
|
|
133
140
|
params[:customer_vault_id] = vault_id
|
|
134
141
|
end
|
|
135
142
|
|
|
136
|
-
def add_creditcard(post, creditcard,options)
|
|
143
|
+
def add_creditcard(post, creditcard, options)
|
|
137
144
|
if options[:store]
|
|
138
|
-
post[:customer_vault] =
|
|
145
|
+
post[:customer_vault] = 'add_customer'
|
|
139
146
|
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
|
140
147
|
end
|
|
141
148
|
post[:ccnumber] = creditcard.number
|
|
@@ -157,7 +164,7 @@ module ActiveMerchant #:nodoc:
|
|
|
157
164
|
def parse(body)
|
|
158
165
|
results = {}
|
|
159
166
|
body.split(/&/).each do |pair|
|
|
160
|
-
key,val = pair.split(
|
|
167
|
+
key, val = pair.split(%r{=})
|
|
161
168
|
results[key] = val
|
|
162
169
|
end
|
|
163
170
|
|
|
@@ -167,33 +174,24 @@ module ActiveMerchant #:nodoc:
|
|
|
167
174
|
def commit(action, money, parameters)
|
|
168
175
|
parameters[:amount] = amount(money) if money
|
|
169
176
|
|
|
170
|
-
response = parse(
|
|
177
|
+
response = parse(ssl_post(self.live_url, post_data(action, parameters)))
|
|
171
178
|
|
|
172
|
-
Response.new(response[
|
|
173
|
-
:authorization => response[
|
|
179
|
+
Response.new(response['response'] == '1', message_from(response), response,
|
|
180
|
+
:authorization => response['transactionid'],
|
|
174
181
|
:test => test?,
|
|
175
|
-
:cvv_result => response[
|
|
176
|
-
:avs_result => { :code => response[
|
|
182
|
+
:cvv_result => response['cvvresponse'],
|
|
183
|
+
:avs_result => { :code => response['avsresponse'] }
|
|
177
184
|
)
|
|
178
|
-
|
|
179
185
|
end
|
|
180
186
|
|
|
181
|
-
def expdate(creditcard)
|
|
182
|
-
year = sprintf("%.4i", creditcard.year)
|
|
183
|
-
month = sprintf("%.2i", creditcard.month)
|
|
184
|
-
|
|
185
|
-
"#{month}#{year[-2..-1]}"
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
|
|
189
187
|
def message_from(response)
|
|
190
|
-
case response[
|
|
191
|
-
when
|
|
192
|
-
|
|
193
|
-
when
|
|
194
|
-
|
|
188
|
+
case response['responsetext']
|
|
189
|
+
when 'SUCCESS', 'Approved'
|
|
190
|
+
'This transaction has been approved'
|
|
191
|
+
when 'DECLINE'
|
|
192
|
+
'This transaction has been declined'
|
|
195
193
|
else
|
|
196
|
-
response[
|
|
194
|
+
response['responsetext']
|
|
197
195
|
end
|
|
198
196
|
end
|
|
199
197
|
|
|
@@ -203,19 +201,18 @@ module ActiveMerchant #:nodoc:
|
|
|
203
201
|
post[:password] = @options[:password]
|
|
204
202
|
post[:type] = action if action
|
|
205
203
|
|
|
206
|
-
request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join(
|
|
204
|
+
request = post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
207
205
|
request
|
|
208
206
|
end
|
|
209
207
|
|
|
210
208
|
def determine_funding_source(source)
|
|
211
209
|
case
|
|
212
210
|
when source.is_a?(String) then :vault
|
|
213
|
-
when CreditCard.card_companies.
|
|
211
|
+
when CreditCard.card_companies.include?(card_brand(source)) then :credit_card
|
|
214
212
|
when card_brand(source) == 'check' then :check
|
|
215
|
-
else raise ArgumentError,
|
|
213
|
+
else raise ArgumentError, 'Unsupported funding source provided'
|
|
216
214
|
end
|
|
217
215
|
end
|
|
218
216
|
end
|
|
219
217
|
end
|
|
220
218
|
end
|
|
221
|
-
|
|
@@ -16,8 +16,8 @@ module ActiveMerchant #:nodoc:
|
|
|
16
16
|
# The name of the gateway
|
|
17
17
|
self.display_name = 'InstaPay'
|
|
18
18
|
|
|
19
|
-
SUCCESS =
|
|
20
|
-
SUCCESS_MESSAGE =
|
|
19
|
+
SUCCESS = 'Accepted'
|
|
20
|
+
SUCCESS_MESSAGE = 'The transaction has been approved'
|
|
21
21
|
|
|
22
22
|
def initialize(options = {})
|
|
23
23
|
requires!(options, :login)
|
|
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
|
|
|
66
66
|
|
|
67
67
|
def add_customer_data(post, options)
|
|
68
68
|
post[:ci_email] = options[:email]
|
|
69
|
-
post[
|
|
69
|
+
post['ci_IP Address'] = options[:ip]
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def add_address(post, options)
|
|
@@ -140,7 +140,7 @@ module ActiveMerchant #:nodoc:
|
|
|
140
140
|
data = ssl_post self.live_url, post_data(action, parameters)
|
|
141
141
|
response = parse(data)
|
|
142
142
|
|
|
143
|
-
Response.new(response[:success]
|
|
143
|
+
Response.new(response[:success], response[:message], response,
|
|
144
144
|
:authorization => response[:transaction_id],
|
|
145
145
|
:avs_result => { :code => response[:avs_result] },
|
|
146
146
|
:cvv_result => response[:cvv_result]
|
|
@@ -154,10 +154,9 @@ module ActiveMerchant #:nodoc:
|
|
|
154
154
|
post[:merchantpin] = @options[:password]
|
|
155
155
|
end
|
|
156
156
|
post[:action] = action
|
|
157
|
-
request = post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join(
|
|
157
|
+
request = post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
158
158
|
request
|
|
159
159
|
end
|
|
160
160
|
end
|
|
161
161
|
end
|
|
162
162
|
end
|
|
163
|
-
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
require 'nokogiri'
|
|
2
|
+
|
|
3
|
+
module ActiveMerchant #:nodoc:
|
|
4
|
+
module Billing #:nodoc:
|
|
5
|
+
class IppGateway < Gateway
|
|
6
|
+
self.live_url = 'https://www.ippayments.com.au/interface/api/dts.asmx'
|
|
7
|
+
self.test_url = 'https://demo.ippayments.com.au/interface/api/dts.asmx'
|
|
8
|
+
|
|
9
|
+
self.supported_countries = ['AU']
|
|
10
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
|
|
11
|
+
|
|
12
|
+
self.homepage_url = 'http://www.ippayments.com.au/'
|
|
13
|
+
self.display_name = 'IPP'
|
|
14
|
+
|
|
15
|
+
self.money_format = :cents
|
|
16
|
+
|
|
17
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
|
18
|
+
'05' => STANDARD_ERROR_CODE[:card_declined],
|
|
19
|
+
'06' => STANDARD_ERROR_CODE[:processing_error],
|
|
20
|
+
'14' => STANDARD_ERROR_CODE[:invalid_number],
|
|
21
|
+
'54' => STANDARD_ERROR_CODE[:expired_card],
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def initialize(options={})
|
|
25
|
+
requires!(options, :username, :password)
|
|
26
|
+
super
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def purchase(money, payment, options={})
|
|
30
|
+
commit('SubmitSinglePayment') do |xml|
|
|
31
|
+
xml.Transaction do
|
|
32
|
+
xml.CustRef options[:order_id]
|
|
33
|
+
add_amount(xml, money)
|
|
34
|
+
xml.TrnType '1'
|
|
35
|
+
add_credit_card(xml, payment)
|
|
36
|
+
add_credentials(xml)
|
|
37
|
+
xml.TrnSource options[:ip]
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def authorize(money, payment, options={})
|
|
43
|
+
commit('SubmitSinglePayment') do |xml|
|
|
44
|
+
xml.Transaction do
|
|
45
|
+
xml.CustRef options[:order_id]
|
|
46
|
+
add_amount(xml, money)
|
|
47
|
+
xml.TrnType '2'
|
|
48
|
+
add_credit_card(xml, payment)
|
|
49
|
+
add_credentials(xml)
|
|
50
|
+
xml.TrnSource options[:ip]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def capture(money, authorization, options={})
|
|
56
|
+
commit('SubmitSingleCapture') do |xml|
|
|
57
|
+
xml.Capture do
|
|
58
|
+
xml.Receipt authorization
|
|
59
|
+
add_amount(xml, money)
|
|
60
|
+
add_credentials(xml)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def refund(money, authorization, options={})
|
|
66
|
+
commit('SubmitSingleRefund') do |xml|
|
|
67
|
+
xml.Refund do
|
|
68
|
+
xml.Receipt authorization
|
|
69
|
+
add_amount(xml, money)
|
|
70
|
+
add_credentials(xml)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def supports_scrubbing?
|
|
76
|
+
true
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def scrub(transcript)
|
|
80
|
+
transcript.
|
|
81
|
+
gsub(%r((<CardNumber>)[^<]+(<))i, '\1[FILTERED]\2').
|
|
82
|
+
gsub(%r((<CVN>)[^<]+(<))i, '\1[FILTERED]\2').
|
|
83
|
+
gsub(%r((<Password>)[^<]+(<))i, '\1[FILTERED]\2')
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
private
|
|
87
|
+
|
|
88
|
+
def add_credentials(xml)
|
|
89
|
+
xml.Security do
|
|
90
|
+
xml.UserName @options[:username]
|
|
91
|
+
xml.Password @options[:password]
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def add_amount(xml, money)
|
|
96
|
+
xml.Amount amount(money)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def add_credit_card(xml, payment)
|
|
100
|
+
xml.CreditCard :Registered => 'False' do
|
|
101
|
+
xml.CardNumber payment.number
|
|
102
|
+
xml.ExpM format(payment.month, :two_digits)
|
|
103
|
+
xml.ExpY format(payment.year, :four_digits)
|
|
104
|
+
xml.CVN payment.verification_value
|
|
105
|
+
xml.CardHolderName payment.name
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def parse(body)
|
|
110
|
+
element = Nokogiri::XML(body).root.first_element_child.first_element_child
|
|
111
|
+
|
|
112
|
+
response = {}
|
|
113
|
+
doc = Nokogiri::XML(element)
|
|
114
|
+
doc.root.elements.each do |e|
|
|
115
|
+
response[e.name.underscore.to_sym] = e.inner_text
|
|
116
|
+
end
|
|
117
|
+
response
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def commit(action, &block)
|
|
121
|
+
headers = {
|
|
122
|
+
'Content-Type' => 'text/xml; charset=utf-8',
|
|
123
|
+
'SOAPAction' => "http://www.ippayments.com.au/interface/api/dts/#{action}",
|
|
124
|
+
}
|
|
125
|
+
response = parse(ssl_post(commit_url, new_submit_xml(action, &block), headers))
|
|
126
|
+
|
|
127
|
+
Response.new(
|
|
128
|
+
success_from(response),
|
|
129
|
+
message_from(response),
|
|
130
|
+
response,
|
|
131
|
+
authorization: authorization_from(response),
|
|
132
|
+
error_code: error_code_from(response),
|
|
133
|
+
test: test?
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def new_submit_xml(action)
|
|
138
|
+
xml = Builder::XmlMarkup.new(indent: 2)
|
|
139
|
+
xml.instruct!
|
|
140
|
+
xml.soap :Envelope, 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' do
|
|
141
|
+
xml.soap :Body do
|
|
142
|
+
xml.__send__(action, 'xmlns' => 'http://www.ippayments.com.au/interface/api/dts') do
|
|
143
|
+
xml.trnXML do
|
|
144
|
+
inner_xml = Builder::XmlMarkup.new(indent: 2)
|
|
145
|
+
yield(inner_xml)
|
|
146
|
+
xml.cdata!(inner_xml.target!)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
xml.target!
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def commit_url
|
|
155
|
+
(test? ? test_url : live_url)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def success_from(response)
|
|
159
|
+
(response[:response_code] == '0')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def error_code_from(response)
|
|
163
|
+
STANDARD_ERROR_CODE_MAPPING[response[:declined_code]]
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def message_from(response)
|
|
167
|
+
response[:declined_message]
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def authorization_from(response)
|
|
171
|
+
response[:receipt]
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|