activemerchant 1.38.0 → 1.79.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1402 -3
- data/CONTRIBUTORS +154 -0
- data/README.md +157 -144
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/base.rb +21 -17
- data/lib/active_merchant/billing/check.rb +32 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +215 -67
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +152 -53
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +170 -24
- data/lib/active_merchant/billing/gateways/adyen.rb +299 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +904 -606
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +43 -18
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +134 -346
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +13 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +326 -0
- data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +96 -15
- data/lib/active_merchant/billing/gateways/beanstream.rb +52 -9
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -8
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -501
- data/lib/active_merchant/billing/gateways/blue_snap.rb +343 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +94 -50
- data/lib/active_merchant/billing/gateways/borgun.rb +221 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +15 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +387 -139
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +245 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +269 -118
- data/lib/active_merchant/billing/gateways/cardknox.rb +328 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +45 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +239 -0
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +23 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +225 -0
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +345 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +237 -98
- data/lib/active_merchant/billing/gateways/data_cash.rb +41 -314
- data/lib/active_merchant/billing/gateways/dibs.rb +205 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +143 -142
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +23 -12
- data/lib/active_merchant/billing/gateways/eway.rb +12 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +417 -204
- data/lib/active_merchant/billing/gateways/exact.rb +10 -1
- data/lib/active_merchant/billing/gateways/ezic.rb +196 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +65 -37
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +110 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +155 -29
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +256 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +11 -5
- data/lib/active_merchant/billing/gateways/global_collect.rb +334 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +2 -5
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +1 -1
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -10
- data/lib/active_merchant/billing/gateways/instapay.rb +0 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +210 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +176 -49
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +227 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +17 -13
- data/lib/active_merchant/billing/gateways/litle.rb +329 -439
- data/lib/active_merchant/billing/gateways/mastercard.rb +268 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +26 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -15
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +24 -13
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +33 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +74 -29
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -21
- data/lib/active_merchant/billing/gateways/micropayment.rb +185 -0
- data/lib/active_merchant/billing/gateways/migs.rb +73 -14
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -3
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +119 -36
- data/lib/active_merchant/billing/gateways/moneris_us.rb +146 -45
- data/lib/active_merchant/billing/gateways/money_movers.rb +152 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +81 -56
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +289 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +61 -26
- data/lib/active_merchant/billing/gateways/netpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/network_merchants.rb +242 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +265 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +85 -27
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +227 -0
- data/lib/active_merchant/billing/gateways/opp.rb +372 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +59 -28
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -56
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +207 -0
- data/lib/active_merchant/billing/gateways/pagarme.rb +248 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +246 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -14
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +19 -25
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +16 -12
- data/lib/active_merchant/billing/gateways/payeezy.rb +386 -0
- data/lib/active_merchant/billing/gateways/payex.rb +412 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +38 -17
- data/lib/active_merchant/billing/gateways/payflow.rb +100 -19
- data/lib/active_merchant/billing/gateways/payflow_express.rb +22 -22
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +6 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +15 -3
- data/lib/active_merchant/billing/gateways/paymentez.rb +276 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -8
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +18 -4
- data/lib/active_merchant/billing/gateways/paypal.rb +37 -20
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +6 -5
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +162 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +32 -24
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +440 -0
- data/lib/active_merchant/billing/gateways/pin.rb +68 -13
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +14 -14
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/qbms.rb +12 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +299 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -319
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +40 -25
- data/lib/active_merchant/billing/gateways/redsys.rb +212 -80
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +412 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +176 -59
- data/lib/active_merchant/billing/gateways/secure_net.rb +35 -29
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -9
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +21 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/securion_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +14 -3
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +74 -14
- data/lib/active_merchant/billing/gateways/stripe.rb +472 -83
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +156 -0
- data/lib/active_merchant/billing/gateways/telr.rb +275 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +142 -28
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -231
- data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +17 -11
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +193 -75
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +156 -64
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -15
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +209 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +45 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +238 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +167 -49
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +171 -45
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +218 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +24 -17
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +208 -0
- data/lib/active_merchant/country.rb +334 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +9 -0
- data/lib/active_merchant/network_connection_retries.rb +81 -0
- data/lib/active_merchant/post_data.rb +24 -0
- data/lib/active_merchant/posts_data.rb +94 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +22 -22
- data/lib/certs/cacert.pem +3951 -0
- data/lib/support/gateway_support.rb +16 -10
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_version.rb +87 -0
- metadata +164 -306
- data/gem-public_cert.pem +0 -20
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -155
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -73
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -114
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -95
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -19
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -129
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -28
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -165
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -43
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -91
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -139
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
@@ -1,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
|
-
# From the DataCash docs; Page 13, the following cards are
|
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
9
|
self.supported_cardtypes = [ :visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro, :switch, :solo, :laser ]
|
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
|
|
@@ -200,6 +108,7 @@ module ActiveMerchant
|
|
200
108
|
xml.tag! :TxnDetails do
|
201
109
|
xml.tag! :merchantreference, format_reference_number(options[:order_id])
|
202
110
|
xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money)
|
111
|
+
xml.tag! :capturemethod, 'ecomm'
|
203
112
|
end
|
204
113
|
end
|
205
114
|
end
|
@@ -207,71 +116,10 @@ module ActiveMerchant
|
|
207
116
|
xml.target!
|
208
117
|
end
|
209
118
|
|
210
|
-
# Create the xml document for an 'auth' or 'pre' transaction with a credit card
|
211
|
-
#
|
212
|
-
# Final XML should look like:
|
213
|
-
#
|
214
|
-
# <Request>
|
215
|
-
# <Authentication>
|
216
|
-
# <client>99000000</client>
|
217
|
-
# <password>*******</password>
|
218
|
-
# </Authentication>
|
219
|
-
# <Transaction>
|
220
|
-
# <TxnDetails>
|
221
|
-
# <merchantreference>123456</merchantreference>
|
222
|
-
# <amount currency="EUR">10.00</amount>
|
223
|
-
# </TxnDetails>
|
224
|
-
# <CardTxn>
|
225
|
-
# <Card>
|
226
|
-
# <pan>4444********1111</pan>
|
227
|
-
# <expirydate>03/04</expirydate>
|
228
|
-
# <Cv2Avs>
|
229
|
-
# <street_address1>Flat 7</street_address1>
|
230
|
-
# <street_address2>89 Jumble
|
231
|
-
# Street</street_address2>
|
232
|
-
# <street_address3>Mytown</street_address3>
|
233
|
-
# <postcode>AV12FR</postcode>
|
234
|
-
# <cv2>123</cv2>
|
235
|
-
# <ExtendedPolicy>
|
236
|
-
# <cv2_policy notprovided="reject"
|
237
|
-
# notchecked="accept"
|
238
|
-
# matched="accept"
|
239
|
-
# notmatched="reject"
|
240
|
-
# partialmatch="reject"/>
|
241
|
-
# <postcode_policy notprovided="reject"
|
242
|
-
# notchecked="accept"
|
243
|
-
# matched="accept"
|
244
|
-
# notmatched="reject"
|
245
|
-
# partialmatch="accept"/>
|
246
|
-
# <address_policy notprovided="reject"
|
247
|
-
# notchecked="accept"
|
248
|
-
# matched="accept"
|
249
|
-
# notmatched="reject"
|
250
|
-
# partialmatch="accept"/>
|
251
|
-
# </ExtendedPolicy>
|
252
|
-
# </Cv2Avs>
|
253
|
-
# </Card>
|
254
|
-
# <method>auth</method>
|
255
|
-
# </CardTxn>
|
256
|
-
# </Transaction>
|
257
|
-
# </Request>
|
258
|
-
#
|
259
|
-
# Parameters:
|
260
|
-
# -type must be 'auth' or 'pre'
|
261
|
-
# -money - A money object with the price and currency
|
262
|
-
# -credit_card - The credit_card details to use
|
263
|
-
# -options:
|
264
|
-
# :order_id is the merchant reference number
|
265
|
-
# :billing_address is the billing address for the cc
|
266
|
-
# :address is the delivery address
|
267
|
-
#
|
268
|
-
# Returns:
|
269
|
-
# -xml: Builder document containing the markup
|
270
|
-
#
|
271
119
|
def build_purchase_or_authorization_request_with_credit_card_request(type, money, credit_card, options)
|
272
120
|
xml = Builder::XmlMarkup.new :indent => 2
|
273
121
|
xml.instruct!
|
274
|
-
xml.tag! :Request do
|
122
|
+
xml.tag! :Request, :version => '2' do
|
275
123
|
add_authentication(xml)
|
276
124
|
|
277
125
|
xml.tag! :Transaction do
|
@@ -285,58 +133,25 @@ module ActiveMerchant
|
|
285
133
|
xml.tag! :TxnDetails do
|
286
134
|
xml.tag! :merchantreference, format_reference_number(options[:order_id])
|
287
135
|
xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money)
|
136
|
+
xml.tag! :capturemethod, 'ecomm'
|
288
137
|
end
|
289
138
|
end
|
290
139
|
end
|
291
140
|
xml.target!
|
292
141
|
end
|
293
142
|
|
294
|
-
# Create the xml document for an 'auth' or 'pre' transaction with
|
295
|
-
# continuous authorization
|
296
|
-
#
|
297
|
-
# Final XML should look like:
|
298
|
-
#
|
299
|
-
# <Request>
|
300
|
-
# <Transaction>
|
301
|
-
# <ContAuthTxn type="historic" />
|
302
|
-
# <TxnDetails>
|
303
|
-
# <merchantreference>3851231</merchantreference>
|
304
|
-
# <capturemethod>cont_auth</capturemethod>
|
305
|
-
# <amount currency="GBP">18.50</amount>
|
306
|
-
# </TxnDetails>
|
307
|
-
# <HistoricTxn>
|
308
|
-
# <reference>4500200040925092</reference>
|
309
|
-
# <method>auth</method>
|
310
|
-
# </HistoricTxn>
|
311
|
-
# </Transaction>
|
312
|
-
# <Authentication>
|
313
|
-
# <client>99000001</client>
|
314
|
-
# <password>mypasswd</password>
|
315
|
-
# </Authentication>
|
316
|
-
# </Request>
|
317
|
-
#
|
318
|
-
# Parameters:
|
319
|
-
# -type must be 'auth' or 'pre'
|
320
|
-
# -money - A money object with the price and currency
|
321
|
-
# -authorization - The authorization containing a continuous authority reference previously set up on a credit card
|
322
|
-
# -options:
|
323
|
-
# :order_id is the merchant reference number
|
324
|
-
#
|
325
|
-
# Returns:
|
326
|
-
# -xml: Builder document containing the markup
|
327
|
-
#
|
328
143
|
def build_purchase_or_authorization_request_with_continuous_authority_reference_request(type, money, authorization, options)
|
329
|
-
|
330
|
-
raise ArgumentError, "The continuous authority reference is required for continuous authority transactions" if ca_reference.blank?
|
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?
|
331
146
|
|
332
147
|
xml = Builder::XmlMarkup.new :indent => 2
|
333
148
|
xml.instruct!
|
334
|
-
xml.tag! :Request do
|
149
|
+
xml.tag! :Request, :version => '2' do
|
335
150
|
add_authentication(xml)
|
336
151
|
xml.tag! :Transaction do
|
337
152
|
xml.tag! :ContAuthTxn, :type => 'historic'
|
338
153
|
xml.tag! :HistoricTxn do
|
339
|
-
xml.tag! :reference, ca_reference
|
154
|
+
xml.tag! :reference, parsed_authorization[:ca_reference]
|
340
155
|
xml.tag! :method, type
|
341
156
|
end
|
342
157
|
xml.tag! :TxnDetails do
|
@@ -349,39 +164,21 @@ module ActiveMerchant
|
|
349
164
|
xml.target!
|
350
165
|
end
|
351
166
|
|
352
|
-
|
353
|
-
|
354
|
-
# Final XML should look like:
|
355
|
-
#
|
356
|
-
# <Request>
|
357
|
-
# <Authentication>
|
358
|
-
# <client>99000001</client>
|
359
|
-
# <password>*******</password>
|
360
|
-
# </Authentication>
|
361
|
-
# <Transaction>
|
362
|
-
# <HistoricTxn>
|
363
|
-
# <method>txn_refund</method>
|
364
|
-
# <reference>12345678</reference>
|
365
|
-
# </HistoricTxn>
|
366
|
-
# <TxnDetails>
|
367
|
-
# <amount>10.00</amount>
|
368
|
-
# </TxnDetails>
|
369
|
-
# </Transaction>
|
370
|
-
# </Request>
|
371
|
-
#
|
372
|
-
def build_transaction_refund_request(money, reference)
|
167
|
+
def build_transaction_refund_request(money, authorization)
|
168
|
+
parsed_authorization = parse_authorization_string(authorization)
|
373
169
|
xml = Builder::XmlMarkup.new :indent => 2
|
374
170
|
xml.instruct!
|
375
|
-
xml.tag! :Request do
|
171
|
+
xml.tag! :Request, :version => '2' do
|
376
172
|
add_authentication(xml)
|
377
173
|
xml.tag! :Transaction do
|
378
174
|
xml.tag! :HistoricTxn do
|
379
|
-
xml.tag! :reference, reference
|
175
|
+
xml.tag! :reference, parsed_authorization[:reference]
|
380
176
|
xml.tag! :method, TRANSACTION_REFUND_TYPE
|
381
177
|
end
|
382
178
|
unless money.nil?
|
383
179
|
xml.tag! :TxnDetails do
|
384
180
|
xml.tag! :amount, amount(money)
|
181
|
+
xml.tag! :capturemethod, 'ecomm'
|
385
182
|
end
|
386
183
|
end
|
387
184
|
end
|
@@ -389,34 +186,10 @@ module ActiveMerchant
|
|
389
186
|
xml.target!
|
390
187
|
end
|
391
188
|
|
392
|
-
|
393
|
-
#
|
394
|
-
# Final XML should look like:
|
395
|
-
#
|
396
|
-
# <Request>
|
397
|
-
# <Authentication>
|
398
|
-
# <client>99000001</client>
|
399
|
-
# <password>*****</password>
|
400
|
-
# </Authentication>
|
401
|
-
# <Transaction>
|
402
|
-
# <CardTxn>
|
403
|
-
# <Card>
|
404
|
-
# <pan>633300*********1</pan>
|
405
|
-
# <expirydate>04/06</expirydate>
|
406
|
-
# <startdate>01/04</startdate>
|
407
|
-
# </Card>
|
408
|
-
# <method>refund</method>
|
409
|
-
# </CardTxn>
|
410
|
-
# <TxnDetails>
|
411
|
-
# <merchantreference>1000001</merchantreference>
|
412
|
-
# <amount currency="GBP">95.99</amount>
|
413
|
-
# </TxnDetails>
|
414
|
-
# </Transaction>
|
415
|
-
# </Request>
|
416
|
-
def build_refund_request(money, credit_card, options)
|
189
|
+
def build_credit_request(money, credit_card, options)
|
417
190
|
xml = Builder::XmlMarkup.new :indent => 2
|
418
191
|
xml.instruct!
|
419
|
-
xml.tag! :Request do
|
192
|
+
xml.tag! :Request, :version => '2' do
|
420
193
|
add_authentication(xml)
|
421
194
|
xml.tag! :Transaction do
|
422
195
|
xml.tag! :CardTxn do
|
@@ -426,21 +199,13 @@ module ActiveMerchant
|
|
426
199
|
xml.tag! :TxnDetails do
|
427
200
|
xml.tag! :merchantreference, format_reference_number(options[:order_id])
|
428
201
|
xml.tag! :amount, amount(money)
|
202
|
+
xml.tag! :capturemethod, 'ecomm'
|
429
203
|
end
|
430
204
|
end
|
431
205
|
end
|
432
206
|
xml.target!
|
433
207
|
end
|
434
208
|
|
435
|
-
|
436
|
-
# Adds the authentication element to the passed builder xml doc
|
437
|
-
#
|
438
|
-
# Parameters:
|
439
|
-
# -xml: Builder document that is being built up
|
440
|
-
#
|
441
|
-
# Returns:
|
442
|
-
# -none: The results is stored in the passed xml document
|
443
|
-
#
|
444
209
|
def add_authentication(xml)
|
445
210
|
xml.tag! :Authentication do
|
446
211
|
xml.tag! :client, @options[:login]
|
@@ -448,16 +213,6 @@ module ActiveMerchant
|
|
448
213
|
end
|
449
214
|
end
|
450
215
|
|
451
|
-
# Add credit_card details to the passed XML Builder doc
|
452
|
-
#
|
453
|
-
# Parameters:
|
454
|
-
# -xml: Builder document that is being built up
|
455
|
-
# -credit_card: ActiveMerchant::Billing::CreditCard object
|
456
|
-
# -billing_address: Hash containing all of the billing address details
|
457
|
-
#
|
458
|
-
# Returns:
|
459
|
-
# -none: The results is stored in the passed xml document
|
460
|
-
#
|
461
216
|
def add_credit_card(xml, credit_card, address)
|
462
217
|
|
463
218
|
xml.tag! :Card do
|
@@ -516,44 +271,19 @@ module ActiveMerchant
|
|
516
271
|
end
|
517
272
|
end
|
518
273
|
|
519
|
-
# Send the passed data to DataCash for processing
|
520
|
-
#
|
521
|
-
# Parameters:
|
522
|
-
# -request: The XML data that is to be sent to Datacash
|
523
|
-
#
|
524
|
-
# Returns:
|
525
|
-
# - ActiveMerchant::Billing::Response object
|
526
|
-
#
|
527
274
|
def commit(request)
|
528
275
|
response = parse(ssl_post(test? ? self.test_url : self.live_url, request))
|
529
276
|
|
530
|
-
Response.new(response[:status] ==
|
277
|
+
Response.new(response[:status] == '1', response[:reason], response,
|
531
278
|
:test => test?,
|
532
279
|
:authorization => "#{response[:datacash_reference]};#{response[:authcode]};#{response[:ca_reference]}"
|
533
280
|
)
|
534
281
|
end
|
535
282
|
|
536
|
-
# Returns a date string in the format Datacash expects
|
537
|
-
#
|
538
|
-
# Parameters:
|
539
|
-
# -month: integer, the month
|
540
|
-
# -year: integer, the year
|
541
|
-
#
|
542
|
-
# Returns:
|
543
|
-
# -String: date in MM/YY format
|
544
|
-
#
|
545
283
|
def format_date(month, year)
|
546
284
|
"#{format(month,:two_digits)}/#{format(year, :two_digits)}"
|
547
285
|
end
|
548
286
|
|
549
|
-
# Parse the datacash response and create a Response object
|
550
|
-
#
|
551
|
-
# Parameters:
|
552
|
-
# -body: The XML returned from Datacash
|
553
|
-
#
|
554
|
-
# Returns:
|
555
|
-
# -a hash with all of the values returned in the Datacash XML response
|
556
|
-
#
|
557
287
|
def parse(body)
|
558
288
|
|
559
289
|
response = {}
|
@@ -567,14 +297,6 @@ module ActiveMerchant
|
|
567
297
|
response
|
568
298
|
end
|
569
299
|
|
570
|
-
# Parse an xml element
|
571
|
-
#
|
572
|
-
# Parameters:
|
573
|
-
# -response: The hash that the values are being returned in
|
574
|
-
# -node: The node that is currently being read
|
575
|
-
#
|
576
|
-
# Returns:
|
577
|
-
# - none (results are stored in the passed hash)
|
578
300
|
def parse_element(response, node)
|
579
301
|
if node.has_elements?
|
580
302
|
node.elements.each{|e| parse_element(response, e) }
|
@@ -586,6 +308,11 @@ module ActiveMerchant
|
|
586
308
|
def format_reference_number(number)
|
587
309
|
number.to_s.gsub(/[^A-Za-z0-9]/, '').rjust(6, "0").first(30)
|
588
310
|
end
|
311
|
+
|
312
|
+
def parse_authorization_string(authorization)
|
313
|
+
reference, auth_code, ca_reference = authorization.to_s.split(';')
|
314
|
+
{:reference => reference, :auth_code => auth_code, :ca_reference => ca_reference}
|
315
|
+
end
|
589
316
|
end
|
590
317
|
end
|
591
318
|
end
|