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,26 +1,19 @@
|
|
|
1
|
+
require 'active_support/core_ext/string/access'
|
|
2
|
+
|
|
1
3
|
module ActiveMerchant
|
|
2
4
|
module Billing
|
|
3
5
|
class DataCashGateway < Gateway
|
|
4
6
|
self.default_currency = 'GBP'
|
|
5
7
|
self.supported_countries = ['GB']
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
# usable:
|
|
9
|
-
# American Express, ATM, Carte Blanche, Diners Club, Discover,
|
|
10
|
-
# EnRoute, GE Capital, JCB, Laser, Maestro, Mastercard, Solo,
|
|
11
|
-
# Switch, Visa, Visa Delta, VISA Electron, Visa Purchasing
|
|
12
|
-
#
|
|
13
|
-
# Note continuous authority is only supported for :visa, :master and :american_express card types
|
|
14
|
-
self.supported_cardtypes = [ :visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro, :switch, :solo, :laser ]
|
|
9
|
+
self.supported_cardtypes = [ :visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro ]
|
|
15
10
|
|
|
16
11
|
self.homepage_url = 'http://www.datacash.com/'
|
|
17
12
|
self.display_name = 'DataCash'
|
|
18
13
|
|
|
19
|
-
# Datacash server URLs
|
|
20
14
|
self.test_url = 'https://testserver.datacash.com/Transaction'
|
|
21
15
|
self.live_url = 'https://mars.transaction.datacash.com/Transaction'
|
|
22
16
|
|
|
23
|
-
# Different Card Transaction Types
|
|
24
17
|
AUTH_TYPE = 'auth'
|
|
25
18
|
CANCEL_TYPE = 'cancel'
|
|
26
19
|
FULFILL_TYPE = 'fulfill'
|
|
@@ -28,44 +21,14 @@ module ActiveMerchant
|
|
|
28
21
|
REFUND_TYPE = 'refund'
|
|
29
22
|
TRANSACTION_REFUND_TYPE = 'txn_refund'
|
|
30
23
|
|
|
31
|
-
# Constant strings for use in the ExtendedPolicy complex element for
|
|
32
|
-
# CV2 checks
|
|
33
24
|
POLICY_ACCEPT = 'accept'
|
|
34
25
|
POLICY_REJECT = 'reject'
|
|
35
26
|
|
|
36
|
-
# Datacash success code
|
|
37
|
-
DATACASH_SUCCESS = '1'
|
|
38
|
-
|
|
39
|
-
# Creates a new DataCashGateway
|
|
40
|
-
#
|
|
41
|
-
# The gateway requires that a valid login and password be passed
|
|
42
|
-
# in the +options+ hash.
|
|
43
|
-
#
|
|
44
|
-
# ==== Options
|
|
45
|
-
#
|
|
46
|
-
# * <tt>:login</tt> -- The Datacash account login.
|
|
47
|
-
# * <tt>:password</tt> -- The Datacash account password.
|
|
48
|
-
# * <tt>:test => +true+ or +false+</tt> -- Use the test or live Datacash url.
|
|
49
|
-
#
|
|
50
27
|
def initialize(options = {})
|
|
51
28
|
requires!(options, :login, :password)
|
|
52
29
|
super
|
|
53
30
|
end
|
|
54
31
|
|
|
55
|
-
# Perform a purchase, which is essentially an authorization and capture in a single operation.
|
|
56
|
-
#
|
|
57
|
-
# ==== Parameters
|
|
58
|
-
# * <tt>money</tt> The amount to be authorized as an Integer value in cents.
|
|
59
|
-
# * <tt>authorization_or_credit_card</tt>:: The continuous authority reference or CreditCard details for the transaction.
|
|
60
|
-
# * <tt>options</tt> A hash of optional parameters.
|
|
61
|
-
# * <tt>:order_id</tt> A unique reference for this order (corresponds to merchantreference in datacash documentation)
|
|
62
|
-
# * <tt>:set_up_continuous_authority</tt>
|
|
63
|
-
# Set to true to set up a recurring historic transaction account be set up.
|
|
64
|
-
# Only supported for :visa, :master and :american_express card types
|
|
65
|
-
# See http://www.datacash.com/services/recurring/historic.php for more details of historic transactions.
|
|
66
|
-
# * <tt>:address</tt>:: billing address for card
|
|
67
|
-
#
|
|
68
|
-
# The continuous authority reference will be available in response#params['ca_reference'] if you have requested one
|
|
69
32
|
def purchase(money, authorization_or_credit_card, options = {})
|
|
70
33
|
requires!(options, :order_id)
|
|
71
34
|
|
|
@@ -78,22 +41,6 @@ module ActiveMerchant
|
|
|
78
41
|
commit(request)
|
|
79
42
|
end
|
|
80
43
|
|
|
81
|
-
# Performs an authorization, which reserves the funds on the customer's credit card, but does not
|
|
82
|
-
# charge the card.
|
|
83
|
-
#
|
|
84
|
-
# ==== Parameters
|
|
85
|
-
#
|
|
86
|
-
# * <tt>money</tt> The amount to be authorized as an Integer value in cents.
|
|
87
|
-
# * <tt>authorization_or_credit_card</tt>:: The continuous authority reference or CreditCard details for the transaction.
|
|
88
|
-
# * <tt>options</tt> A hash of optional parameters.
|
|
89
|
-
# * <tt>:order_id</tt> A unique reference for this order (corresponds to merchantreference in datacash documentation)
|
|
90
|
-
# * <tt>:set_up_continuous_authority</tt>::
|
|
91
|
-
# Set to true to set up a recurring historic transaction account be set up.
|
|
92
|
-
# Only supported for :visa, :master and :american_express card types
|
|
93
|
-
# See http://www.datacash.com/services/recurring/historic.php for more details of historic transactions.
|
|
94
|
-
# * <tt>:address</tt>:: billing address for card
|
|
95
|
-
#
|
|
96
|
-
# The continuous authority reference will be available in response#params['ca_reference'] if you have requested one
|
|
97
44
|
def authorize(money, authorization_or_credit_card, options = {})
|
|
98
45
|
requires!(options, :order_id)
|
|
99
46
|
|
|
@@ -106,42 +53,22 @@ module ActiveMerchant
|
|
|
106
53
|
commit(request)
|
|
107
54
|
end
|
|
108
55
|
|
|
109
|
-
# Captures the funds from an authorized transaction.
|
|
110
|
-
#
|
|
111
|
-
# ==== Parameters
|
|
112
|
-
#
|
|
113
|
-
# * <tt>money</tt> -- The amount to be captured as anInteger value in cents.
|
|
114
|
-
# * <tt>authorization</tt> -- The authorization returned from the previous authorize request.
|
|
115
56
|
def capture(money, authorization, options = {})
|
|
116
57
|
commit(build_void_or_capture_request(FULFILL_TYPE, money, authorization, options))
|
|
117
58
|
end
|
|
118
59
|
|
|
119
|
-
# Void a previous transaction
|
|
120
|
-
#
|
|
121
|
-
# ==== Parameters
|
|
122
|
-
#
|
|
123
|
-
# * <tt>authorization</tt> - The authorization returned from the previous authorize request.
|
|
124
60
|
def void(authorization, options = {})
|
|
125
61
|
request = build_void_or_capture_request(CANCEL_TYPE, nil, authorization, options)
|
|
126
62
|
|
|
127
63
|
commit(request)
|
|
128
64
|
end
|
|
129
65
|
|
|
130
|
-
# Refund to a card
|
|
131
|
-
#
|
|
132
|
-
# ==== Parameters
|
|
133
|
-
#
|
|
134
|
-
# * <tt>money</tt> The amount to be refunded as an Integer value in cents. Set to nil for a full refund on existing transaction.
|
|
135
|
-
# * <tt>reference_or_credit_card</tt> The credit card you want to refund OR the datacash_reference for the existing transaction you are refunding
|
|
136
|
-
# * <tt>options</tt> Are ignored when refunding via reference to an existing transaction, otherwise
|
|
137
|
-
# * <tt>:order_id</tt> A unique reference for this order (corresponds to merchantreference in datacash documentation)
|
|
138
|
-
# * <tt>:address</tt>:: billing address for card
|
|
139
66
|
def credit(money, reference_or_credit_card, options = {})
|
|
140
67
|
if reference_or_credit_card.is_a?(String)
|
|
141
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
68
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
142
69
|
refund(money, reference_or_credit_card)
|
|
143
70
|
else
|
|
144
|
-
request =
|
|
71
|
+
request = build_credit_request(money, reference_or_credit_card, options)
|
|
145
72
|
commit(request)
|
|
146
73
|
end
|
|
147
74
|
end
|
|
@@ -150,49 +77,30 @@ module ActiveMerchant
|
|
|
150
77
|
commit(build_transaction_refund_request(money, reference))
|
|
151
78
|
end
|
|
152
79
|
|
|
80
|
+
def supports_scrubbing?
|
|
81
|
+
true
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def scrub(transcript)
|
|
85
|
+
transcript.
|
|
86
|
+
gsub(/(<pan>)\d+(<\/pan>)/i, '\1[FILTERED]\2').
|
|
87
|
+
gsub(/(<cv2>)\d+(<\/cv2>)/i, '\1[FILTERED]\2').
|
|
88
|
+
gsub(/(<password>).+(<\/password>)/i, '\1[FILTERED]\2')
|
|
89
|
+
end
|
|
90
|
+
|
|
153
91
|
private
|
|
154
|
-
# Create the xml document for a 'cancel' or 'fulfill' transaction.
|
|
155
|
-
#
|
|
156
|
-
# Final XML should look like:
|
|
157
|
-
# <Request>
|
|
158
|
-
# <Authentication>
|
|
159
|
-
# <client>99000001</client>
|
|
160
|
-
# <password>******</password>
|
|
161
|
-
# </Authentication>
|
|
162
|
-
# <Transaction>
|
|
163
|
-
# <TxnDetails>
|
|
164
|
-
# <amount>25.00</amount>
|
|
165
|
-
# </TxnDetails>
|
|
166
|
-
# <HistoricTxn>
|
|
167
|
-
# <reference>4900200000000001</reference>
|
|
168
|
-
# <authcode>A6</authcode>
|
|
169
|
-
# <method>fulfill</method>
|
|
170
|
-
# </HistoricTxn>
|
|
171
|
-
# </Transaction>
|
|
172
|
-
# </Request>
|
|
173
|
-
#
|
|
174
|
-
# Parameters:
|
|
175
|
-
# * <tt>type</tt> must be FULFILL_TYPE or CANCEL_TYPE
|
|
176
|
-
# * <tt>money</tt> - optional - Integer value in cents
|
|
177
|
-
# * <tt>authorization</tt> - the Datacash authorization from a previous succesful authorize transaction
|
|
178
|
-
# * <tt>options</tt>
|
|
179
|
-
# * <tt>order_id</tt> - A unique reference for the transaction
|
|
180
|
-
#
|
|
181
|
-
# Returns:
|
|
182
|
-
# -Builder xml document
|
|
183
|
-
#
|
|
184
|
-
def build_void_or_capture_request(type, money, authorization, options)
|
|
185
|
-
reference, auth_code, ca_reference = authorization.to_s.split(';')
|
|
186
92
|
|
|
93
|
+
def build_void_or_capture_request(type, money, authorization, options)
|
|
94
|
+
parsed_authorization = parse_authorization_string(authorization)
|
|
187
95
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
188
96
|
xml.instruct!
|
|
189
|
-
xml.tag! :Request do
|
|
97
|
+
xml.tag! :Request, :version => '2' do
|
|
190
98
|
add_authentication(xml)
|
|
191
99
|
|
|
192
100
|
xml.tag! :Transaction do
|
|
193
101
|
xml.tag! :HistoricTxn do
|
|
194
|
-
xml.tag! :reference, reference
|
|
195
|
-
xml.tag! :authcode, auth_code
|
|
102
|
+
xml.tag! :reference, parsed_authorization[:reference]
|
|
103
|
+
xml.tag! :authcode, parsed_authorization[:auth_code]
|
|
196
104
|
xml.tag! :method, type
|
|
197
105
|
end
|
|
198
106
|
|
|
@@ -208,71 +116,10 @@ module ActiveMerchant
|
|
|
208
116
|
xml.target!
|
|
209
117
|
end
|
|
210
118
|
|
|
211
|
-
# Create the xml document for an 'auth' or 'pre' transaction with a credit card
|
|
212
|
-
#
|
|
213
|
-
# Final XML should look like:
|
|
214
|
-
#
|
|
215
|
-
# <Request>
|
|
216
|
-
# <Authentication>
|
|
217
|
-
# <client>99000000</client>
|
|
218
|
-
# <password>*******</password>
|
|
219
|
-
# </Authentication>
|
|
220
|
-
# <Transaction>
|
|
221
|
-
# <TxnDetails>
|
|
222
|
-
# <merchantreference>123456</merchantreference>
|
|
223
|
-
# <amount currency="EUR">10.00</amount>
|
|
224
|
-
# </TxnDetails>
|
|
225
|
-
# <CardTxn>
|
|
226
|
-
# <Card>
|
|
227
|
-
# <pan>4444********1111</pan>
|
|
228
|
-
# <expirydate>03/04</expirydate>
|
|
229
|
-
# <Cv2Avs>
|
|
230
|
-
# <street_address1>Flat 7</street_address1>
|
|
231
|
-
# <street_address2>89 Jumble
|
|
232
|
-
# Street</street_address2>
|
|
233
|
-
# <street_address3>Mytown</street_address3>
|
|
234
|
-
# <postcode>AV12FR</postcode>
|
|
235
|
-
# <cv2>123</cv2>
|
|
236
|
-
# <ExtendedPolicy>
|
|
237
|
-
# <cv2_policy notprovided="reject"
|
|
238
|
-
# notchecked="accept"
|
|
239
|
-
# matched="accept"
|
|
240
|
-
# notmatched="reject"
|
|
241
|
-
# partialmatch="reject"/>
|
|
242
|
-
# <postcode_policy notprovided="reject"
|
|
243
|
-
# notchecked="accept"
|
|
244
|
-
# matched="accept"
|
|
245
|
-
# notmatched="reject"
|
|
246
|
-
# partialmatch="accept"/>
|
|
247
|
-
# <address_policy notprovided="reject"
|
|
248
|
-
# notchecked="accept"
|
|
249
|
-
# matched="accept"
|
|
250
|
-
# notmatched="reject"
|
|
251
|
-
# partialmatch="accept"/>
|
|
252
|
-
# </ExtendedPolicy>
|
|
253
|
-
# </Cv2Avs>
|
|
254
|
-
# </Card>
|
|
255
|
-
# <method>auth</method>
|
|
256
|
-
# </CardTxn>
|
|
257
|
-
# </Transaction>
|
|
258
|
-
# </Request>
|
|
259
|
-
#
|
|
260
|
-
# Parameters:
|
|
261
|
-
# -type must be 'auth' or 'pre'
|
|
262
|
-
# -money - A money object with the price and currency
|
|
263
|
-
# -credit_card - The credit_card details to use
|
|
264
|
-
# -options:
|
|
265
|
-
# :order_id is the merchant reference number
|
|
266
|
-
# :billing_address is the billing address for the cc
|
|
267
|
-
# :address is the delivery address
|
|
268
|
-
#
|
|
269
|
-
# Returns:
|
|
270
|
-
# -xml: Builder document containing the markup
|
|
271
|
-
#
|
|
272
119
|
def build_purchase_or_authorization_request_with_credit_card_request(type, money, credit_card, options)
|
|
273
120
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
274
121
|
xml.instruct!
|
|
275
|
-
xml.tag! :Request do
|
|
122
|
+
xml.tag! :Request, :version => '2' do
|
|
276
123
|
add_authentication(xml)
|
|
277
124
|
|
|
278
125
|
xml.tag! :Transaction do
|
|
@@ -293,52 +140,18 @@ module ActiveMerchant
|
|
|
293
140
|
xml.target!
|
|
294
141
|
end
|
|
295
142
|
|
|
296
|
-
# Create the xml document for an 'auth' or 'pre' transaction with
|
|
297
|
-
# continuous authorization
|
|
298
|
-
#
|
|
299
|
-
# Final XML should look like:
|
|
300
|
-
#
|
|
301
|
-
# <Request>
|
|
302
|
-
# <Transaction>
|
|
303
|
-
# <ContAuthTxn type="historic" />
|
|
304
|
-
# <TxnDetails>
|
|
305
|
-
# <merchantreference>3851231</merchantreference>
|
|
306
|
-
# <capturemethod>cont_auth</capturemethod>
|
|
307
|
-
# <amount currency="GBP">18.50</amount>
|
|
308
|
-
# </TxnDetails>
|
|
309
|
-
# <HistoricTxn>
|
|
310
|
-
# <reference>4500200040925092</reference>
|
|
311
|
-
# <method>auth</method>
|
|
312
|
-
# </HistoricTxn>
|
|
313
|
-
# </Transaction>
|
|
314
|
-
# <Authentication>
|
|
315
|
-
# <client>99000001</client>
|
|
316
|
-
# <password>mypasswd</password>
|
|
317
|
-
# </Authentication>
|
|
318
|
-
# </Request>
|
|
319
|
-
#
|
|
320
|
-
# Parameters:
|
|
321
|
-
# -type must be 'auth' or 'pre'
|
|
322
|
-
# -money - A money object with the price and currency
|
|
323
|
-
# -authorization - The authorization containing a continuous authority reference previously set up on a credit card
|
|
324
|
-
# -options:
|
|
325
|
-
# :order_id is the merchant reference number
|
|
326
|
-
#
|
|
327
|
-
# Returns:
|
|
328
|
-
# -xml: Builder document containing the markup
|
|
329
|
-
#
|
|
330
143
|
def build_purchase_or_authorization_request_with_continuous_authority_reference_request(type, money, authorization, options)
|
|
331
|
-
|
|
332
|
-
raise ArgumentError,
|
|
144
|
+
parsed_authorization = parse_authorization_string(authorization)
|
|
145
|
+
raise ArgumentError, 'The continuous authority reference is required for continuous authority transactions' if parsed_authorization[:ca_reference].blank?
|
|
333
146
|
|
|
334
147
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
335
148
|
xml.instruct!
|
|
336
|
-
xml.tag! :Request do
|
|
149
|
+
xml.tag! :Request, :version => '2' do
|
|
337
150
|
add_authentication(xml)
|
|
338
151
|
xml.tag! :Transaction do
|
|
339
152
|
xml.tag! :ContAuthTxn, :type => 'historic'
|
|
340
153
|
xml.tag! :HistoricTxn do
|
|
341
|
-
xml.tag! :reference, ca_reference
|
|
154
|
+
xml.tag! :reference, parsed_authorization[:ca_reference]
|
|
342
155
|
xml.tag! :method, type
|
|
343
156
|
end
|
|
344
157
|
xml.tag! :TxnDetails do
|
|
@@ -351,39 +164,21 @@ module ActiveMerchant
|
|
|
351
164
|
xml.target!
|
|
352
165
|
end
|
|
353
166
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
# Final XML should look like:
|
|
357
|
-
#
|
|
358
|
-
# <Request>
|
|
359
|
-
# <Authentication>
|
|
360
|
-
# <client>99000001</client>
|
|
361
|
-
# <password>*******</password>
|
|
362
|
-
# </Authentication>
|
|
363
|
-
# <Transaction>
|
|
364
|
-
# <HistoricTxn>
|
|
365
|
-
# <method>txn_refund</method>
|
|
366
|
-
# <reference>12345678</reference>
|
|
367
|
-
# </HistoricTxn>
|
|
368
|
-
# <TxnDetails>
|
|
369
|
-
# <amount>10.00</amount>
|
|
370
|
-
# </TxnDetails>
|
|
371
|
-
# </Transaction>
|
|
372
|
-
# </Request>
|
|
373
|
-
#
|
|
374
|
-
def build_transaction_refund_request(money, reference)
|
|
167
|
+
def build_transaction_refund_request(money, authorization)
|
|
168
|
+
parsed_authorization = parse_authorization_string(authorization)
|
|
375
169
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
376
170
|
xml.instruct!
|
|
377
|
-
xml.tag! :Request do
|
|
171
|
+
xml.tag! :Request, :version => '2' do
|
|
378
172
|
add_authentication(xml)
|
|
379
173
|
xml.tag! :Transaction do
|
|
380
174
|
xml.tag! :HistoricTxn do
|
|
381
|
-
xml.tag! :reference, reference
|
|
175
|
+
xml.tag! :reference, parsed_authorization[:reference]
|
|
382
176
|
xml.tag! :method, TRANSACTION_REFUND_TYPE
|
|
383
177
|
end
|
|
384
178
|
unless money.nil?
|
|
385
179
|
xml.tag! :TxnDetails do
|
|
386
180
|
xml.tag! :amount, amount(money)
|
|
181
|
+
xml.tag! :capturemethod, 'ecomm'
|
|
387
182
|
end
|
|
388
183
|
end
|
|
389
184
|
end
|
|
@@ -391,34 +186,10 @@ module ActiveMerchant
|
|
|
391
186
|
xml.target!
|
|
392
187
|
end
|
|
393
188
|
|
|
394
|
-
|
|
395
|
-
#
|
|
396
|
-
# Final XML should look like:
|
|
397
|
-
#
|
|
398
|
-
# <Request>
|
|
399
|
-
# <Authentication>
|
|
400
|
-
# <client>99000001</client>
|
|
401
|
-
# <password>*****</password>
|
|
402
|
-
# </Authentication>
|
|
403
|
-
# <Transaction>
|
|
404
|
-
# <CardTxn>
|
|
405
|
-
# <Card>
|
|
406
|
-
# <pan>633300*********1</pan>
|
|
407
|
-
# <expirydate>04/06</expirydate>
|
|
408
|
-
# <startdate>01/04</startdate>
|
|
409
|
-
# </Card>
|
|
410
|
-
# <method>refund</method>
|
|
411
|
-
# </CardTxn>
|
|
412
|
-
# <TxnDetails>
|
|
413
|
-
# <merchantreference>1000001</merchantreference>
|
|
414
|
-
# <amount currency="GBP">95.99</amount>
|
|
415
|
-
# </TxnDetails>
|
|
416
|
-
# </Transaction>
|
|
417
|
-
# </Request>
|
|
418
|
-
def build_refund_request(money, credit_card, options)
|
|
189
|
+
def build_credit_request(money, credit_card, options)
|
|
419
190
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
420
191
|
xml.instruct!
|
|
421
|
-
xml.tag! :Request do
|
|
192
|
+
xml.tag! :Request, :version => '2' do
|
|
422
193
|
add_authentication(xml)
|
|
423
194
|
xml.tag! :Transaction do
|
|
424
195
|
xml.tag! :CardTxn do
|
|
@@ -428,21 +199,13 @@ module ActiveMerchant
|
|
|
428
199
|
xml.tag! :TxnDetails do
|
|
429
200
|
xml.tag! :merchantreference, format_reference_number(options[:order_id])
|
|
430
201
|
xml.tag! :amount, amount(money)
|
|
202
|
+
xml.tag! :capturemethod, 'ecomm'
|
|
431
203
|
end
|
|
432
204
|
end
|
|
433
205
|
end
|
|
434
206
|
xml.target!
|
|
435
207
|
end
|
|
436
208
|
|
|
437
|
-
|
|
438
|
-
# Adds the authentication element to the passed builder xml doc
|
|
439
|
-
#
|
|
440
|
-
# Parameters:
|
|
441
|
-
# -xml: Builder document that is being built up
|
|
442
|
-
#
|
|
443
|
-
# Returns:
|
|
444
|
-
# -none: The results is stored in the passed xml document
|
|
445
|
-
#
|
|
446
209
|
def add_authentication(xml)
|
|
447
210
|
xml.tag! :Authentication do
|
|
448
211
|
xml.tag! :client, @options[:login]
|
|
@@ -450,34 +213,12 @@ module ActiveMerchant
|
|
|
450
213
|
end
|
|
451
214
|
end
|
|
452
215
|
|
|
453
|
-
# Add credit_card details to the passed XML Builder doc
|
|
454
|
-
#
|
|
455
|
-
# Parameters:
|
|
456
|
-
# -xml: Builder document that is being built up
|
|
457
|
-
# -credit_card: ActiveMerchant::Billing::CreditCard object
|
|
458
|
-
# -billing_address: Hash containing all of the billing address details
|
|
459
|
-
#
|
|
460
|
-
# Returns:
|
|
461
|
-
# -none: The results is stored in the passed xml document
|
|
462
|
-
#
|
|
463
216
|
def add_credit_card(xml, credit_card, address)
|
|
464
|
-
|
|
465
217
|
xml.tag! :Card do
|
|
466
|
-
|
|
467
218
|
# DataCash calls the CC number 'pan'
|
|
468
219
|
xml.tag! :pan, credit_card.number
|
|
469
220
|
xml.tag! :expirydate, format_date(credit_card.month, credit_card.year)
|
|
470
221
|
|
|
471
|
-
# optional values - for Solo etc
|
|
472
|
-
if [ 'switch', 'solo' ].include?(card_brand(credit_card).to_s)
|
|
473
|
-
|
|
474
|
-
xml.tag! :issuenumber, credit_card.issue_number unless credit_card.issue_number.blank?
|
|
475
|
-
|
|
476
|
-
if !credit_card.start_month.blank? && !credit_card.start_year.blank?
|
|
477
|
-
xml.tag! :startdate, format_date(credit_card.start_month, credit_card.start_year)
|
|
478
|
-
end
|
|
479
|
-
end
|
|
480
|
-
|
|
481
222
|
xml.tag! :Cv2Avs do
|
|
482
223
|
xml.tag! :cv2, credit_card.verification_value if credit_card.verification_value?
|
|
483
224
|
if address
|
|
@@ -496,71 +237,45 @@ module ActiveMerchant
|
|
|
496
237
|
# a predefined one
|
|
497
238
|
xml.tag! :ExtendedPolicy do
|
|
498
239
|
xml.tag! :cv2_policy,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
240
|
+
:notprovided => POLICY_REJECT,
|
|
241
|
+
:notchecked => POLICY_REJECT,
|
|
242
|
+
:matched => POLICY_ACCEPT,
|
|
243
|
+
:notmatched => POLICY_REJECT,
|
|
244
|
+
:partialmatch => POLICY_REJECT
|
|
504
245
|
xml.tag! :postcode_policy,
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
246
|
+
:notprovided => POLICY_ACCEPT,
|
|
247
|
+
:notchecked => POLICY_ACCEPT,
|
|
248
|
+
:matched => POLICY_ACCEPT,
|
|
249
|
+
:notmatched => POLICY_REJECT,
|
|
250
|
+
:partialmatch => POLICY_ACCEPT
|
|
510
251
|
xml.tag! :address_policy,
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
252
|
+
:notprovided => POLICY_ACCEPT,
|
|
253
|
+
:notchecked => POLICY_ACCEPT,
|
|
254
|
+
:matched => POLICY_ACCEPT,
|
|
255
|
+
:notmatched => POLICY_REJECT,
|
|
256
|
+
:partialmatch => POLICY_ACCEPT
|
|
516
257
|
end
|
|
517
258
|
end
|
|
518
259
|
end
|
|
519
260
|
end
|
|
520
261
|
|
|
521
|
-
# Send the passed data to DataCash for processing
|
|
522
|
-
#
|
|
523
|
-
# Parameters:
|
|
524
|
-
# -request: The XML data that is to be sent to Datacash
|
|
525
|
-
#
|
|
526
|
-
# Returns:
|
|
527
|
-
# - ActiveMerchant::Billing::Response object
|
|
528
|
-
#
|
|
529
262
|
def commit(request)
|
|
530
263
|
response = parse(ssl_post(test? ? self.test_url : self.live_url, request))
|
|
531
264
|
|
|
532
|
-
Response.new(response[:status] ==
|
|
265
|
+
Response.new(response[:status] == '1', response[:reason], response,
|
|
533
266
|
:test => test?,
|
|
534
267
|
:authorization => "#{response[:datacash_reference]};#{response[:authcode]};#{response[:ca_reference]}"
|
|
535
268
|
)
|
|
536
269
|
end
|
|
537
270
|
|
|
538
|
-
# Returns a date string in the format Datacash expects
|
|
539
|
-
#
|
|
540
|
-
# Parameters:
|
|
541
|
-
# -month: integer, the month
|
|
542
|
-
# -year: integer, the year
|
|
543
|
-
#
|
|
544
|
-
# Returns:
|
|
545
|
-
# -String: date in MM/YY format
|
|
546
|
-
#
|
|
547
271
|
def format_date(month, year)
|
|
548
|
-
"#{format(month
|
|
272
|
+
"#{format(month, :two_digits)}/#{format(year, :two_digits)}"
|
|
549
273
|
end
|
|
550
274
|
|
|
551
|
-
# Parse the datacash response and create a Response object
|
|
552
|
-
#
|
|
553
|
-
# Parameters:
|
|
554
|
-
# -body: The XML returned from Datacash
|
|
555
|
-
#
|
|
556
|
-
# Returns:
|
|
557
|
-
# -a hash with all of the values returned in the Datacash XML response
|
|
558
|
-
#
|
|
559
275
|
def parse(body)
|
|
560
|
-
|
|
561
276
|
response = {}
|
|
562
277
|
xml = REXML::Document.new(body)
|
|
563
|
-
root = REXML::XPath.first(xml,
|
|
278
|
+
root = REXML::XPath.first(xml, '//Response')
|
|
564
279
|
|
|
565
280
|
root.elements.to_a.each do |node|
|
|
566
281
|
parse_element(response, node)
|
|
@@ -569,24 +284,21 @@ module ActiveMerchant
|
|
|
569
284
|
response
|
|
570
285
|
end
|
|
571
286
|
|
|
572
|
-
# Parse an xml element
|
|
573
|
-
#
|
|
574
|
-
# Parameters:
|
|
575
|
-
# -response: The hash that the values are being returned in
|
|
576
|
-
# -node: The node that is currently being read
|
|
577
|
-
#
|
|
578
|
-
# Returns:
|
|
579
|
-
# - none (results are stored in the passed hash)
|
|
580
287
|
def parse_element(response, node)
|
|
581
288
|
if node.has_elements?
|
|
582
|
-
node.elements.each{|e| parse_element(response, e) }
|
|
289
|
+
node.elements.each { |e| parse_element(response, e) }
|
|
583
290
|
else
|
|
584
291
|
response[node.name.underscore.to_sym] = node.text
|
|
585
292
|
end
|
|
586
293
|
end
|
|
587
294
|
|
|
588
295
|
def format_reference_number(number)
|
|
589
|
-
number.to_s.gsub(/[^A-Za-z0-9]/, '').rjust(6,
|
|
296
|
+
number.to_s.gsub(/[^A-Za-z0-9]/, '').rjust(6, '0').first(30)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def parse_authorization_string(authorization)
|
|
300
|
+
reference, auth_code, ca_reference = authorization.to_s.split(';')
|
|
301
|
+
{:reference => reference, :auth_code => auth_code, :ca_reference => ca_reference}
|
|
590
302
|
end
|
|
591
303
|
end
|
|
592
304
|
end
|