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,227 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
require 'time'
|
3
|
-
|
4
|
-
module ActiveMerchant #:nodoc:
|
5
|
-
module Billing #:nodoc:
|
6
|
-
module Integrations #:nodoc:
|
7
|
-
module Paypal
|
8
|
-
# Parser and handler for incoming Instant payment notifications from paypal.
|
9
|
-
# The Example shows a typical handler in a rails application. Note that this
|
10
|
-
# is an example, please read the Paypal API documentation for all the details
|
11
|
-
# on creating a safe payment controller.
|
12
|
-
#
|
13
|
-
# Example
|
14
|
-
#
|
15
|
-
# class BackendController < ApplicationController
|
16
|
-
# include ActiveMerchant::Billing::Integrations
|
17
|
-
#
|
18
|
-
# def paypal_ipn
|
19
|
-
# notify = Paypal::Notification.new(request.raw_post)
|
20
|
-
#
|
21
|
-
# if notify.masspay?
|
22
|
-
# masspay_items = notify.items
|
23
|
-
# end
|
24
|
-
#
|
25
|
-
# order = Order.find(notify.item_id)
|
26
|
-
#
|
27
|
-
# if notify.acknowledge
|
28
|
-
# begin
|
29
|
-
#
|
30
|
-
# if notify.complete? and order.total == notify.amount
|
31
|
-
# order.status = 'success'
|
32
|
-
#
|
33
|
-
# shop.ship(order)
|
34
|
-
# else
|
35
|
-
# logger.error("Failed to verify Paypal's notification, please investigate")
|
36
|
-
# end
|
37
|
-
#
|
38
|
-
# rescue => e
|
39
|
-
# order.status = 'failed'
|
40
|
-
# raise
|
41
|
-
# ensure
|
42
|
-
# order.save
|
43
|
-
# end
|
44
|
-
# end
|
45
|
-
#
|
46
|
-
# render :nothing
|
47
|
-
# end
|
48
|
-
# end
|
49
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
50
|
-
include PostsData
|
51
|
-
|
52
|
-
def initialize(post, options = {})
|
53
|
-
super
|
54
|
-
extend MassPayNotification if masspay?
|
55
|
-
end
|
56
|
-
|
57
|
-
# Was the transaction complete?
|
58
|
-
def complete?
|
59
|
-
status == "Completed"
|
60
|
-
end
|
61
|
-
|
62
|
-
# Is it a masspay notification?
|
63
|
-
def masspay?
|
64
|
-
type == "masspay"
|
65
|
-
end
|
66
|
-
|
67
|
-
# When was this payment received by the client.
|
68
|
-
# sometimes it can happen that we get the notification much later.
|
69
|
-
# One possible scenario is that our web application was down. In this case paypal tries several
|
70
|
-
# times an hour to inform us about the notification
|
71
|
-
def received_at
|
72
|
-
parsed_time_fields = DateTime._strptime(params['payment_date'], "%H:%M:%S %b %d, %Y %Z")
|
73
|
-
Time.gm(
|
74
|
-
parsed_time_fields[:year],
|
75
|
-
parsed_time_fields[:mon],
|
76
|
-
parsed_time_fields[:mday],
|
77
|
-
parsed_time_fields[:hour],
|
78
|
-
parsed_time_fields[:min],
|
79
|
-
parsed_time_fields[:sec]
|
80
|
-
) + Time.zone_offset(parsed_time_fields[:zone])
|
81
|
-
end
|
82
|
-
|
83
|
-
# Status of transaction. List of possible values:
|
84
|
-
# <tt>Canceled-Reversal</tt>::
|
85
|
-
# <tt>Completed</tt>::
|
86
|
-
# <tt>Denied</tt>::
|
87
|
-
# <tt>Expired</tt>::
|
88
|
-
# <tt>Failed</tt>::
|
89
|
-
# <tt>In-Progress</tt>::
|
90
|
-
# <tt>Partially-Refunded</tt>::
|
91
|
-
# <tt>Pending</tt>::
|
92
|
-
# <tt>Processed</tt>::
|
93
|
-
# <tt>Refunded</tt>::
|
94
|
-
# <tt>Reversed</tt>::
|
95
|
-
# <tt>Voided</tt>::
|
96
|
-
def status
|
97
|
-
params['payment_status']
|
98
|
-
end
|
99
|
-
|
100
|
-
# Id of this transaction (paypal number)
|
101
|
-
def transaction_id
|
102
|
-
params['txn_id']
|
103
|
-
end
|
104
|
-
|
105
|
-
# What type of transaction are we dealing with?
|
106
|
-
# "cart" "send_money" "web_accept" are possible here.
|
107
|
-
def type
|
108
|
-
params['txn_type']
|
109
|
-
end
|
110
|
-
|
111
|
-
# the money amount we received in X.2 decimal.
|
112
|
-
def gross
|
113
|
-
params['mc_gross']
|
114
|
-
end
|
115
|
-
|
116
|
-
# the markup paypal charges for the transaction
|
117
|
-
def fee
|
118
|
-
params['mc_fee']
|
119
|
-
end
|
120
|
-
|
121
|
-
# What currency have we been dealing with
|
122
|
-
def currency
|
123
|
-
params['mc_currency']
|
124
|
-
end
|
125
|
-
|
126
|
-
# This is the item number which we submitted to paypal
|
127
|
-
# The custom field is also mapped to item_id because PayPal
|
128
|
-
# doesn't return item_number in dispute notifications
|
129
|
-
def item_id
|
130
|
-
params['item_number'] || params['custom']
|
131
|
-
end
|
132
|
-
|
133
|
-
# This is the invoice which you passed to paypal
|
134
|
-
def invoice
|
135
|
-
params['invoice']
|
136
|
-
end
|
137
|
-
|
138
|
-
# Was this a test transaction?
|
139
|
-
def test?
|
140
|
-
params['test_ipn'] == '1'
|
141
|
-
end
|
142
|
-
|
143
|
-
def account
|
144
|
-
params['business'] || params['receiver_email']
|
145
|
-
end
|
146
|
-
|
147
|
-
# Acknowledge the transaction to paypal. This method has to be called after a new
|
148
|
-
# ipn arrives. Paypal will verify that all the information we received are correct and will return a
|
149
|
-
# ok or a fail.
|
150
|
-
#
|
151
|
-
# Example:
|
152
|
-
#
|
153
|
-
# def paypal_ipn
|
154
|
-
# notify = PaypalNotification.new(request.raw_post)
|
155
|
-
#
|
156
|
-
# if notify.acknowledge
|
157
|
-
# ... process order ... if notify.complete?
|
158
|
-
# else
|
159
|
-
# ... log possible hacking attempt ...
|
160
|
-
# end
|
161
|
-
def acknowledge
|
162
|
-
payload = raw
|
163
|
-
|
164
|
-
response = ssl_post(Paypal.service_url + '?cmd=_notify-validate', payload,
|
165
|
-
'Content-Length' => "#{payload.size}",
|
166
|
-
'User-Agent' => "Active Merchant -- http://activemerchant.org"
|
167
|
-
)
|
168
|
-
|
169
|
-
raise StandardError.new("Faulty paypal result: #{response}") unless ["VERIFIED", "INVALID"].include?(response)
|
170
|
-
|
171
|
-
response == "VERIFIED"
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
module MassPayNotification
|
176
|
-
# Mass pay returns a collection of MassPay Items, so inspect items to get the values
|
177
|
-
def transaction_id
|
178
|
-
end
|
179
|
-
|
180
|
-
# Mass pay returns a collection of MassPay Items, so inspect items to get the values
|
181
|
-
def gross
|
182
|
-
end
|
183
|
-
|
184
|
-
# Mass pay returns a collection of MassPay Items, so inspect items to get the values
|
185
|
-
def fee
|
186
|
-
end
|
187
|
-
|
188
|
-
# Mass pay returns a collection of MassPay Items, so inspect items to get the values
|
189
|
-
def currency
|
190
|
-
end
|
191
|
-
|
192
|
-
# Mass pay returns a collection of MassPay Items, so inspect items to get the values
|
193
|
-
def item_id
|
194
|
-
end
|
195
|
-
|
196
|
-
# Mass pay returns a collection of MassPay Items, so inspect items to get the values
|
197
|
-
def account
|
198
|
-
end
|
199
|
-
|
200
|
-
# Collection of notification items returned for MassPay transactions
|
201
|
-
def items
|
202
|
-
@items ||= (1..number_of_mass_pay_items).map do |item_number|
|
203
|
-
MassPayItem.new(
|
204
|
-
params["masspay_txn_id_#{item_number}"],
|
205
|
-
params["mc_gross_#{item_number}"],
|
206
|
-
params["mc_fee_#{item_number}"],
|
207
|
-
params["mc_currency_#{item_number}"],
|
208
|
-
params["unique_id_#{item_number}"],
|
209
|
-
params["receiver_email_#{item_number}"],
|
210
|
-
params["status_#{item_number}"]
|
211
|
-
)
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
private
|
216
|
-
|
217
|
-
def number_of_mass_pay_items
|
218
|
-
@number_of_mass_pay_items ||= params.keys.select { |k| k.start_with? 'masspay_txn_id' }.size
|
219
|
-
end
|
220
|
-
end
|
221
|
-
|
222
|
-
class MassPayItem < Struct.new(:transaction_id, :gross, :fee, :currency, :item_id, :account, :status)
|
223
|
-
end
|
224
|
-
end
|
225
|
-
end
|
226
|
-
end
|
227
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Paypal
|
5
|
-
autoload :Return, 'active_merchant/billing/integrations/paypal/return.rb'
|
6
|
-
autoload :Helper, 'active_merchant/billing/integrations/paypal/helper.rb'
|
7
|
-
autoload :Notification, 'active_merchant/billing/integrations/paypal/notification.rb'
|
8
|
-
|
9
|
-
# Overwrite this if you want to change the Paypal test url
|
10
|
-
mattr_accessor :test_url
|
11
|
-
self.test_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'
|
12
|
-
|
13
|
-
# Overwrite this if you want to change the Paypal production url
|
14
|
-
mattr_accessor :production_url
|
15
|
-
self.production_url = 'https://www.paypal.com/cgi-bin/webscr'
|
16
|
-
|
17
|
-
def self.service_url
|
18
|
-
mode = ActiveMerchant::Billing::Base.integration_mode
|
19
|
-
case mode
|
20
|
-
when :production
|
21
|
-
self.production_url
|
22
|
-
when :test
|
23
|
-
self.test_url
|
24
|
-
else
|
25
|
-
raise StandardError, "Integration mode set to an invalid value: #{mode}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.notification(post, options = {})
|
30
|
-
Notification.new(post)
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.return(query_string, options = {})
|
34
|
-
Return.new(query_string)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module ActiveMerchant
|
2
|
-
module Billing
|
3
|
-
module Integrations
|
4
|
-
module PaypalPaymentsAdvanced
|
5
|
-
class Helper < PayflowLink::Helper
|
6
|
-
|
7
|
-
def initialize(order, account, options)
|
8
|
-
super
|
9
|
-
add_field('partner', 'PayPal')
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module ActiveMerchant
|
2
|
-
module Billing
|
3
|
-
module Integrations
|
4
|
-
module PaypalPaymentsAdvanced
|
5
|
-
autoload :Helper, 'active_merchant/billing/integrations/paypal_payments_advanced/helper.rb'
|
6
|
-
|
7
|
-
mattr_accessor :service_url
|
8
|
-
self.service_url = 'https://payflowlink.paypal.com'
|
9
|
-
|
10
|
-
def self.notification(post, options = {})
|
11
|
-
PayflowLink::Notification.new(post)
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.return(query_string, options = {})
|
15
|
-
Return.new(query_string)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Paysbuy
|
5
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
-
mapping :account, 'biz'
|
7
|
-
mapping :amount, 'amt'
|
8
|
-
mapping :order, 'inv'
|
9
|
-
mapping :description, 'itm'
|
10
|
-
mapping :notify_url, 'postURL'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Paysbuy
|
5
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
6
|
-
SUCCESS = '00'
|
7
|
-
FAIL = '99'
|
8
|
-
|
9
|
-
def complete?
|
10
|
-
status == 'Completed'
|
11
|
-
end
|
12
|
-
|
13
|
-
def item_id
|
14
|
-
params['result'][2..-1]
|
15
|
-
end
|
16
|
-
|
17
|
-
def status
|
18
|
-
params['result'][0..1] == SUCCESS ? 'Completed' : 'Failed'
|
19
|
-
end
|
20
|
-
|
21
|
-
def acknowledge
|
22
|
-
true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Paysbuy
|
5
|
-
autoload :Helper, File.dirname(__FILE__) + '/paysbuy/helper.rb'
|
6
|
-
autoload :Notification, File.dirname(__FILE__) + '/paysbuy/notification.rb'
|
7
|
-
|
8
|
-
mattr_accessor :test_url
|
9
|
-
self.test_url = 'https://demo.paysbuy.com/paynow.aspx'
|
10
|
-
|
11
|
-
mattr_accessor :production_url
|
12
|
-
self.production_url = 'https://www.paysbuy.com/paynow.aspx'
|
13
|
-
|
14
|
-
def self.service_url
|
15
|
-
mode = ActiveMerchant::Billing::Base.integration_mode
|
16
|
-
case mode
|
17
|
-
when :production
|
18
|
-
self.production_url
|
19
|
-
when :test
|
20
|
-
self.test_url
|
21
|
-
else
|
22
|
-
raise StandardError, "Integration mode set to an invalid value: #{mode}"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.helper(order, account, options = {})
|
27
|
-
Helper.new(order, account, options)
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.notification(query_string, options = {})
|
31
|
-
Notification.new(query_string, options)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,74 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module PayuIn
|
5
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
-
|
7
|
-
mapping :amount, 'amount'
|
8
|
-
mapping :account, 'key'
|
9
|
-
mapping :order, 'txnid'
|
10
|
-
mapping :credential2, 'productinfo'
|
11
|
-
|
12
|
-
mapping :customer, :first_name => 'firstname',
|
13
|
-
:last_name => 'lastname',
|
14
|
-
:email => 'email',
|
15
|
-
:phone => 'phone'
|
16
|
-
|
17
|
-
mapping :billing_address, :city => 'city',
|
18
|
-
:address1 => 'address1',
|
19
|
-
:address2 => 'address2',
|
20
|
-
:state => 'state',
|
21
|
-
:zip => 'zip',
|
22
|
-
:country => 'country'
|
23
|
-
|
24
|
-
# Which tab you want to be open default on PayU
|
25
|
-
# CC (CreditCard) or NB (NetBanking)
|
26
|
-
mapping :mode, 'pg'
|
27
|
-
|
28
|
-
mapping :notify_url, 'notify_url'
|
29
|
-
mapping :return_url, ['surl', 'furl']
|
30
|
-
mapping :cancel_return_url, 'curl'
|
31
|
-
mapping :checksum, 'hash'
|
32
|
-
|
33
|
-
mapping :user_defined, { :var1 => 'udf1',
|
34
|
-
:var2 => 'udf2',
|
35
|
-
:var3 => 'udf3',
|
36
|
-
:var4 => 'udf4',
|
37
|
-
:var5 => 'udf5',
|
38
|
-
:var6 => 'udf6',
|
39
|
-
:var7 => 'udf7',
|
40
|
-
:var8 => 'udf8',
|
41
|
-
:var9 => 'udf9',
|
42
|
-
:var10 => 'udf10'
|
43
|
-
}
|
44
|
-
|
45
|
-
def initialize(order, account, options = {})
|
46
|
-
super
|
47
|
-
self.pg = 'CC'
|
48
|
-
end
|
49
|
-
|
50
|
-
def form_fields
|
51
|
-
@fields.merge(mappings[:checksum] => generate_checksum)
|
52
|
-
end
|
53
|
-
|
54
|
-
def generate_checksum( options = {} )
|
55
|
-
checksum_fields = [ :order, :amount, :credential2, { :customer => [ :first_name, :email ] },
|
56
|
-
{ :user_defined => [ :var1, :var2, :var3, :var4, :var5, :var6, :var7, :var8, :var9, :var10 ] } ]
|
57
|
-
checksum_payload_items = checksum_fields.inject( [] ) do | items, field |
|
58
|
-
if Hash === field then
|
59
|
-
key = field.keys.first
|
60
|
-
field[key].inject( items ){ |s,x| items.push( @fields[ mappings[key][x] ] ) }
|
61
|
-
else
|
62
|
-
items.push( @fields[ mappings[field] ] )
|
63
|
-
end
|
64
|
-
end
|
65
|
-
checksum_payload_items.push( options )
|
66
|
-
PayuIn.checksum(@fields["key"], @fields["productinfo"], *checksum_payload_items )
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,165 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module PayuIn
|
5
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
6
|
-
|
7
|
-
def initialize(post, options = {})
|
8
|
-
super(post, options)
|
9
|
-
@merchant_id = options[:credential1]
|
10
|
-
@secret_key = options[:credential2]
|
11
|
-
end
|
12
|
-
|
13
|
-
def complete?
|
14
|
-
status == "Completed"
|
15
|
-
end
|
16
|
-
|
17
|
-
def status
|
18
|
-
@status ||= if checksum_ok?
|
19
|
-
if transaction_id.blank?
|
20
|
-
'Invalid'
|
21
|
-
else
|
22
|
-
case transaction_status.downcase
|
23
|
-
when 'success' then 'Completed'
|
24
|
-
when 'failure' then 'Failed'
|
25
|
-
when 'pending' then 'Pending'
|
26
|
-
end
|
27
|
-
end
|
28
|
-
else
|
29
|
-
'Tampered'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def invoice_ok?( order_id )
|
34
|
-
order_id.to_s == invoice.to_s
|
35
|
-
end
|
36
|
-
|
37
|
-
# Order amount should be equal to gross - discount
|
38
|
-
def amount_ok?( order_amount, order_discount = BigDecimal.new( '0.0' ) )
|
39
|
-
BigDecimal.new( gross ) == order_amount && BigDecimal.new( discount ) == order_discount
|
40
|
-
end
|
41
|
-
|
42
|
-
# Status of transaction return from the PayU. List of possible values:
|
43
|
-
# <tt>SUCCESS</tt>::
|
44
|
-
# <tt>PENDING</tt>::
|
45
|
-
# <tt>FAILURE</tt>::
|
46
|
-
def transaction_status
|
47
|
-
params['status']
|
48
|
-
end
|
49
|
-
|
50
|
-
# ID of this transaction (PayU.in number)
|
51
|
-
def transaction_id
|
52
|
-
params['mihpayid']
|
53
|
-
end
|
54
|
-
|
55
|
-
# Mode of Payment
|
56
|
-
#
|
57
|
-
# 'CC' for credit-card
|
58
|
-
# 'NB' for net-banking
|
59
|
-
# 'CD' for cheque or DD
|
60
|
-
# 'CO' for Cash Pickup
|
61
|
-
def type
|
62
|
-
params['mode']
|
63
|
-
end
|
64
|
-
|
65
|
-
# What currency have we been dealing with
|
66
|
-
def currency
|
67
|
-
'INR'
|
68
|
-
end
|
69
|
-
|
70
|
-
def item_id
|
71
|
-
params['txnid']
|
72
|
-
end
|
73
|
-
|
74
|
-
# This is the invoice which you passed to PayU.in
|
75
|
-
def invoice
|
76
|
-
params['txnid']
|
77
|
-
end
|
78
|
-
|
79
|
-
# Merchant Id provided by the PayU.in
|
80
|
-
def account
|
81
|
-
params['key']
|
82
|
-
end
|
83
|
-
|
84
|
-
# original amount send by merchant
|
85
|
-
def gross
|
86
|
-
params['amount']
|
87
|
-
end
|
88
|
-
|
89
|
-
# This is discount given to user - based on promotion set by merchants.
|
90
|
-
def discount
|
91
|
-
params['discount']
|
92
|
-
end
|
93
|
-
|
94
|
-
# Description offer for what PayU given the offer to user - based on promotion set by merchants.
|
95
|
-
def offer_description
|
96
|
-
params['offer']
|
97
|
-
end
|
98
|
-
|
99
|
-
# Information about the product as send by merchant
|
100
|
-
def product_info
|
101
|
-
params['productinfo']
|
102
|
-
end
|
103
|
-
|
104
|
-
# Email of the customer
|
105
|
-
def customer_email
|
106
|
-
params['email']
|
107
|
-
end
|
108
|
-
|
109
|
-
# Phone of the customer
|
110
|
-
def customer_phone
|
111
|
-
params['phone']
|
112
|
-
end
|
113
|
-
|
114
|
-
# Firstname of the customer
|
115
|
-
def customer_first_name
|
116
|
-
params['firstname']
|
117
|
-
end
|
118
|
-
|
119
|
-
# Lastname of the customer
|
120
|
-
def customer_last_name
|
121
|
-
params['lastname']
|
122
|
-
end
|
123
|
-
|
124
|
-
# Full address of the customer
|
125
|
-
def customer_address
|
126
|
-
{ :address1 => params['address1'], :address2 => params['address2'],
|
127
|
-
:city => params['city'], :state => params['state'],
|
128
|
-
:country => params['country'], :zipcode => params['zipcode'] }
|
129
|
-
end
|
130
|
-
|
131
|
-
def user_defined
|
132
|
-
return @user_defined if @user_defined
|
133
|
-
@user_defined = []
|
134
|
-
10.times{ |i| @user_defined.push( params[ "udf#{i+1}" ] ) }
|
135
|
-
@user_defined
|
136
|
-
end
|
137
|
-
|
138
|
-
def checksum
|
139
|
-
params['hash']
|
140
|
-
end
|
141
|
-
|
142
|
-
def message
|
143
|
-
@message || params['error']
|
144
|
-
end
|
145
|
-
|
146
|
-
def acknowledge
|
147
|
-
checksum_ok?
|
148
|
-
end
|
149
|
-
|
150
|
-
def checksum_ok?
|
151
|
-
fields = user_defined.dup.push( customer_email, customer_first_name, product_info, gross, invoice, :reverse => true )
|
152
|
-
fields.unshift( transaction_status )
|
153
|
-
unless PayuIn.checksum(@merchant_id, @secret_key, *fields ) == checksum
|
154
|
-
@message = 'Return checksum not matching the data provided'
|
155
|
-
return false
|
156
|
-
end
|
157
|
-
true
|
158
|
-
end
|
159
|
-
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module PayuIn
|
5
|
-
class Return < ActiveMerchant::Billing::Integrations::Return
|
6
|
-
|
7
|
-
def initialize(query_string, options = {})
|
8
|
-
super
|
9
|
-
@notification = Notification.new(query_string, options)
|
10
|
-
end
|
11
|
-
|
12
|
-
def transaction_id
|
13
|
-
@notification.transaction_id
|
14
|
-
end
|
15
|
-
|
16
|
-
def status( order_id, order_amount )
|
17
|
-
if @notification.invoice_ok?( order_id ) && @notification.amount_ok?( BigDecimal.new(order_amount) )
|
18
|
-
@notification.status
|
19
|
-
else
|
20
|
-
'Mismatch'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def success?
|
25
|
-
status( @params['txnid'], @params['amount'] ) == 'Completed'
|
26
|
-
end
|
27
|
-
|
28
|
-
def message
|
29
|
-
@notification.message
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|