activemerchant 1.38.0 → 1.78.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1344 -3
- data/CONTRIBUTORS +154 -0
- data/README.md +157 -144
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/base.rb +21 -17
- data/lib/active_merchant/billing/check.rb +32 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +215 -67
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +149 -52
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +170 -24
- data/lib/active_merchant/billing/gateways/adyen.rb +284 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +899 -606
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +43 -18
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +134 -346
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +13 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +325 -0
- data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +96 -15
- data/lib/active_merchant/billing/gateways/beanstream.rb +52 -9
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -8
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -501
- data/lib/active_merchant/billing/gateways/blue_snap.rb +343 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +94 -50
- data/lib/active_merchant/billing/gateways/borgun.rb +222 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +14 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +372 -137
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +245 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +269 -118
- data/lib/active_merchant/billing/gateways/cardknox.rb +328 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +45 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +239 -0
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +226 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +23 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +222 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +224 -0
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +345 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +228 -98
- data/lib/active_merchant/billing/gateways/data_cash.rb +41 -314
- data/lib/active_merchant/billing/gateways/dibs.rb +205 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +143 -142
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +23 -12
- data/lib/active_merchant/billing/gateways/eway.rb +12 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +417 -204
- data/lib/active_merchant/billing/gateways/exact.rb +10 -1
- data/lib/active_merchant/billing/gateways/ezic.rb +196 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +65 -37
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +109 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +155 -29
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +256 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +11 -5
- data/lib/active_merchant/billing/gateways/global_collect.rb +334 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +2 -5
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +1 -1
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -10
- data/lib/active_merchant/billing/gateways/instapay.rb +0 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +210 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +176 -49
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +227 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +17 -13
- data/lib/active_merchant/billing/gateways/litle.rb +329 -439
- data/lib/active_merchant/billing/gateways/mastercard.rb +268 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +15 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -15
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +24 -13
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +74 -29
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -21
- data/lib/active_merchant/billing/gateways/micropayment.rb +185 -0
- data/lib/active_merchant/billing/gateways/migs.rb +74 -13
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -3
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +119 -36
- data/lib/active_merchant/billing/gateways/moneris_us.rb +146 -45
- data/lib/active_merchant/billing/gateways/money_movers.rb +152 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +78 -53
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +289 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +61 -26
- data/lib/active_merchant/billing/gateways/netpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/network_merchants.rb +242 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +265 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +85 -27
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +227 -0
- data/lib/active_merchant/billing/gateways/opp.rb +372 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +59 -28
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -56
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +207 -0
- data/lib/active_merchant/billing/gateways/pagarme.rb +248 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +246 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -14
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +19 -25
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +16 -12
- data/lib/active_merchant/billing/gateways/payeezy.rb +386 -0
- data/lib/active_merchant/billing/gateways/payex.rb +412 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +38 -17
- data/lib/active_merchant/billing/gateways/payflow.rb +100 -19
- data/lib/active_merchant/billing/gateways/payflow_express.rb +22 -22
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +6 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +15 -3
- data/lib/active_merchant/billing/gateways/paymentez.rb +283 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +41 -8
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +18 -4
- data/lib/active_merchant/billing/gateways/paypal.rb +49 -20
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +6 -5
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +162 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +22 -24
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +440 -0
- data/lib/active_merchant/billing/gateways/pin.rb +68 -13
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +3 -14
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +299 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -319
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +27 -25
- data/lib/active_merchant/billing/gateways/redsys.rb +212 -80
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +258 -0
- data/lib/active_merchant/billing/gateways/sage.rb +412 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +176 -59
- data/lib/active_merchant/billing/gateways/secure_net.rb +35 -29
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -9
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +21 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/securion_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +13 -2
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +36 -11
- data/lib/active_merchant/billing/gateways/stripe.rb +461 -82
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +156 -0
- data/lib/active_merchant/billing/gateways/telr.rb +275 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +142 -28
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -231
- data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +17 -11
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +193 -75
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +150 -63
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -15
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +209 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +45 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +238 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +167 -49
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +131 -36
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +218 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +24 -17
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +177 -0
- data/lib/active_merchant/country.rb +334 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/network_connection_retries.rb +79 -0
- data/lib/active_merchant/post_data.rb +24 -0
- data/lib/active_merchant/posts_data.rb +84 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +24 -21
- data/lib/certs/cacert.pem +3951 -0
- data/lib/support/gateway_support.rb +16 -10
- data/lib/support/outbound_hosts.rb +13 -10
- metadata +161 -306
- data/gem-public_cert.pem +0 -20
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -155
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -73
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -114
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -95
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -19
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -129
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -28
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -165
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -43
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -91
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -139
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
File without changes
|
@@ -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
|
@@ -24,13 +24,202 @@ module ActiveMerchant #:nodoc:
|
|
24
24
|
self.display_name = 'Iridium'
|
25
25
|
|
26
26
|
CURRENCY_CODES = {
|
27
|
+
"AED" => '784',
|
28
|
+
"AFN" => '971',
|
29
|
+
"ALL" => '008',
|
30
|
+
"AMD" => '051',
|
31
|
+
"ANG" => '532',
|
32
|
+
"AOA" => '973',
|
33
|
+
"ARS" => '032',
|
27
34
|
"AUD" => '036',
|
35
|
+
"AWG" => '533',
|
36
|
+
"AZN" => '944',
|
37
|
+
"BAM" => '977',
|
38
|
+
"BBD" => '052',
|
39
|
+
"BDT" => '050',
|
40
|
+
"BGN" => '975',
|
41
|
+
"BHD" => '048',
|
42
|
+
"BIF" => '108',
|
43
|
+
"BMD" => '060',
|
44
|
+
"BND" => '096',
|
45
|
+
"BOB" => '068',
|
46
|
+
"BOV" => '984',
|
47
|
+
"BRL" => '986',
|
48
|
+
"BSD" => '044',
|
49
|
+
"BTN" => '064',
|
50
|
+
"BWP" => '072',
|
51
|
+
"BYR" => '974',
|
52
|
+
"BZD" => '084',
|
28
53
|
"CAD" => '124',
|
54
|
+
"CDF" => '976',
|
55
|
+
"CHE" => '947',
|
56
|
+
"CHF" => '756',
|
57
|
+
"CHW" => '948',
|
58
|
+
"CLF" => '990',
|
59
|
+
"CLP" => '152',
|
60
|
+
"CNY" => '156',
|
61
|
+
"COP" => '170',
|
62
|
+
"COU" => '970',
|
63
|
+
"CRC" => '188',
|
64
|
+
"CUP" => '192',
|
65
|
+
"CVE" => '132',
|
66
|
+
"CYP" => '196',
|
67
|
+
"CZK" => '203',
|
68
|
+
"DJF" => '262',
|
69
|
+
"DKK" => '208',
|
70
|
+
"DOP" => '214',
|
71
|
+
"DZD" => '012',
|
72
|
+
"EEK" => '233',
|
73
|
+
"EGP" => '818',
|
74
|
+
"ERN" => '232',
|
75
|
+
"ETB" => '230',
|
29
76
|
"EUR" => '978',
|
77
|
+
"FJD" => '242',
|
78
|
+
"FKP" => '238',
|
30
79
|
"GBP" => '826',
|
80
|
+
"GEL" => '981',
|
81
|
+
"GHS" => '288',
|
82
|
+
"GIP" => '292',
|
83
|
+
"GMD" => '270',
|
84
|
+
"GNF" => '324',
|
85
|
+
"GTQ" => '320',
|
86
|
+
"GYD" => '328',
|
87
|
+
"HKD" => '344',
|
88
|
+
"HNL" => '340',
|
89
|
+
"HRK" => '191',
|
90
|
+
"HTG" => '332',
|
91
|
+
"HUF" => '348',
|
92
|
+
"IDR" => '360',
|
93
|
+
"ILS" => '376',
|
94
|
+
"INR" => '356',
|
95
|
+
"IQD" => '368',
|
96
|
+
"IRR" => '364',
|
97
|
+
"ISK" => '352',
|
98
|
+
"JMD" => '388',
|
99
|
+
"JOD" => '400',
|
100
|
+
"JPY" => '392',
|
101
|
+
"KES" => '404',
|
102
|
+
"KGS" => '417',
|
103
|
+
"KHR" => '116',
|
104
|
+
"KMF" => '174',
|
105
|
+
"KPW" => '408',
|
106
|
+
"KRW" => '410',
|
107
|
+
"KWD" => '414',
|
108
|
+
"KYD" => '136',
|
109
|
+
"KZT" => '398',
|
110
|
+
"LAK" => '418',
|
111
|
+
"LBP" => '422',
|
112
|
+
"LKR" => '144',
|
113
|
+
"LRD" => '430',
|
114
|
+
"LSL" => '426',
|
115
|
+
"LTL" => '440',
|
116
|
+
"LVL" => '428',
|
117
|
+
"LYD" => '434',
|
118
|
+
"MAD" => '504',
|
119
|
+
"MDL" => '498',
|
120
|
+
"MGA" => '969',
|
121
|
+
"MKD" => '807',
|
122
|
+
"MMK" => '104',
|
123
|
+
"MNT" => '496',
|
124
|
+
"MOP" => '446',
|
125
|
+
"MRO" => '478',
|
126
|
+
"MTL" => '470',
|
127
|
+
"MUR" => '480',
|
128
|
+
"MVR" => '462',
|
129
|
+
"MWK" => '454',
|
31
130
|
"MXN" => '484',
|
131
|
+
"MXV" => '979',
|
132
|
+
"MYR" => '458',
|
133
|
+
"MZN" => '943',
|
134
|
+
"NAD" => '516',
|
135
|
+
"NGN" => '566',
|
136
|
+
"NIO" => '558',
|
137
|
+
"NOK" => '578',
|
138
|
+
"NPR" => '524',
|
32
139
|
"NZD" => '554',
|
140
|
+
"OMR" => '512',
|
141
|
+
"PAB" => '590',
|
142
|
+
"PEN" => '604',
|
143
|
+
"PGK" => '598',
|
144
|
+
"PHP" => '608',
|
145
|
+
"PKR" => '586',
|
146
|
+
"PLN" => '985',
|
147
|
+
"PYG" => '600',
|
148
|
+
"QAR" => '634',
|
149
|
+
"ROL" => '642',
|
150
|
+
"RON" => '946',
|
151
|
+
"RSD" => '941',
|
152
|
+
"RUB" => '643',
|
153
|
+
"RWF" => '646',
|
154
|
+
"SAR" => '682',
|
155
|
+
"SBD" => '090',
|
156
|
+
"SCR" => '690',
|
157
|
+
"SDG" => '938',
|
158
|
+
"SEK" => '752',
|
159
|
+
"SGD" => '702',
|
160
|
+
"SHP" => '654',
|
161
|
+
"SKK" => '703',
|
162
|
+
"SLL" => '694',
|
163
|
+
"SOS" => '706',
|
164
|
+
"SRD" => '968',
|
165
|
+
"STD" => '678',
|
166
|
+
"SYP" => '760',
|
167
|
+
"SZL" => '748',
|
168
|
+
"THB" => '764',
|
169
|
+
"TJS" => '972',
|
170
|
+
"TMM" => '795',
|
171
|
+
"TND" => '788',
|
172
|
+
"TOP" => '776',
|
173
|
+
"TRY" => '949',
|
174
|
+
"TTD" => '780',
|
175
|
+
"TWD" => '901',
|
176
|
+
"TZS" => '834',
|
177
|
+
"UAH" => '980',
|
178
|
+
"UGX" => '800',
|
33
179
|
"USD" => '840',
|
180
|
+
"USN" => '997',
|
181
|
+
"USS" => '998',
|
182
|
+
"UYU" => '858',
|
183
|
+
"UZS" => '860',
|
184
|
+
"VEB" => '862',
|
185
|
+
"VND" => '704',
|
186
|
+
"VUV" => '548',
|
187
|
+
"WST" => '882',
|
188
|
+
"XAF" => '950',
|
189
|
+
"XAG" => '961',
|
190
|
+
"XAU" => '959',
|
191
|
+
"XBA" => '955',
|
192
|
+
"XBB" => '956',
|
193
|
+
"XBC" => '957',
|
194
|
+
"XBD" => '958',
|
195
|
+
"XCD" => '951',
|
196
|
+
"XDR" => '960',
|
197
|
+
"XOF" => '952',
|
198
|
+
"XPD" => '964',
|
199
|
+
"XPF" => '953',
|
200
|
+
"XPT" => '962',
|
201
|
+
"XTS" => '963',
|
202
|
+
"XXX" => '999',
|
203
|
+
"YER" => '886',
|
204
|
+
"ZAR" => '710',
|
205
|
+
"ZMK" => '894',
|
206
|
+
"ZWD" => '716',
|
207
|
+
}
|
208
|
+
|
209
|
+
AVS_CODE = {
|
210
|
+
"PASSED" => "Y",
|
211
|
+
"FAILED" => "N",
|
212
|
+
"PARTIAL" => "X",
|
213
|
+
"NOT_CHECKED" => "X",
|
214
|
+
"UNKNOWN" => "X"
|
215
|
+
}
|
216
|
+
|
217
|
+
CVV_CODE = {
|
218
|
+
"PASSED" => "M",
|
219
|
+
"FAILED" => "N",
|
220
|
+
"PARTIAL" => "I",
|
221
|
+
"NOT_CHECKED" => "P",
|
222
|
+
"UNKNOWN" => "U"
|
34
223
|
}
|
35
224
|
|
36
225
|
def initialize(options = {})
|
@@ -63,7 +252,7 @@ module ActiveMerchant #:nodoc:
|
|
63
252
|
end
|
64
253
|
|
65
254
|
def credit(money, authorization, options={})
|
66
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
255
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
67
256
|
refund(money, authorization, options)
|
68
257
|
end
|
69
258
|
|
@@ -75,6 +264,17 @@ module ActiveMerchant #:nodoc:
|
|
75
264
|
commit(build_reference_request('VOID', nil, authorization, options), options)
|
76
265
|
end
|
77
266
|
|
267
|
+
def supports_scrubbing
|
268
|
+
true
|
269
|
+
end
|
270
|
+
|
271
|
+
def scrub(transcript)
|
272
|
+
transcript.
|
273
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
274
|
+
gsub(%r((<CardNumber>)\d+(</CardNumber>)), '\1[FILTERED]\2').
|
275
|
+
gsub(%r((<CV2>)\d+(</CV2>)), '\1[FILTERED]\2')
|
276
|
+
end
|
277
|
+
|
78
278
|
private
|
79
279
|
|
80
280
|
def build_purchase_request(type, money, creditcard, options)
|
@@ -88,7 +288,7 @@ module ActiveMerchant #:nodoc:
|
|
88
288
|
|
89
289
|
def build_reference_request(type, money, authorization, options)
|
90
290
|
options.merge!(:action => 'CrossReferenceTransaction')
|
91
|
-
order_id, cross_reference,
|
291
|
+
order_id, cross_reference, _ = authorization.split(";")
|
92
292
|
build_request(options) do |xml|
|
93
293
|
if money
|
94
294
|
details = {'CurrencyCode' => currency_code(options[:currency] || default_currency), 'Amount' => amount(money)}
|
@@ -177,7 +377,7 @@ module ActiveMerchant #:nodoc:
|
|
177
377
|
def commit(request, options)
|
178
378
|
requires!(options, :action)
|
179
379
|
response = parse(ssl_post(test? ? self.test_url : self.live_url, request,
|
180
|
-
{"SOAPAction" => "https://www.thepaymentgateway.net
|
380
|
+
{"SOAPAction" => "https://www.thepaymentgateway.net/" + options[:action],
|
181
381
|
"Content-Type" => "text/xml; charset=utf-8" }))
|
182
382
|
|
183
383
|
success = response[:transaction_result][:status_code] == "0"
|
@@ -186,7 +386,13 @@ module ActiveMerchant #:nodoc:
|
|
186
386
|
|
187
387
|
Response.new(success, message, response,
|
188
388
|
:test => test?,
|
189
|
-
:authorization => authorization
|
389
|
+
:authorization => authorization,
|
390
|
+
:avs_result => {
|
391
|
+
:street_match => AVS_CODE[ response[:transaction_output_data][:address_numeric_check_result] ],
|
392
|
+
:postal_match => AVS_CODE[ response[:transaction_output_data][:post_code_check_result] ],
|
393
|
+
},
|
394
|
+
:cvv_result => CVV_CODE[ response[:transaction_output_data][:cv2_check_result] ]
|
395
|
+
)
|
190
396
|
end
|
191
397
|
|
192
398
|
def parse(xml)
|
@@ -0,0 +1,251 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class IveriGateway < Gateway
|
6
|
+
self.live_url = self.test_url = 'https://portal.nedsecure.co.za/iVeriWebService/Service.asmx'
|
7
|
+
|
8
|
+
self.supported_countries = ['US', 'ZA', 'GB']
|
9
|
+
self.default_currency = 'ZAR'
|
10
|
+
self.money_format = :cents
|
11
|
+
self.supported_cardtypes = [:visa, :master, :american_express]
|
12
|
+
|
13
|
+
self.homepage_url = 'http://www.iveri.com'
|
14
|
+
self.display_name = 'iVeri'
|
15
|
+
|
16
|
+
def initialize(options={})
|
17
|
+
requires!(options, :app_id, :cert_id)
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def purchase(money, payment_method, options={})
|
22
|
+
post = build_vxml_request('Debit', options) do |xml|
|
23
|
+
add_auth_purchase_params(xml, money, payment_method, options)
|
24
|
+
end
|
25
|
+
|
26
|
+
commit(post)
|
27
|
+
end
|
28
|
+
|
29
|
+
def authorize(money, payment_method, options={})
|
30
|
+
post = build_vxml_request('Authorisation', options) do |xml|
|
31
|
+
add_auth_purchase_params(xml, money, payment_method, options)
|
32
|
+
end
|
33
|
+
|
34
|
+
commit(post)
|
35
|
+
end
|
36
|
+
|
37
|
+
def capture(money, authorization, options={})
|
38
|
+
post = build_vxml_request('Debit', options) do |xml|
|
39
|
+
add_authorization(xml, authorization, options)
|
40
|
+
end
|
41
|
+
|
42
|
+
commit(post)
|
43
|
+
end
|
44
|
+
|
45
|
+
def refund(money, authorization, options={})
|
46
|
+
post = build_vxml_request('Credit', options) do |xml|
|
47
|
+
add_amount(xml, money, options)
|
48
|
+
add_authorization(xml, authorization, options)
|
49
|
+
end
|
50
|
+
|
51
|
+
commit(post)
|
52
|
+
end
|
53
|
+
|
54
|
+
def void(authorization, options={})
|
55
|
+
post = build_vxml_request('Void', options) do |xml|
|
56
|
+
add_authorization(xml, authorization, options)
|
57
|
+
end
|
58
|
+
|
59
|
+
commit(post)
|
60
|
+
end
|
61
|
+
|
62
|
+
def verify(credit_card, options={})
|
63
|
+
authorize(0, credit_card, options)
|
64
|
+
end
|
65
|
+
|
66
|
+
def verify_credentials
|
67
|
+
void = void('', options)
|
68
|
+
return true if void.message == 'Missing OriginalMerchantTrace'
|
69
|
+
false
|
70
|
+
end
|
71
|
+
|
72
|
+
def supports_scrubbing?
|
73
|
+
true
|
74
|
+
end
|
75
|
+
|
76
|
+
def scrub(transcript)
|
77
|
+
transcript.
|
78
|
+
gsub(%r((CertificateID=\\\")[^\\]*), '\1[FILTERED]').
|
79
|
+
gsub(%r((<PAN>)[^&]*), '\1[FILTERED]').
|
80
|
+
gsub(%r((<CardSecurityCode>)[^&]*), '\1[FILTERED]')
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
def build_xml_envelope(vxml)
|
86
|
+
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
87
|
+
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
|
88
|
+
xml[:soap].Body do
|
89
|
+
xml.Execute 'xmlns' => 'http://iveri.com/' do
|
90
|
+
xml.validateRequest 'true'
|
91
|
+
xml.protocol 'V_XML'
|
92
|
+
xml.protocolVersion '2.0'
|
93
|
+
xml.request vxml
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
builder.to_xml
|
100
|
+
end
|
101
|
+
|
102
|
+
def build_vxml_request(action, options)
|
103
|
+
builder = Nokogiri::XML::Builder.new do |xml|
|
104
|
+
xml.V_XML('Version' => '2.0', 'CertificateID' => @options[:cert_id], 'Direction' => 'Request') do
|
105
|
+
xml.Transaction('ApplicationID' => @options[:app_id], 'Command' => action, 'Mode' => mode) do
|
106
|
+
yield(xml)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
builder.doc.root.to_xml
|
112
|
+
end
|
113
|
+
|
114
|
+
def add_auth_purchase_params(post, money, payment_method, options)
|
115
|
+
add_card_holder_authentication(post, options)
|
116
|
+
add_amount(post, money, options)
|
117
|
+
add_electronic_commerce_indicator(post, options)
|
118
|
+
add_payment_method(post, payment_method, options)
|
119
|
+
end
|
120
|
+
|
121
|
+
def add_amount(post, money, options)
|
122
|
+
post.Amount(amount(money))
|
123
|
+
post.Currency(options[:currency] || default_currency)
|
124
|
+
end
|
125
|
+
|
126
|
+
def add_electronic_commerce_indicator(post, options)
|
127
|
+
post.ElectronicCommerceIndicator(options[:eci]) if options[:eci]
|
128
|
+
end
|
129
|
+
|
130
|
+
def add_authorization(post, authorization, options)
|
131
|
+
post.MerchantReference(split_auth(authorization)[2])
|
132
|
+
post.TransactionIndex(split_auth(authorization)[1])
|
133
|
+
post.OriginalRequestID(split_auth(authorization)[0])
|
134
|
+
end
|
135
|
+
|
136
|
+
def add_payment_method(post, payment_method, options)
|
137
|
+
post.ExpiryDate("#{format(payment_method.month, :two_digits)}#{payment_method.year}")
|
138
|
+
add_new_reference(post, options)
|
139
|
+
post.CardSecurityCode(payment_method.verification_value)
|
140
|
+
post.PAN(payment_method.number)
|
141
|
+
end
|
142
|
+
|
143
|
+
def add_new_reference(post, options)
|
144
|
+
post.MerchantReference(options[:order_id] || generate_unique_id)
|
145
|
+
end
|
146
|
+
|
147
|
+
def add_card_holder_authentication(post, options)
|
148
|
+
post.CardHolderAuthenticationID(options[:xid]) if options[:xid]
|
149
|
+
post.CardHolderAuthenticationData(options[:cavv]) if options[:cavv]
|
150
|
+
end
|
151
|
+
|
152
|
+
def commit(post)
|
153
|
+
raw_response = begin
|
154
|
+
ssl_post(live_url, build_xml_envelope(post), headers(post))
|
155
|
+
rescue ActiveMerchant::ResponseError => e
|
156
|
+
e.response.body
|
157
|
+
end
|
158
|
+
|
159
|
+
parsed = parse(raw_response)
|
160
|
+
succeeded = success_from(parsed)
|
161
|
+
|
162
|
+
Response.new(
|
163
|
+
succeeded,
|
164
|
+
message_from(parsed, succeeded),
|
165
|
+
parsed,
|
166
|
+
authorization: authorization_from(parsed),
|
167
|
+
error_code: error_code_from(parsed, succeeded),
|
168
|
+
test: test?
|
169
|
+
)
|
170
|
+
end
|
171
|
+
|
172
|
+
def mode
|
173
|
+
test? ? 'Test' : 'Live'
|
174
|
+
end
|
175
|
+
|
176
|
+
def headers(post)
|
177
|
+
{
|
178
|
+
"Content-Type" => "text/xml; charset=utf-8",
|
179
|
+
"Content-Length" => post.size.to_s,
|
180
|
+
"SOAPAction" => "http://iveri.com/Execute"
|
181
|
+
}
|
182
|
+
end
|
183
|
+
|
184
|
+
def parse(body)
|
185
|
+
parsed = {}
|
186
|
+
|
187
|
+
vxml = Nokogiri::XML(body).remove_namespaces!.xpath("//Envelope/Body/ExecuteResponse/ExecuteResult").inner_text
|
188
|
+
doc = Nokogiri::XML(vxml)
|
189
|
+
doc.xpath("*").each do |node|
|
190
|
+
if (node.elements.empty?)
|
191
|
+
parsed[underscore(node.name)] = node.text
|
192
|
+
else
|
193
|
+
node.elements.each do |childnode|
|
194
|
+
parse_element(parsed, childnode)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
parsed
|
199
|
+
end
|
200
|
+
|
201
|
+
def parse_element(parsed, node)
|
202
|
+
if !node.attributes.empty?
|
203
|
+
node.attributes.each do |a|
|
204
|
+
parsed[underscore(node.name)+ "_" + underscore(a[1].name)] = a[1].value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
if !node.elements.empty?
|
209
|
+
node.elements.each {|e| parse_element(parsed, e) }
|
210
|
+
else
|
211
|
+
parsed[underscore(node.name)] = node.text
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
def success_from(response)
|
216
|
+
response['result_status'] == '0'
|
217
|
+
end
|
218
|
+
|
219
|
+
def message_from(response, succeeded)
|
220
|
+
if succeeded
|
221
|
+
"Succeeded"
|
222
|
+
else
|
223
|
+
response['result_description'] || response['result_acquirer_description']
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
def authorization_from(response)
|
228
|
+
"#{response['transaction_request_id']}|#{response['transaction_index']}|#{response['merchant_reference']}"
|
229
|
+
end
|
230
|
+
|
231
|
+
def split_auth(authorization)
|
232
|
+
request_id, transaction_index, merchant_reference = authorization.to_s.split('|')
|
233
|
+
[request_id, transaction_index, merchant_reference]
|
234
|
+
end
|
235
|
+
|
236
|
+
def error_code_from(response, succeeded)
|
237
|
+
unless succeeded
|
238
|
+
response['result_code']
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
def underscore(camel_cased_word)
|
243
|
+
camel_cased_word.to_s.gsub(/::/, '/').
|
244
|
+
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
245
|
+
gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
246
|
+
tr("-", "_").
|
247
|
+
downcase
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|