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,158 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Chronopay
|
5
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
6
|
-
def complete?
|
7
|
-
status == 'Completed'
|
8
|
-
end
|
9
|
-
|
10
|
-
# Status of transaction. List of possible values:
|
11
|
-
# <tt>onetime – one time payment has been made, no repayment required;</tt>::
|
12
|
-
# <tt>initial – first payment has been made, repayment required in corresponding period;</tt>::
|
13
|
-
# <tt>decline – charge request has been rejected;</tt>::
|
14
|
-
# <tt>rebill – repayment has been made together with initial transaction;</ttt>::
|
15
|
-
# <tt>cancel – repayments has been disabled;</tt>::
|
16
|
-
# <tt>expire – customer’s access to restricted zone membership has been expired;</tt>::
|
17
|
-
# <tt>refund – request to refund has been received;</tt>::
|
18
|
-
# <tt>chargeback – request to chargeback has been received.</tt>::
|
19
|
-
#
|
20
|
-
# This implementation of Chronopay does not support subscriptions.
|
21
|
-
# The status codes used are matched to the status codes that Paypal
|
22
|
-
# sends. See Paypal::Notification#status for more details
|
23
|
-
def status
|
24
|
-
case params['transaction_type']
|
25
|
-
when 'onetime'
|
26
|
-
'Completed'
|
27
|
-
when 'refund'
|
28
|
-
'Refunded'
|
29
|
-
when 'chargeback'
|
30
|
-
'Reversed'
|
31
|
-
else
|
32
|
-
'Failed'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# Unique ID of transaction
|
37
|
-
def transaction_id
|
38
|
-
params['transaction_id']
|
39
|
-
end
|
40
|
-
|
41
|
-
# Unique ID of customer
|
42
|
-
def customer_id
|
43
|
-
params['customer_id']
|
44
|
-
end
|
45
|
-
|
46
|
-
# Unique ID of Merchant’s web-site
|
47
|
-
def site_id
|
48
|
-
params['site_id']
|
49
|
-
end
|
50
|
-
|
51
|
-
# ID of a product that was purchased
|
52
|
-
def product_id
|
53
|
-
params['product_id']
|
54
|
-
end
|
55
|
-
|
56
|
-
# Language
|
57
|
-
def language
|
58
|
-
params['language']
|
59
|
-
end
|
60
|
-
|
61
|
-
def received_at
|
62
|
-
# Date should be formatted "dd-mm-yy" to be parsed by 1.8 and 1.9 the same way
|
63
|
-
formatted_date = Date.strptime(date, "%m/%d/%Y").strftime("%d-%m-%Y")
|
64
|
-
Time.parse("#{formatted_date} #{time}") unless date.blank? || time.blank?
|
65
|
-
end
|
66
|
-
|
67
|
-
# Date of transaction in MM/DD/YYYY format
|
68
|
-
def date
|
69
|
-
params['date']
|
70
|
-
end
|
71
|
-
|
72
|
-
# Time of transaction in HH:MM:SS format
|
73
|
-
def time
|
74
|
-
params['time']
|
75
|
-
end
|
76
|
-
|
77
|
-
# The customer's full name
|
78
|
-
def name
|
79
|
-
params['name']
|
80
|
-
end
|
81
|
-
|
82
|
-
# The customer's email address
|
83
|
-
def email
|
84
|
-
params['email']
|
85
|
-
end
|
86
|
-
|
87
|
-
# The customer's street address
|
88
|
-
def street
|
89
|
-
params['street']
|
90
|
-
end
|
91
|
-
|
92
|
-
# The customer's country - 3 digit country code
|
93
|
-
def country
|
94
|
-
params['country']
|
95
|
-
end
|
96
|
-
|
97
|
-
# The customer's city
|
98
|
-
def city
|
99
|
-
params['city']
|
100
|
-
end
|
101
|
-
|
102
|
-
# The customer's zip
|
103
|
-
def zip
|
104
|
-
params['zip']
|
105
|
-
end
|
106
|
-
|
107
|
-
# The customer's state. Only useful for US Customers
|
108
|
-
def state
|
109
|
-
params['state']
|
110
|
-
end
|
111
|
-
|
112
|
-
# Customer’s login for restricted access zone of Merchant’s Web-site
|
113
|
-
def username
|
114
|
-
params['username']
|
115
|
-
end
|
116
|
-
|
117
|
-
# Customer's password for restricted access zone of Merchant’s Web-site, as chosen
|
118
|
-
def password
|
119
|
-
params['password']
|
120
|
-
end
|
121
|
-
|
122
|
-
# The item id passed in the first custom parameter
|
123
|
-
def item_id
|
124
|
-
params['cs1']
|
125
|
-
end
|
126
|
-
|
127
|
-
# Additional parameter
|
128
|
-
def custom2
|
129
|
-
params['cs2']
|
130
|
-
end
|
131
|
-
|
132
|
-
# Additional parameter
|
133
|
-
def custom3
|
134
|
-
params['cs3']
|
135
|
-
end
|
136
|
-
|
137
|
-
# The currency the purchase was made in
|
138
|
-
def currency
|
139
|
-
params['currency']
|
140
|
-
end
|
141
|
-
|
142
|
-
# the money amount we received in X.2 decimal.
|
143
|
-
def gross
|
144
|
-
params['total']
|
145
|
-
end
|
146
|
-
|
147
|
-
def test?
|
148
|
-
date.blank? && time.blank? && transaction_id.blank?
|
149
|
-
end
|
150
|
-
|
151
|
-
def acknowledge
|
152
|
-
true
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
|
2
|
-
module ActiveMerchant #:nodoc:
|
3
|
-
module Billing #:nodoc:
|
4
|
-
module Integrations #:nodoc:
|
5
|
-
module Chronopay
|
6
|
-
autoload :Return, 'active_merchant/billing/integrations/chronopay/return.rb'
|
7
|
-
autoload :Helper, 'active_merchant/billing/integrations/chronopay/helper.rb'
|
8
|
-
autoload :Notification, 'active_merchant/billing/integrations/chronopay/notification.rb'
|
9
|
-
|
10
|
-
mattr_accessor :service_url
|
11
|
-
self.service_url = 'https://secure.chronopay.com/index_shop.cgi'
|
12
|
-
|
13
|
-
def self.notification(post, options = {})
|
14
|
-
Notification.new(post)
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.return(query_string, options = {})
|
18
|
-
Return.new(query_string)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,200 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module DirecPay
|
5
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
-
mapping :account, 'MID'
|
7
|
-
mapping :order, 'Merchant Order No'
|
8
|
-
mapping :amount, 'Amount'
|
9
|
-
mapping :currency, 'Currency'
|
10
|
-
mapping :country, 'Country'
|
11
|
-
|
12
|
-
mapping :billing_address, :city => 'custCity',
|
13
|
-
:address1 => 'custAddress',
|
14
|
-
:state => 'custState',
|
15
|
-
:zip => 'custPinCode',
|
16
|
-
:country => 'custCountry',
|
17
|
-
:phone => 'custMobileNo'
|
18
|
-
|
19
|
-
mapping :shipping_address, :name => 'deliveryName',
|
20
|
-
:city => 'deliveryCity',
|
21
|
-
:address1 => 'deliveryAddress',
|
22
|
-
:state => 'deliveryState',
|
23
|
-
:zip => 'deliveryPinCode',
|
24
|
-
:country => 'deliveryCountry',
|
25
|
-
:phone => 'deliveryMobileNo'
|
26
|
-
|
27
|
-
mapping :customer, :name => 'custName',
|
28
|
-
:email => 'custEmailId'
|
29
|
-
|
30
|
-
mapping :description, 'otherNotes'
|
31
|
-
mapping :edit_allowed, 'editAllowed'
|
32
|
-
|
33
|
-
mapping :return_url, 'Success URL'
|
34
|
-
mapping :failure_url, 'Failure URL'
|
35
|
-
|
36
|
-
mapping :operating_mode, 'Operating Mode'
|
37
|
-
mapping :other_details, 'Other Details'
|
38
|
-
mapping :collaborator, 'Collaborator'
|
39
|
-
|
40
|
-
OPERATING_MODE = 'DOM'
|
41
|
-
COUNTRY = 'IND'
|
42
|
-
CURRENCY = 'INR'
|
43
|
-
OTHER_DETAILS = 'NULL'
|
44
|
-
EDIT_ALLOWED = 'Y'
|
45
|
-
|
46
|
-
PHONE_CODES = {
|
47
|
-
'IN' => '91',
|
48
|
-
'US' => '01',
|
49
|
-
'CA' => '01'
|
50
|
-
}
|
51
|
-
|
52
|
-
ENCODED_PARAMS = [ :account, :operating_mode, :country, :currency, :amount, :order, :other_details, :return_url, :failure_url, :collaborator ]
|
53
|
-
|
54
|
-
|
55
|
-
def initialize(order, account, options = {})
|
56
|
-
super
|
57
|
-
collaborator = ActiveMerchant::Billing::Base.integration_mode == :test || options[:test] ? 'TOML' : 'DirecPay'
|
58
|
-
add_field(mappings[:collaborator], collaborator)
|
59
|
-
add_field(mappings[:country], 'IND')
|
60
|
-
add_field(mappings[:operating_mode], OPERATING_MODE)
|
61
|
-
add_field(mappings[:other_details], OTHER_DETAILS)
|
62
|
-
add_field(mappings[:edit_allowed], EDIT_ALLOWED)
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
def customer(params = {})
|
67
|
-
add_field(mappings[:customer][:name], full_name(params))
|
68
|
-
add_field(mappings[:customer][:email], params[:email])
|
69
|
-
end
|
70
|
-
|
71
|
-
# Need to format the amount to have 2 decimal places
|
72
|
-
def amount=(money)
|
73
|
-
cents = money.respond_to?(:cents) ? money.cents : money
|
74
|
-
if money.is_a?(String) or cents.to_i <= 0
|
75
|
-
raise ArgumentError, 'money amount must be either a Money object or a positive integer in cents.'
|
76
|
-
end
|
77
|
-
add_field(mappings[:amount], sprintf("%.2f", cents.to_f/100))
|
78
|
-
end
|
79
|
-
|
80
|
-
def shipping_address(params = {})
|
81
|
-
super(update_address(:shipping_address, params))
|
82
|
-
end
|
83
|
-
|
84
|
-
def billing_address(params = {})
|
85
|
-
super(update_address(:billing_address, params))
|
86
|
-
end
|
87
|
-
|
88
|
-
def form_fields
|
89
|
-
add_failure_url
|
90
|
-
add_request_parameters
|
91
|
-
|
92
|
-
unencoded_parameters
|
93
|
-
end
|
94
|
-
|
95
|
-
|
96
|
-
private
|
97
|
-
|
98
|
-
def add_request_parameters
|
99
|
-
params = ENCODED_PARAMS.map{ |param| fields[mappings[param]] }
|
100
|
-
encoded = encode_value(params.join('|'))
|
101
|
-
|
102
|
-
add_field('requestparameter', encoded)
|
103
|
-
end
|
104
|
-
|
105
|
-
def unencoded_parameters
|
106
|
-
params = fields.dup
|
107
|
-
# remove all encoded params from exported fields
|
108
|
-
ENCODED_PARAMS.each{ |param| params.delete(mappings[param]) }
|
109
|
-
# remove all special characters from each field value
|
110
|
-
params = params.collect{|name, value| [name, remove_special_characters(value)] }
|
111
|
-
Hash[params]
|
112
|
-
end
|
113
|
-
|
114
|
-
def add_failure_url
|
115
|
-
if fields[mappings[:failure_url]].nil?
|
116
|
-
add_field(mappings[:failure_url], fields[mappings[:return_url]])
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
def update_address(address_type, params)
|
121
|
-
params = params.dup
|
122
|
-
address = params[:address1]
|
123
|
-
address = "#{address} #{params[:address2]}" if params[:address2].present?
|
124
|
-
address = "#{params[:company]} #{address}" if params[:company].present?
|
125
|
-
params[:address1] = address
|
126
|
-
|
127
|
-
params[:phone] = normalize_phone_number(params[:phone])
|
128
|
-
add_land_line_phone_for(address_type, params)
|
129
|
-
|
130
|
-
if address_type == :shipping_address
|
131
|
-
shipping_name = full_name(params) || fields[mappings[:customer][:name]]
|
132
|
-
add_field(mappings[:shipping_address][:name], shipping_name)
|
133
|
-
end
|
134
|
-
params
|
135
|
-
end
|
136
|
-
|
137
|
-
# Split a single phone number into the country code, area code and local number as best as possible
|
138
|
-
def add_land_line_phone_for(address_type, params)
|
139
|
-
address_field = address_type == :billing_address ? 'custPhoneNo' : 'deliveryPhNo'
|
140
|
-
|
141
|
-
if params.has_key?(:phone2)
|
142
|
-
phone = normalize_phone_number(params[:phone2])
|
143
|
-
phone_country_code, phone_area_code, phone_number = nil
|
144
|
-
|
145
|
-
if params[:country] == 'IN' && phone =~ /(91)? *(\d{3}) *(\d{4,})$/
|
146
|
-
phone_country_code, phone_area_code, phone_number = $1, $2, $3
|
147
|
-
else
|
148
|
-
numbers = phone.split(' ')
|
149
|
-
case numbers.size
|
150
|
-
when 3
|
151
|
-
phone_country_code, phone_area_code, phone_number = numbers
|
152
|
-
when 2
|
153
|
-
phone_area_code, phone_number = numbers
|
154
|
-
else
|
155
|
-
phone =~ /(\d{3})(\d+)$/
|
156
|
-
phone_area_code, phone_number = $1, $2
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
add_field("#{address_field}1", phone_country_code || phone_code_for_country(params[:country]) || '91')
|
161
|
-
add_field("#{address_field}2", phone_area_code)
|
162
|
-
add_field("#{address_field}3", phone_number)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
def normalize_phone_number(phone)
|
167
|
-
phone.gsub(/[^\d ]+/, '') if phone
|
168
|
-
end
|
169
|
-
|
170
|
-
# Special characters are NOT allowed while posting transaction parameters on DirecPay system
|
171
|
-
def remove_special_characters(string)
|
172
|
-
string.gsub(/[~"'&#%]/, '-')
|
173
|
-
end
|
174
|
-
|
175
|
-
def encode_value(value)
|
176
|
-
encoded = Base64.strict_encode64(value)
|
177
|
-
string_to_encode = encoded[0, 1] + "T" + encoded[1, encoded.length]
|
178
|
-
Base64.strict_encode64(string_to_encode)
|
179
|
-
end
|
180
|
-
|
181
|
-
def decode_value(value)
|
182
|
-
decoded = Base64.decode64(value)
|
183
|
-
string_to_decode = decoded[0, 1] + decoded[2, decoded.length]
|
184
|
-
Base64.decode64(string_to_decode)
|
185
|
-
end
|
186
|
-
|
187
|
-
def phone_code_for_country(country)
|
188
|
-
PHONE_CODES[country]
|
189
|
-
end
|
190
|
-
|
191
|
-
def full_name(params)
|
192
|
-
return if params[:name].blank? && params[:first_name].blank? && params[:last_name].blank?
|
193
|
-
|
194
|
-
params[:name] || "#{params[:first_name]} #{params[:last_name]}"
|
195
|
-
end
|
196
|
-
end
|
197
|
-
end
|
198
|
-
end
|
199
|
-
end
|
200
|
-
end
|
@@ -1,76 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
module Integrations #:nodoc:
|
6
|
-
module DirecPay
|
7
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
8
|
-
RESPONSE_PARAMS = ['DirecPay Reference ID', 'Flag', 'Country', 'Currency', 'Other Details', 'Merchant Order No', 'Amount']
|
9
|
-
|
10
|
-
def acknowledge
|
11
|
-
true
|
12
|
-
end
|
13
|
-
|
14
|
-
def complete?
|
15
|
-
status == 'Completed' || status == 'Pending'
|
16
|
-
end
|
17
|
-
|
18
|
-
def status
|
19
|
-
case params['Flag']
|
20
|
-
when 'SUCCESS'
|
21
|
-
'Completed'
|
22
|
-
when 'PENDING'
|
23
|
-
'Pending'
|
24
|
-
when 'FAIL'
|
25
|
-
'Failed'
|
26
|
-
else
|
27
|
-
'Error'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def item_id
|
32
|
-
params['Merchant Order No']
|
33
|
-
end
|
34
|
-
|
35
|
-
def transaction_id
|
36
|
-
params['DirecPay Reference ID']
|
37
|
-
end
|
38
|
-
|
39
|
-
# the money amount we received in X.2 decimal
|
40
|
-
def gross
|
41
|
-
params['Amount']
|
42
|
-
end
|
43
|
-
|
44
|
-
def currency
|
45
|
-
params['Currency']
|
46
|
-
end
|
47
|
-
|
48
|
-
def country
|
49
|
-
params['Country']
|
50
|
-
end
|
51
|
-
|
52
|
-
def other_details
|
53
|
-
params['Other Details']
|
54
|
-
end
|
55
|
-
|
56
|
-
def test?
|
57
|
-
false
|
58
|
-
end
|
59
|
-
|
60
|
-
# Take the posted data and move the relevant data into a hash
|
61
|
-
def parse(post)
|
62
|
-
super
|
63
|
-
|
64
|
-
values = params['responseparams'].to_s.split('|')
|
65
|
-
response_params = values.size == 3 ? ['DirecPay Reference ID', 'Flag', 'Error message'] : RESPONSE_PARAMS
|
66
|
-
response_params.each_with_index do |name, index|
|
67
|
-
params[name] = values[index]
|
68
|
-
end
|
69
|
-
params
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
|
5
|
-
module DirecPay
|
6
|
-
class Return < ActiveMerchant::Billing::Integrations::Return
|
7
|
-
|
8
|
-
def initialize(post_data, options = {})
|
9
|
-
@notification = Notification.new(treat_failure_as_pending(post_data), options)
|
10
|
-
end
|
11
|
-
|
12
|
-
def success?
|
13
|
-
notification.complete?
|
14
|
-
end
|
15
|
-
|
16
|
-
def message
|
17
|
-
notification.status
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
# Work around the issue that the initial return from DirecPay is always either SUCCESS or FAIL, there is no PENDING
|
24
|
-
def treat_failure_as_pending(post_data)
|
25
|
-
post_data.sub(/FAIL/, 'PENDING')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module DirecPay
|
5
|
-
|
6
|
-
class Status
|
7
|
-
include PostsData
|
8
|
-
|
9
|
-
STATUS_TEST_URL = 'https://test.direcpay.com/direcpay/secure/dpMerchantTransaction.jsp'
|
10
|
-
STATUS_LIVE_URL = 'https://www.timesofmoney.com/direcpay/secure/dpPullMerchAtrnDtls.jsp'
|
11
|
-
|
12
|
-
attr_reader :account, :options
|
13
|
-
|
14
|
-
def initialize(account, options = {})
|
15
|
-
@account, @options = account, options
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
# Use this method to manually request a status update to the provided notification_url
|
20
|
-
def update(authorization, notification_url)
|
21
|
-
url = test? ? STATUS_TEST_URL : STATUS_LIVE_URL
|
22
|
-
parameters = [ authorization, account, notification_url ]
|
23
|
-
data = PostData.new
|
24
|
-
data[:requestparams] = parameters.join('|')
|
25
|
-
|
26
|
-
response = ssl_get("#{url}?#{data.to_post_data}")
|
27
|
-
end
|
28
|
-
|
29
|
-
def test?
|
30
|
-
ActiveMerchant::Billing::Base.integration_mode == :test || options[:test]
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module DirecPay
|
5
|
-
autoload :Helper, File.dirname(__FILE__) + '/direc_pay/helper.rb'
|
6
|
-
autoload :Return, File.dirname(__FILE__) + '/direc_pay/return.rb'
|
7
|
-
autoload :Notification, File.dirname(__FILE__) + '/direc_pay/notification.rb'
|
8
|
-
autoload :Status, File.dirname(__FILE__) + '/direc_pay/status.rb'
|
9
|
-
|
10
|
-
mattr_accessor :production_url, :test_url
|
11
|
-
|
12
|
-
self.production_url = "https://www.timesofmoney.com/direcpay/secure/dpMerchantTransaction.jsp"
|
13
|
-
self.test_url = "https://test.direcpay.com/direcpay/secure/dpMerchantTransaction.jsp"
|
14
|
-
|
15
|
-
def self.service_url
|
16
|
-
mode = ActiveMerchant::Billing::Base.integration_mode
|
17
|
-
case mode
|
18
|
-
when :production
|
19
|
-
self.production_url
|
20
|
-
when :test
|
21
|
-
self.test_url
|
22
|
-
else
|
23
|
-
raise StandardError, "Integration mode set to an invalid value: #{mode}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.notification(post, options = {})
|
28
|
-
Notification.new(post)
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.return(query_string, options = {})
|
32
|
-
Return.new(query_string, options)
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.request_status_update(mid, transaction_id, notification_url)
|
36
|
-
Status.new(mid).update(transaction_id, notification_url)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Directebanking
|
5
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
-
|
7
|
-
# All credentials are mandatory and need to be set
|
8
|
-
#
|
9
|
-
# credential1: User ID
|
10
|
-
# credential2: Project ID
|
11
|
-
# credential3: Project Password (Algorithm: SH1)
|
12
|
-
# credential4: Notification Password (Algorithm: SH1)
|
13
|
-
def initialize(order, account, options = {})
|
14
|
-
super
|
15
|
-
add_field('user_variable_0', order)
|
16
|
-
add_field('project_id', options[:credential2])
|
17
|
-
@project_password = options[:credential3]
|
18
|
-
end
|
19
|
-
|
20
|
-
SIGNATURE_FIELDS = [
|
21
|
-
:user_id,
|
22
|
-
:project_id,
|
23
|
-
:sender_holder,
|
24
|
-
:sender_account_number,
|
25
|
-
:sender_bank_code,
|
26
|
-
:sender_country_id,
|
27
|
-
:amount,
|
28
|
-
:currency_id,
|
29
|
-
:reason_1,
|
30
|
-
:reason_2,
|
31
|
-
:user_variable_0,
|
32
|
-
:user_variable_1,
|
33
|
-
:user_variable_2,
|
34
|
-
:user_variable_3,
|
35
|
-
:user_variable_4,
|
36
|
-
:user_variable_5
|
37
|
-
]
|
38
|
-
|
39
|
-
SIGNATURE_IGNORE_AT_METHOD_CREATION_FIELDS = [
|
40
|
-
:user_id,
|
41
|
-
:amount,
|
42
|
-
:project_id,
|
43
|
-
:currency_id,
|
44
|
-
:user_variable_0,
|
45
|
-
:user_variable_1,
|
46
|
-
:user_variable_2,
|
47
|
-
:user_variable_3
|
48
|
-
]
|
49
|
-
|
50
|
-
SIGNATURE_FIELDS.each do |key|
|
51
|
-
if !SIGNATURE_IGNORE_AT_METHOD_CREATION_FIELDS.include?(key)
|
52
|
-
mapping "#{key}".to_sym, "#{key.to_s}"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
# Need to format the amount to have 2 decimal places
|
57
|
-
def amount=(money)
|
58
|
-
cents = money.respond_to?(:cents) ? money.cents : money
|
59
|
-
if money.is_a?(String) or cents.to_i <= 0
|
60
|
-
raise ArgumentError, 'money amount must be either a Money object or a positive integer in cents.'
|
61
|
-
end
|
62
|
-
add_field mappings[:amount], sprintf("%.2f", cents.to_f/100)
|
63
|
-
end
|
64
|
-
|
65
|
-
def generate_signature_string
|
66
|
-
# format of signature: user_id|project_id|sender_holder|sender_account_number|sender_bank_code| sender_country_id|amount|currency_id|reason_1|reason_2|user_variable_0|user_variable_1|user_variable_2|user_variable_3|user_variable_4|user_variable_5|project_password
|
67
|
-
SIGNATURE_FIELDS.map {|key| @fields[key.to_s]} * "|" + "|#{@project_password}"
|
68
|
-
end
|
69
|
-
|
70
|
-
def generate_signature
|
71
|
-
Digest::SHA1.hexdigest(generate_signature_string)
|
72
|
-
end
|
73
|
-
|
74
|
-
def form_fields
|
75
|
-
@fields.merge('hash' => generate_signature)
|
76
|
-
end
|
77
|
-
|
78
|
-
mapping :account, 'user_id'
|
79
|
-
mapping :amount, 'amount'
|
80
|
-
mapping :currency, 'currency_id'
|
81
|
-
mapping :description, 'reason_1'
|
82
|
-
|
83
|
-
mapping :return_url, 'user_variable_1'
|
84
|
-
mapping :cancel_return_url, 'user_variable_2'
|
85
|
-
mapping :notify_url, 'user_variable_3'
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|