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,137 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
module Integrations #:nodoc:
|
6
|
-
module Quickpay
|
7
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
8
|
-
def complete?
|
9
|
-
status == '000'
|
10
|
-
end
|
11
|
-
|
12
|
-
def item_id
|
13
|
-
params['ordernumber']
|
14
|
-
end
|
15
|
-
|
16
|
-
def transaction_id
|
17
|
-
params['transaction']
|
18
|
-
end
|
19
|
-
|
20
|
-
def received_at
|
21
|
-
time = params['time']
|
22
|
-
# If time only contains 12 integers then it's pre v5 format
|
23
|
-
time = "20#{params['time']}" if /[0-9]{12}/.match(params['time'])
|
24
|
-
Time.parse(time)
|
25
|
-
end
|
26
|
-
|
27
|
-
def gross
|
28
|
-
"%.2f" % (gross_cents / 100.0)
|
29
|
-
end
|
30
|
-
|
31
|
-
def gross_cents
|
32
|
-
params['amount'].to_i
|
33
|
-
end
|
34
|
-
|
35
|
-
def status
|
36
|
-
params['qpstat']
|
37
|
-
end
|
38
|
-
|
39
|
-
def currency
|
40
|
-
params['currency']
|
41
|
-
end
|
42
|
-
|
43
|
-
# Provide access to raw fields from quickpay
|
44
|
-
%w(
|
45
|
-
msgtype
|
46
|
-
ordernumber
|
47
|
-
state
|
48
|
-
chstat
|
49
|
-
chstatmsg
|
50
|
-
qpstat
|
51
|
-
qpstatmsg
|
52
|
-
merchant
|
53
|
-
merchantemail
|
54
|
-
cardtype
|
55
|
-
cardnumber
|
56
|
-
cardhash
|
57
|
-
cardexpire
|
58
|
-
splitpayment
|
59
|
-
fraudprobability
|
60
|
-
fraudremarks
|
61
|
-
fraudreport
|
62
|
-
fee
|
63
|
-
).each do |attr|
|
64
|
-
define_method(attr) do
|
65
|
-
params[attr]
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
MD5_CHECK_FIELDS = [
|
70
|
-
:msgtype,
|
71
|
-
:ordernumber,
|
72
|
-
:amount,
|
73
|
-
:currency,
|
74
|
-
:time,
|
75
|
-
:state,
|
76
|
-
:qpstat,
|
77
|
-
:qpstatmsg,
|
78
|
-
:chstat,
|
79
|
-
:chstatmsg,
|
80
|
-
:merchant,
|
81
|
-
:merchantemail,
|
82
|
-
:transaction,
|
83
|
-
:cardtype,
|
84
|
-
:cardnumber,
|
85
|
-
:cardhash,
|
86
|
-
:cardexpire,
|
87
|
-
:splitpayment,
|
88
|
-
:fraudprobability,
|
89
|
-
:fraudremarks,
|
90
|
-
:fraudreport,
|
91
|
-
:fee
|
92
|
-
]
|
93
|
-
|
94
|
-
def generate_md5string
|
95
|
-
MD5_CHECK_FIELDS.map { |key| params[key.to_s] } * "" + @options[:credential2].to_s
|
96
|
-
end
|
97
|
-
|
98
|
-
def generate_md5check
|
99
|
-
Digest::MD5.hexdigest(generate_md5string)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Quickpay doesn't do acknowledgements of callback notifications
|
103
|
-
# Instead it uses and MD5 hash of all parameters
|
104
|
-
def acknowledge
|
105
|
-
generate_md5check == params['md5check']
|
106
|
-
end
|
107
|
-
|
108
|
-
# Take the posted data and move the relevant data into a hash
|
109
|
-
def parse(post)
|
110
|
-
# 30 + 12
|
111
|
-
#------------------------------8a827a0e6829
|
112
|
-
#Content-Disposition: form-data; name="msgtype"
|
113
|
-
#
|
114
|
-
#subscribe
|
115
|
-
#------------------------------8a827a0e6829
|
116
|
-
#Content-Disposition: form-data; name="ordernumber"
|
117
|
-
#
|
118
|
-
#BILP94406
|
119
|
-
|
120
|
-
if post =~ /-{20,40}\w{6,24}/
|
121
|
-
@raw = post.to_s
|
122
|
-
post.split(/-{20,40}\w{6,24}[\n\r]*/m).each do |part|
|
123
|
-
part.scan(/([^\n\r]+)[\n\r]+([^\n\r]*)/m) do |header, value|
|
124
|
-
if header.match(/name=["'](.*)["']/)
|
125
|
-
params[$1] = value.strip
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
else
|
130
|
-
super
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Quickpay
|
5
|
-
autoload :Helper, File.dirname(__FILE__) + '/quickpay/helper.rb'
|
6
|
-
autoload :Notification, File.dirname(__FILE__) + '/quickpay/notification.rb'
|
7
|
-
|
8
|
-
mattr_accessor :service_url
|
9
|
-
self.service_url = 'https://secure.quickpay.dk/form/'
|
10
|
-
|
11
|
-
def self.notification(post, options = {})
|
12
|
-
Notification.new(post)
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.return(post, options = {})
|
16
|
-
Return.new(post, options)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Rbkmoney
|
5
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
-
mapping :account, 'eshopId'
|
7
|
-
mapping :amount, 'recipientAmount'
|
8
|
-
|
9
|
-
# NOTE: rbkmoney uses outdated currency code 'RUR'
|
10
|
-
mapping :currency, 'recipientCurrency'
|
11
|
-
|
12
|
-
mapping :order, 'orderId'
|
13
|
-
|
14
|
-
mapping :customer, :email => 'user_email'
|
15
|
-
|
16
|
-
mapping :credential2, 'serviceName'
|
17
|
-
mapping :credential3, 'successUrl'
|
18
|
-
mapping :credential4, 'failUrl'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
module Integrations #:nodoc:
|
6
|
-
module Rbkmoney
|
7
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
8
|
-
%w(
|
9
|
-
eshopId
|
10
|
-
paymentId
|
11
|
-
orderId
|
12
|
-
eshopAccount
|
13
|
-
serviceName
|
14
|
-
recipientAmount
|
15
|
-
recipientCurrency
|
16
|
-
paymentStatus
|
17
|
-
userName
|
18
|
-
userEmail
|
19
|
-
paymentData
|
20
|
-
secretKey
|
21
|
-
hash
|
22
|
-
).each do |param_name|
|
23
|
-
define_method(param_name.underscore){ params[param_name] }
|
24
|
-
end
|
25
|
-
|
26
|
-
def complete?
|
27
|
-
(payment_status == '5')
|
28
|
-
end
|
29
|
-
|
30
|
-
def test?
|
31
|
-
false
|
32
|
-
end
|
33
|
-
|
34
|
-
def status
|
35
|
-
case payment_status
|
36
|
-
when '3'
|
37
|
-
'pending'
|
38
|
-
when '5'
|
39
|
-
'completed'
|
40
|
-
else 'unknown'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def user_fields
|
45
|
-
params.inject({}) do |fields, (k,v)|
|
46
|
-
if /\AuserField_[\d+]\z/.match(k)
|
47
|
-
fields[k] = v
|
48
|
-
end
|
49
|
-
fields
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
alias_method :client_id, :eshop_id
|
54
|
-
alias_method :item_id, :order_id
|
55
|
-
alias_method :transaction_id, :payment_id
|
56
|
-
alias_method :received_at, :payment_data
|
57
|
-
alias_method :payer_email, :user_email
|
58
|
-
alias_method :gross, :recipient_amount
|
59
|
-
alias_method :currency, :recipient_currency
|
60
|
-
|
61
|
-
def acknowledge
|
62
|
-
string = [
|
63
|
-
eshop_id,
|
64
|
-
order_id,
|
65
|
-
service_name,
|
66
|
-
eshop_account,
|
67
|
-
recipient_amount,
|
68
|
-
recipient_currency,
|
69
|
-
payment_status,
|
70
|
-
user_name,
|
71
|
-
user_email,
|
72
|
-
payment_data,
|
73
|
-
@options[:secret]
|
74
|
-
].join '::'
|
75
|
-
|
76
|
-
signature = case hash.to_s.length
|
77
|
-
when 32
|
78
|
-
Digest::MD5.hexdigest(string)
|
79
|
-
when 128
|
80
|
-
Digest::SHA512.hexdigest(string)
|
81
|
-
else
|
82
|
-
return false
|
83
|
-
end
|
84
|
-
|
85
|
-
signature == hash
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/rbkmoney/helper.rb'
|
2
|
-
require File.dirname(__FILE__) + '/rbkmoney/notification.rb'
|
3
|
-
|
4
|
-
module ActiveMerchant #:nodoc:
|
5
|
-
module Billing #:nodoc:
|
6
|
-
module Integrations #:nodoc:
|
7
|
-
module Rbkmoney
|
8
|
-
mattr_accessor :service_url
|
9
|
-
self.service_url = 'https://rbkmoney.ru/acceptpurchase.aspx'
|
10
|
-
|
11
|
-
def self.notification(*args)
|
12
|
-
Notification.new(*args)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
class Return
|
5
|
-
attr_accessor :params
|
6
|
-
attr_reader :notification
|
7
|
-
|
8
|
-
def initialize(query_string, options = {})
|
9
|
-
@params = parse(query_string)
|
10
|
-
@options = options
|
11
|
-
end
|
12
|
-
|
13
|
-
# Successful by default. Overridden in the child class
|
14
|
-
def success?
|
15
|
-
true
|
16
|
-
end
|
17
|
-
|
18
|
-
# Not cancelled by default. Overridden in the child class.
|
19
|
-
def cancelled?
|
20
|
-
false
|
21
|
-
end
|
22
|
-
|
23
|
-
def message
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
def parse(query_string)
|
28
|
-
return {} if query_string.blank?
|
29
|
-
|
30
|
-
query_string.split('&').inject({}) do |memo, chunk|
|
31
|
-
next if chunk.empty?
|
32
|
-
key, value = chunk.split('=', 2)
|
33
|
-
next if key.empty?
|
34
|
-
value = value.nil? ? nil : CGI.unescape(value)
|
35
|
-
memo[CGI.unescape(key)] = value
|
36
|
-
memo
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Robokassa
|
5
|
-
module Common
|
6
|
-
def generate_signature_string
|
7
|
-
custom_param_keys = params.keys.select {|key| key =~ /^shp/}.sort
|
8
|
-
custom_params = custom_param_keys.map {|key| "#{key}=#{params[key]}"}
|
9
|
-
[main_params, secret, custom_params.compact].flatten.join(':')
|
10
|
-
end
|
11
|
-
|
12
|
-
def generate_signature
|
13
|
-
Digest::MD5.hexdigest(generate_signature_string)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Robokassa
|
5
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
-
include Common
|
7
|
-
|
8
|
-
def initialize(order, account, options = {})
|
9
|
-
@md5secret = options.delete(:secret)
|
10
|
-
super
|
11
|
-
end
|
12
|
-
|
13
|
-
def form_fields
|
14
|
-
@fields.merge(ActiveMerchant::Billing::Integrations::Robokassa.signature_parameter_name => generate_signature)
|
15
|
-
end
|
16
|
-
|
17
|
-
def main_params
|
18
|
-
[:account, :amount, :order].map {|key| @fields[mappings[key]]}
|
19
|
-
end
|
20
|
-
|
21
|
-
def params
|
22
|
-
@fields
|
23
|
-
end
|
24
|
-
|
25
|
-
def secret
|
26
|
-
@md5secret
|
27
|
-
end
|
28
|
-
|
29
|
-
def method_missing(method_id, *args)
|
30
|
-
method_id = method_id.to_s.gsub(/=$/, '')
|
31
|
-
|
32
|
-
# support for robokassa custom parameters
|
33
|
-
if method_id =~ /^shp/
|
34
|
-
add_field method_id, args.last
|
35
|
-
end
|
36
|
-
|
37
|
-
super
|
38
|
-
end
|
39
|
-
|
40
|
-
mapping :account, 'MrchLogin'
|
41
|
-
mapping :amount, 'OutSum'
|
42
|
-
mapping :currency, 'IncCurrLabel'
|
43
|
-
mapping :order, 'InvId'
|
44
|
-
mapping :description, 'Desc'
|
45
|
-
mapping :email, 'Email'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Robokassa
|
5
|
-
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
6
|
-
include Common
|
7
|
-
|
8
|
-
def self.recognizes?(params)
|
9
|
-
params.has_key?('InvId') && params.has_key?('OutSum')
|
10
|
-
end
|
11
|
-
|
12
|
-
def complete?
|
13
|
-
true
|
14
|
-
end
|
15
|
-
|
16
|
-
def amount
|
17
|
-
BigDecimal.new(gross)
|
18
|
-
end
|
19
|
-
|
20
|
-
def item_id
|
21
|
-
params['InvId']
|
22
|
-
end
|
23
|
-
|
24
|
-
def security_key
|
25
|
-
params[ActiveMerchant::Billing::Integrations::Robokassa.signature_parameter_name].to_s.downcase
|
26
|
-
end
|
27
|
-
|
28
|
-
def gross
|
29
|
-
params['OutSum']
|
30
|
-
end
|
31
|
-
|
32
|
-
def status
|
33
|
-
'success'
|
34
|
-
end
|
35
|
-
|
36
|
-
def secret
|
37
|
-
@options[:secret]
|
38
|
-
end
|
39
|
-
|
40
|
-
def main_params
|
41
|
-
[gross, item_id]
|
42
|
-
end
|
43
|
-
|
44
|
-
def acknowledge
|
45
|
-
security_key == generate_signature
|
46
|
-
end
|
47
|
-
|
48
|
-
def success_response(*args)
|
49
|
-
"OK#{item_id}"
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module Robokassa
|
5
|
-
class Return < ActiveMerchant::Billing::Integrations::Return
|
6
|
-
def item_id
|
7
|
-
@params['InvId']
|
8
|
-
end
|
9
|
-
|
10
|
-
def amount
|
11
|
-
@params['OutSum']
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
|
5
|
-
# Documentation: http://robokassa.ru/Doc/En/Interface.aspx
|
6
|
-
module Robokassa
|
7
|
-
autoload :Helper, File.dirname(__FILE__) + '/robokassa/helper.rb'
|
8
|
-
autoload :Notification, File.dirname(__FILE__) + '/robokassa/notification.rb'
|
9
|
-
autoload :Return, File.dirname(__FILE__) + '/robokassa/return.rb'
|
10
|
-
autoload :Common, File.dirname(__FILE__) + '/robokassa/common.rb'
|
11
|
-
|
12
|
-
# Overwrite this if you want to change the Robokassa test url
|
13
|
-
mattr_accessor :test_url
|
14
|
-
self.test_url = 'http://test.robokassa.ru/Index.aspx'
|
15
|
-
|
16
|
-
# Overwrite this if you want to change the Robokassa production url
|
17
|
-
mattr_accessor :production_url
|
18
|
-
self.production_url = 'https://merchant.roboxchange.com/Index.aspx'
|
19
|
-
|
20
|
-
mattr_accessor :signature_parameter_name
|
21
|
-
self.signature_parameter_name = 'SignatureValue'
|
22
|
-
|
23
|
-
def self.service_url
|
24
|
-
mode = ActiveMerchant::Billing::Base.integration_mode
|
25
|
-
case mode
|
26
|
-
when :production
|
27
|
-
self.production_url
|
28
|
-
when :test
|
29
|
-
self.test_url
|
30
|
-
else
|
31
|
-
raise StandardError, "Integration mode set to an invalid value: #{mode}"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.helper(order, account, options = {})
|
36
|
-
Helper.new(order, account, options)
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.notification(query_string, options = {})
|
40
|
-
Notification.new(query_string, options)
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.return(query_string)
|
44
|
-
Return.new(query_string)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
module Integrations #:nodoc:
|
4
|
-
module SagePayForm
|
5
|
-
module Encryption
|
6
|
-
def sage_encrypt(plaintext, key)
|
7
|
-
Base64.strict_encode64(sage_encrypt_xor(plaintext, key))
|
8
|
-
end
|
9
|
-
|
10
|
-
def sage_decrypt(ciphertext, key)
|
11
|
-
sage_encrypt_xor(Base64.decode64(ciphertext), key)
|
12
|
-
end
|
13
|
-
|
14
|
-
def sage_encrypt_salt(min, max)
|
15
|
-
length = rand(max - min + 1) + min
|
16
|
-
SecureRandom.base64(length + 4)[0, length]
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def sage_encrypt_xor(data, key)
|
22
|
-
raise 'No key provided' if key.blank?
|
23
|
-
|
24
|
-
key *= (data.bytesize.to_f / key.bytesize.to_f).ceil
|
25
|
-
key = key[0, data.bytesize]
|
26
|
-
|
27
|
-
data.bytes.zip(key.bytes).map { |b1, b2| (b1 ^ b2).chr }.join
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,136 +0,0 @@
|
|
1
|
-
require 'uri'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
module Integrations #:nodoc:
|
6
|
-
module SagePayForm
|
7
|
-
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
8
|
-
include Encryption
|
9
|
-
|
10
|
-
mapping :credential2, 'EncryptKey'
|
11
|
-
|
12
|
-
mapping :account, 'Vendor'
|
13
|
-
mapping :amount, 'Amount'
|
14
|
-
mapping :currency, 'Currency'
|
15
|
-
|
16
|
-
mapping :order, 'VendorTxCode'
|
17
|
-
|
18
|
-
mapping :customer,
|
19
|
-
:first_name => 'BillingFirstnames',
|
20
|
-
:last_name => 'BillingSurname',
|
21
|
-
:email => 'CustomerEMail',
|
22
|
-
:phone => 'BillingPhone',
|
23
|
-
:send_email_confirmation => 'SendEmail'
|
24
|
-
|
25
|
-
mapping :billing_address,
|
26
|
-
:city => 'BillingCity',
|
27
|
-
:address1 => 'BillingAddress1',
|
28
|
-
:address2 => 'BillingAddress2',
|
29
|
-
:state => 'BillingState',
|
30
|
-
:zip => 'BillingPostCode',
|
31
|
-
:country => 'BillingCountry'
|
32
|
-
|
33
|
-
mapping :shipping_address,
|
34
|
-
:city => 'DeliveryCity',
|
35
|
-
:address1 => 'DeliveryAddress1',
|
36
|
-
:address2 => 'DeliveryAddress2',
|
37
|
-
:state => 'DeliveryState',
|
38
|
-
:zip => 'DeliveryPostCode',
|
39
|
-
:country => 'DeliveryCountry'
|
40
|
-
|
41
|
-
mapping :return_url, 'SuccessURL'
|
42
|
-
mapping :description, 'Description'
|
43
|
-
|
44
|
-
class_attribute :referrer_id
|
45
|
-
|
46
|
-
def shipping_address(params = {})
|
47
|
-
@shipping_address_set = true unless params.empty?
|
48
|
-
|
49
|
-
params.each do |k, v|
|
50
|
-
field = mappings[:shipping_address][k]
|
51
|
-
add_field(field, v) unless field.nil?
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def map_billing_address_to_shipping_address
|
56
|
-
%w(City Address1 Address2 State PostCode Country).each do |field|
|
57
|
-
fields["Delivery#{field}"] = fields["Billing#{field}"]
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def form_fields
|
62
|
-
map_billing_address_to_shipping_address unless @shipping_address_set
|
63
|
-
|
64
|
-
fields['DeliveryFirstnames'] ||= fields['BillingFirstnames']
|
65
|
-
fields['DeliverySurname'] ||= fields['BillingSurname']
|
66
|
-
|
67
|
-
fields['FailureURL'] ||= fields['SuccessURL']
|
68
|
-
|
69
|
-
fields['BillingPostCode'] ||= "0000"
|
70
|
-
fields['DeliveryPostCode'] ||= "0000"
|
71
|
-
|
72
|
-
crypt_skip = ['Vendor', 'EncryptKey', 'SendEmail']
|
73
|
-
crypt_skip << 'BillingState' unless fields['BillingCountry'] == 'US'
|
74
|
-
crypt_skip << 'DeliveryState' unless fields['DeliveryCountry'] == 'US'
|
75
|
-
crypt_skip << 'CustomerEMail' unless fields['SendEmail']
|
76
|
-
key = fields['EncryptKey']
|
77
|
-
@crypt ||= create_crypt_field(fields.except(*crypt_skip), key)
|
78
|
-
|
79
|
-
result = {
|
80
|
-
'VPSProtocol' => '2.23',
|
81
|
-
'TxType' => 'PAYMENT',
|
82
|
-
'Vendor' => @fields['Vendor'],
|
83
|
-
'Crypt' => @crypt
|
84
|
-
}
|
85
|
-
result['ReferrerID'] = referrer_id if referrer_id
|
86
|
-
result
|
87
|
-
end
|
88
|
-
|
89
|
-
private
|
90
|
-
|
91
|
-
def create_crypt_field(fields, key)
|
92
|
-
parts = fields.map { |k, v| "#{k}=#{sanitize(k, v)}" unless v.nil? }.compact.shuffle
|
93
|
-
parts.unshift(sage_encrypt_salt(key.length, key.length * 2))
|
94
|
-
sage_encrypt(parts.join('&'), key)
|
95
|
-
end
|
96
|
-
|
97
|
-
def sanitize(key, value)
|
98
|
-
reject = exact = nil
|
99
|
-
|
100
|
-
case key
|
101
|
-
when /URL$/
|
102
|
-
# allow all
|
103
|
-
when 'VendorTxCode'
|
104
|
-
reject = /[^A-Za-z0-9{}._-]+/
|
105
|
-
when /[Nn]ames?$/
|
106
|
-
reject = %r{[^[:alpha:] /\\.'-]+}
|
107
|
-
when /(?:Address[12]|City)$/
|
108
|
-
reject = %r{[^[:alnum:] +'/\\:,.\n()-]+}
|
109
|
-
when /PostCode$/
|
110
|
-
reject = /[^A-Za-z0-9 -]+/
|
111
|
-
when /Phone$/
|
112
|
-
reject = /[^0-9A-Za-z+ ()-]+/
|
113
|
-
when 'Currency'
|
114
|
-
exact = /^[A-Z]{3}$/
|
115
|
-
when /State$/
|
116
|
-
exact = /^[A-Z]{2}$/
|
117
|
-
when 'Description'
|
118
|
-
value = value[0...100]
|
119
|
-
else
|
120
|
-
reject = /&+/
|
121
|
-
end
|
122
|
-
|
123
|
-
if exact
|
124
|
-
raise ArgumentError, "Invalid value for #{key}: #{value.inspect}" unless value =~ exact
|
125
|
-
value
|
126
|
-
elsif reject
|
127
|
-
value.gsub(reject, ' ')
|
128
|
-
else
|
129
|
-
value
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|