tanga_activemerchant 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1202 -0
- data/CONTRIBUTORS +414 -0
- data/MIT-LICENSE +20 -0
- data/README.md +221 -0
- data/gem-public_cert.pem +20 -0
- data/lib/active_merchant/billing/avs_result.rb +98 -0
- data/lib/active_merchant/billing/base.rb +57 -0
- data/lib/active_merchant/billing/check.rb +69 -0
- data/lib/active_merchant/billing/credit_card.rb +283 -0
- data/lib/active_merchant/billing/credit_card_formatting.rb +21 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +143 -0
- data/lib/active_merchant/billing/cvv_result.rb +38 -0
- data/lib/active_merchant/billing/expiry_date.rb +34 -0
- data/lib/active_merchant/billing/gateway.rb +181 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +725 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +956 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +468 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +105 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +314 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +15 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +393 -0
- data/lib/active_merchant/billing/gateways/beanstream.rb +169 -0
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +54 -0
- data/lib/active_merchant/billing/gateways/blue_pay.rb +501 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +142 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +19 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +401 -0
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +19 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +23 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +225 -0
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +156 -0
- data/lib/active_merchant/billing/gateways/certo_direct.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +639 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +591 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +230 -0
- data/lib/active_merchant/billing/gateways/elavon.rb +312 -0
- data/lib/active_merchant/billing/gateways/epay.rb +275 -0
- data/lib/active_merchant/billing/gateways/evo_ca.rb +308 -0
- data/lib/active_merchant/billing/gateways/eway.rb +225 -0
- data/lib/active_merchant/billing/gateways/eway_managed.rb +291 -0
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +320 -0
- data/lib/active_merchant/billing/gateways/exact.rb +218 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +173 -0
- data/lib/active_merchant/billing/gateways/federated_canada.rb +167 -0
- data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +176 -0
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +314 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +257 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +207 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +35 -0
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +249 -0
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +13 -0
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +29 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +66 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +221 -0
- data/lib/active_merchant/billing/gateways/instapay.rb +163 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +262 -0
- data/lib/active_merchant/billing/gateways/itransact.rb +448 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +275 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +447 -0
- data/lib/active_merchant/billing/gateways/litle.rb +554 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +176 -0
- data/lib/active_merchant/billing/gateways/merchant_one.rb +115 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +322 -0
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +275 -0
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +191 -0
- data/lib/active_merchant/billing/gateways/mercury.rb +311 -0
- data/lib/active_merchant/billing/gateways/metrics_global.rb +322 -0
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
- data/lib/active_merchant/billing/gateways/migs.rb +265 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +37 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +219 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +244 -0
- data/lib/active_merchant/billing/gateways/moneris_us.rb +208 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +277 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +193 -0
- data/lib/active_merchant/billing/gateways/netaxept.rb +181 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +197 -0
- data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +20 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +421 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +297 -0
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +93 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +46 -0
- data/lib/active_merchant/billing/gateways/orbital.rb +633 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +261 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +396 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +119 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +196 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +209 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +39 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +13 -0
- data/lib/active_merchant/billing/gateways/payflow.rb +268 -0
- data/lib/active_merchant/billing/gateways/payflow_express.rb +224 -0
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +15 -0
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +21 -0
- data/lib/active_merchant/billing/gateways/payment_express.rb +353 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +179 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +670 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +61 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +248 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +106 -0
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +43 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +239 -0
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +30 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +199 -0
- data/lib/active_merchant/billing/gateways/payway.rb +207 -0
- data/lib/active_merchant/billing/gateways/pin.rb +165 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +294 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +227 -0
- data/lib/active_merchant/billing/gateways/psl_card.rb +303 -0
- data/lib/active_merchant/billing/gateways/qbms.rb +292 -0
- data/lib/active_merchant/billing/gateways/quantum.rb +276 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +335 -0
- data/lib/active_merchant/billing/gateways/realex.rb +303 -0
- data/lib/active_merchant/billing/gateways/redsys.rb +394 -0
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +93 -0
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +114 -0
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +102 -0
- data/lib/active_merchant/billing/gateways/sage.rb +152 -0
- data/lib/active_merchant/billing/gateways/sage_pay.rb +324 -0
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +143 -0
- data/lib/active_merchant/billing/gateways/samurai.rb +118 -0
- data/lib/active_merchant/billing/gateways/secure_net.rb +261 -0
- data/lib/active_merchant/billing/gateways/secure_pay.rb +28 -0
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +279 -0
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +112 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +453 -0
- data/lib/active_merchant/billing/gateways/smart_ps.rb +272 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +233 -0
- data/lib/active_merchant/billing/gateways/stripe.rb +316 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +126 -0
- data/lib/active_merchant/billing/gateways/transax.rb +23 -0
- data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +421 -0
- data/lib/active_merchant/billing/gateways/usa_epay.rb +25 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +1501 -0
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +201 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +232 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +189 -0
- data/lib/active_merchant/billing/gateways/vindicia.rb +361 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +57 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +313 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +303 -0
- data/lib/active_merchant/billing/gateways.rb +17 -0
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +31 -0
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +186 -0
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +38 -0
- data/lib/active_merchant/billing/integrations/a1agregator.rb +26 -0
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +73 -0
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +229 -0
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +340 -0
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +38 -0
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +17 -0
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +11 -0
- data/lib/active_merchant/billing/integrations/bogus/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/bogus.rb +23 -0
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +120 -0
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +158 -0
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/chronopay.rb +23 -0
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +200 -0
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +76 -0
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +32 -0
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +37 -0
- data/lib/active_merchant/billing/integrations/direc_pay.rb +41 -0
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +90 -0
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +120 -0
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +11 -0
- data/lib/active_merchant/billing/integrations/directebanking.rb +47 -0
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +77 -0
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +86 -0
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +11 -0
- data/lib/active_merchant/billing/integrations/dotpay.rb +22 -0
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +23 -0
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +43 -0
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +64 -0
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +49 -0
- data/lib/active_merchant/billing/integrations/dwolla.rb +23 -0
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +34 -0
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +84 -0
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +48 -0
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +40 -0
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +36 -0
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +59 -0
- data/lib/active_merchant/billing/integrations/easy_pay.rb +30 -0
- data/lib/active_merchant/billing/integrations/epay/helper.rb +55 -0
- data/lib/active_merchant/billing/integrations/epay/notification.rb +110 -0
- data/lib/active_merchant/billing/integrations/epay.rb +21 -0
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +61 -0
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
- data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +42 -0
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +70 -0
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +85 -0
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/gestpay.rb +25 -0
- data/lib/active_merchant/billing/integrations/helper.rb +117 -0
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +58 -0
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +59 -0
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +67 -0
- data/lib/active_merchant/billing/integrations/hi_trust.rb +27 -0
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +114 -0
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +95 -0
- data/lib/active_merchant/billing/integrations/ipay88.rb +19 -0
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +43 -0
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +89 -0
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +83 -0
- data/lib/active_merchant/billing/integrations/liqpay.rb +30 -0
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
- data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +75 -0
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +129 -0
- data/lib/active_merchant/billing/integrations/moneybookers.rb +26 -0
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +68 -0
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +94 -0
- data/lib/active_merchant/billing/integrations/nochex/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/nochex.rb +88 -0
- data/lib/active_merchant/billing/integrations/notification.rb +71 -0
- data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
- data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +42 -0
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +50 -0
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +134 -0
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/pay_fast.rb +70 -0
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +116 -0
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +78 -0
- data/lib/active_merchant/billing/integrations/payflow_link.rb +21 -0
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +119 -0
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +227 -0
- data/lib/active_merchant/billing/integrations/paypal/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/paypal.rb +39 -0
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +15 -0
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +20 -0
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +15 -0
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +28 -0
- data/lib/active_merchant/billing/integrations/paysbuy.rb +36 -0
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +165 -0
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +36 -0
- data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
- data/lib/active_merchant/billing/integrations/platron/helper.rb +32 -0
- data/lib/active_merchant/billing/integrations/platron/notification.rb +113 -0
- data/lib/active_merchant/billing/integrations/platron.rb +28 -0
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +112 -0
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
- data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +74 -0
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +137 -0
- data/lib/active_merchant/billing/integrations/quickpay.rb +21 -0
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
- data/lib/active_merchant/billing/integrations/return.rb +42 -0
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +19 -0
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +50 -0
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +55 -0
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +17 -0
- data/lib/active_merchant/billing/integrations/robokassa.rb +49 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +33 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +136 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +210 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +31 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +37 -0
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +91 -0
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +139 -0
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +17 -0
- data/lib/active_merchant/billing/integrations/two_checkout.rb +44 -0
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +86 -0
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +13 -0
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +97 -0
- data/lib/active_merchant/billing/integrations/valitor/return.rb +13 -0
- data/lib/active_merchant/billing/integrations/valitor.rb +33 -0
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +88 -0
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +59 -0
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +20 -0
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
- data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +17 -0
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +40 -0
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +47 -0
- data/lib/active_merchant/billing/integrations/webmoney.rb +43 -0
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +101 -0
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +160 -0
- data/lib/active_merchant/billing/integrations/world_pay.rb +34 -0
- data/lib/active_merchant/billing/integrations.rb +17 -0
- data/lib/active_merchant/billing/response.rb +77 -0
- data/lib/active_merchant/billing.rb +9 -0
- data/lib/active_merchant/version.rb +3 -0
- data/lib/active_merchant.rb +63 -0
- data/lib/activemerchant.rb +1 -0
- data/lib/support/gateway_support.rb +65 -0
- data/lib/support/outbound_hosts.rb +25 -0
- data/lib/support/ssl_verify.rb +93 -0
- metadata +506 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'digest/md5'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
module Integrations #:nodoc:
|
6
|
+
module Valitor
|
7
|
+
module ResponseFields
|
8
|
+
def success?
|
9
|
+
status == 'Completed'
|
10
|
+
end
|
11
|
+
alias :complete? :success?
|
12
|
+
|
13
|
+
def test?
|
14
|
+
@options[:test]
|
15
|
+
end
|
16
|
+
|
17
|
+
def item_id
|
18
|
+
params['Tilvisunarnumer']
|
19
|
+
end
|
20
|
+
alias :order :item_id
|
21
|
+
|
22
|
+
def transaction_id
|
23
|
+
params['VefverslunSalaID']
|
24
|
+
end
|
25
|
+
|
26
|
+
def currency
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
def status
|
31
|
+
"Completed" if acknowledge
|
32
|
+
end
|
33
|
+
|
34
|
+
def received_at
|
35
|
+
Time.parse(params['Dagsetning'].to_s)
|
36
|
+
end
|
37
|
+
|
38
|
+
def gross
|
39
|
+
"%0.2f" % params['Upphaed'].to_s
|
40
|
+
end
|
41
|
+
|
42
|
+
def card_type
|
43
|
+
params['Kortategund']
|
44
|
+
end
|
45
|
+
|
46
|
+
def card_last_four
|
47
|
+
params['KortnumerSidustu']
|
48
|
+
end
|
49
|
+
|
50
|
+
def authorization_number
|
51
|
+
params['Heimildarnumer']
|
52
|
+
end
|
53
|
+
|
54
|
+
def transaction_number
|
55
|
+
params['Faerslunumer']
|
56
|
+
end
|
57
|
+
|
58
|
+
def customer_name
|
59
|
+
params['Nafn']
|
60
|
+
end
|
61
|
+
|
62
|
+
def customer_address
|
63
|
+
params['Heimilisfang']
|
64
|
+
end
|
65
|
+
|
66
|
+
def customer_zip
|
67
|
+
params['Postnumer']
|
68
|
+
end
|
69
|
+
|
70
|
+
def customer_city
|
71
|
+
params['Stadur']
|
72
|
+
end
|
73
|
+
|
74
|
+
def customer_country
|
75
|
+
params['Land']
|
76
|
+
end
|
77
|
+
|
78
|
+
def customer_email
|
79
|
+
params['Tolvupostfang']
|
80
|
+
end
|
81
|
+
|
82
|
+
def customer_comment
|
83
|
+
params['Athugasemdir']
|
84
|
+
end
|
85
|
+
|
86
|
+
def password
|
87
|
+
@options[:credential2]
|
88
|
+
end
|
89
|
+
|
90
|
+
def acknowledge
|
91
|
+
password ? Digest::MD5.hexdigest("#{password}#{order}") == params['RafraenUndirskriftSvar'] : true
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'active_merchant/billing/integrations/valitor/response_fields'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
module Integrations #:nodoc:
|
6
|
+
module Valitor
|
7
|
+
class Return < ActiveMerchant::Billing::Integrations::Return
|
8
|
+
include ResponseFields
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Valitor
|
5
|
+
autoload :Return, 'active_merchant/billing/integrations/valitor/return.rb'
|
6
|
+
autoload :Helper, 'active_merchant/billing/integrations/valitor/helper.rb'
|
7
|
+
autoload :Notification, 'active_merchant/billing/integrations/valitor/notification.rb'
|
8
|
+
|
9
|
+
mattr_accessor :test_url
|
10
|
+
self.test_url = 'https://testvefverslun.valitor.is/1_1/'
|
11
|
+
|
12
|
+
mattr_accessor :production_url
|
13
|
+
self.production_url = 'https://vefverslun.valitor.is/1_1/'
|
14
|
+
|
15
|
+
def self.test?
|
16
|
+
(ActiveMerchant::Billing::Base.integration_mode == :test)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.service_url
|
20
|
+
(test? ? test_url : production_url)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.notification(params, options={})
|
24
|
+
Notification.new(params, options.merge(:test => test?))
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.return(query_string, options={})
|
28
|
+
Return.new(query_string, options.merge(:test => test?))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Verkkomaksut
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
|
7
|
+
# Fetches the md5secret and adds MERCHANT_ID and API TYPE to the form
|
8
|
+
def initialize(order, account, options = {})
|
9
|
+
md5secret options.delete(:credential2)
|
10
|
+
super
|
11
|
+
add_field("MERCHANT_ID", account)
|
12
|
+
add_field("TYPE", "E1")
|
13
|
+
end
|
14
|
+
|
15
|
+
def md5secret(value)
|
16
|
+
@md5secret = value
|
17
|
+
end
|
18
|
+
|
19
|
+
# Adds the AUTHCODE to the form
|
20
|
+
def form_fields
|
21
|
+
@fields.merge("AUTHCODE" => generate_md5string)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Calculates the AUTHCODE
|
25
|
+
def generate_md5string
|
26
|
+
fields = [@md5secret, @fields["MERCHANT_ID"], @fields["ORDER_NUMBER"], @fields["REFERENCE_NUMBER"], @fields["ORDER_DESCRIPTION"], @fields["CURRENCY"], @fields["RETURN_ADDRESS"], @fields["CANCEL_ADDRESS"], @fields["PENDING_ADDRESS"],
|
27
|
+
@fields["NOTIFY_ADDRESS"], @fields["TYPE"], @fields["CULTURE"], @fields["PRESELECTED_METHOD"], @fields["MODE"], @fields["VISIBLE_METHODS"], @fields["GROUP"], @fields["CONTACT_TELNO"], @fields["CONTACT_CELLNO"],
|
28
|
+
@fields["CONTACT_EMAIL"], @fields["CONTACT_FIRSTNAME"], @fields["CONTACT_LASTNAME"], @fields["CONTACT_COMPANY"], @fields["CONTACT_ADDR_STREET"], @fields["CONTACT_ADDR_ZIP"], @fields["CONTACT_ADDR_CITY"], @fields["CONTACT_ADDR_COUNTRY"], @fields["INCLUDE_VAT"],
|
29
|
+
@fields["ITEMS"]]
|
30
|
+
|
31
|
+
(0..@fields["ITEMS"].to_i-1).each do |i|
|
32
|
+
fields += [@fields["ITEM_TITLE[#{i}]"], @fields["ITEM_NO[#{i}]"], @fields["ITEM_AMOUNT[#{i}]"], @fields["ITEM_PRICE[#{i}]"], @fields["ITEM_TAX[#{i}]"], @fields["ITEM_DISCOUNT[#{i}]"], @fields["ITEM_TYPE[#{i}]"]]
|
33
|
+
end
|
34
|
+
|
35
|
+
fields = fields.join("|")
|
36
|
+
|
37
|
+
return Digest::MD5.hexdigest(fields).upcase
|
38
|
+
end
|
39
|
+
|
40
|
+
# Mappings
|
41
|
+
mapping :merchant_id, "MERCHANT_ID"
|
42
|
+
mapping :order, "ORDER_NUMBER"
|
43
|
+
mapping :reference_number, "REFERENCE_NUMBER"
|
44
|
+
mapping :customer, :first_name => "CONTACT_FIRSTNAME",
|
45
|
+
:last_name => "CONTACT_LASTNAME",
|
46
|
+
:email => "CONTACT_EMAIL",
|
47
|
+
:phone => "CONTACT_CELLNO",
|
48
|
+
:tellno => "CONTACT_TELLNO",
|
49
|
+
:company => "CONTACT_COMPANY"
|
50
|
+
|
51
|
+
|
52
|
+
mapping :billing_address, :city => "CONTACT_ADDR_CITY",
|
53
|
+
:address1 => "CONTACT_ADDR_STREET",
|
54
|
+
:address2 => "",
|
55
|
+
:state => "",
|
56
|
+
:zip => "CONTACT_ADDR_ZIP",
|
57
|
+
:country => "CONTACT_ADDR_COUNTRY"
|
58
|
+
|
59
|
+
mapping :notify_url, "NOTIFY_ADDRESS"
|
60
|
+
mapping :currency, "CURRENCY"
|
61
|
+
mapping :return_url, "RETURN_ADDRESS"
|
62
|
+
mapping :cancel_return_url, "CANCEL_ADDRESS"
|
63
|
+
mapping :description, "ORDER_DESCRIPTION"
|
64
|
+
mapping :tax, ""
|
65
|
+
mapping :shipping, ""
|
66
|
+
mapping :include_vat, "INCLUDE_VAT"
|
67
|
+
mapping :pending_address, "PENDING_ADDRESS"
|
68
|
+
mapping :culture, "CULTURE"
|
69
|
+
mapping :items, "ITEMS"
|
70
|
+
mapping :preselected_method, "PRESELECTED_METHOD"
|
71
|
+
mapping :mode, "MODE"
|
72
|
+
mapping :visible_methods, "VISIBLE_METHODS"
|
73
|
+
mapping :group, "GROUP"
|
74
|
+
|
75
|
+
(0..499.to_i).each do |i|
|
76
|
+
mapping "item_title_#{i}".to_sym, "ITEM_TITLE[#{i}]"
|
77
|
+
mapping "item_no_#{i}".to_sym, "ITEM_NO[#{i}]"
|
78
|
+
mapping "item_amount_#{i}".to_sym, "ITEM_AMOUNT[#{i}]"
|
79
|
+
mapping "item_price_#{i}".to_sym, "ITEM_PRICE[#{i}]"
|
80
|
+
mapping "item_tax_#{i}".to_sym, "ITEM_TAX[#{i}]"
|
81
|
+
mapping "item_discount_#{i}".to_sym, "ITEM_DISCOUNT[#{i}]"
|
82
|
+
mapping "item_type_#{i}".to_sym, "ITEM_TYPE[#{i}]"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
module Integrations #:nodoc:
|
6
|
+
module Verkkomaksut
|
7
|
+
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
8
|
+
|
9
|
+
# Is the payment complete or not. Verkkomaksut only has two statuses: random string or 0000000000 which means pending
|
10
|
+
def complete?
|
11
|
+
params['PAID'] != "0000000000"
|
12
|
+
end
|
13
|
+
|
14
|
+
# Order id
|
15
|
+
def order_id
|
16
|
+
params['ORDER_NUMBER']
|
17
|
+
end
|
18
|
+
|
19
|
+
# Payment method used
|
20
|
+
def method
|
21
|
+
params['METHOD']
|
22
|
+
end
|
23
|
+
|
24
|
+
# When was this payment received by the client.
|
25
|
+
def received_at
|
26
|
+
params['TIMESTAMP']
|
27
|
+
end
|
28
|
+
|
29
|
+
# Security key got from Verkkomaksut
|
30
|
+
def security_key
|
31
|
+
params['RETURN_AUTHCODE']
|
32
|
+
end
|
33
|
+
|
34
|
+
# Another way of asking the payment status
|
35
|
+
def status
|
36
|
+
if complete?
|
37
|
+
"PAID"
|
38
|
+
else
|
39
|
+
"PENDING"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Acknowldges the payment. If the authcodes match, returns true.
|
44
|
+
def acknowledge(authcode)
|
45
|
+
return_authcode = [params["ORDER_NUMBER"], params["TIMESTAMP"], params["PAID"], params["METHOD"], authcode].join("|")
|
46
|
+
Digest::MD5.hexdigest(return_authcode).upcase == params["RETURN_AUTHCODE"]
|
47
|
+
end
|
48
|
+
private
|
49
|
+
|
50
|
+
def parse(post)
|
51
|
+
post.each do |key, value|
|
52
|
+
params[key] = value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/verkkomaksut/helper.rb'
|
2
|
+
require File.dirname(__FILE__) + '/verkkomaksut/notification.rb'
|
3
|
+
|
4
|
+
module ActiveMerchant #:nodoc:
|
5
|
+
module Billing #:nodoc:
|
6
|
+
module Integrations #:nodoc:
|
7
|
+
|
8
|
+
# Usage, see the blog post here: http://blog.kiskolabs.com/post/22374612968/understanding-active-merchant-integrations and E1 API documentation here: http://docs.verkkomaksut.fi/
|
9
|
+
module Verkkomaksut
|
10
|
+
|
11
|
+
mattr_accessor :service_url
|
12
|
+
self.service_url = 'https://payment.verkkomaksut.fi/'
|
13
|
+
|
14
|
+
def self.notification(post)
|
15
|
+
Notification.new(post)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module WebPay
|
5
|
+
module Common
|
6
|
+
def generate_signature(type)
|
7
|
+
string = case type
|
8
|
+
when :request
|
9
|
+
request_signature_string
|
10
|
+
when :notify
|
11
|
+
notify_signature_string
|
12
|
+
end
|
13
|
+
if type != :notify && @fields[mappings[:version]] == '2'
|
14
|
+
Digest::SHA1.hexdigest(string)
|
15
|
+
else
|
16
|
+
Digest::MD5.hexdigest(string)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def request_signature_string
|
21
|
+
[
|
22
|
+
@fields[mappings[:seed]],
|
23
|
+
@fields[mappings[:account]],
|
24
|
+
@fields[mappings[:order]],
|
25
|
+
@fields[mappings[:test]],
|
26
|
+
@fields[mappings[:currency]],
|
27
|
+
@fields[mappings[:amount]],
|
28
|
+
secret
|
29
|
+
].join
|
30
|
+
end
|
31
|
+
|
32
|
+
def notify_signature_string
|
33
|
+
[
|
34
|
+
params['batch_timestamp'],
|
35
|
+
params['currency_id'],
|
36
|
+
params['amount'],
|
37
|
+
params['payment_method'],
|
38
|
+
params['order_id'],
|
39
|
+
params['site_order_id'],
|
40
|
+
params['transaction_id'],
|
41
|
+
params['payment_type'],
|
42
|
+
params['rrn'],
|
43
|
+
secret
|
44
|
+
].join
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module WebPay
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
include Common
|
7
|
+
|
8
|
+
def initialize(order, account, options = {})
|
9
|
+
@md5secret = options.delete(:secret)
|
10
|
+
@line_item_count = 0
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def form_fields
|
15
|
+
@fields.merge(ActiveMerchant::Billing::Integrations::WebPay.signature_parameter_name => generate_signature(:request))
|
16
|
+
end
|
17
|
+
|
18
|
+
def params
|
19
|
+
@fields
|
20
|
+
end
|
21
|
+
|
22
|
+
def secret
|
23
|
+
@md5secret
|
24
|
+
end
|
25
|
+
|
26
|
+
def add_line_item(options)
|
27
|
+
options.each do |key, value|
|
28
|
+
add_field("wsb_invoice_item_#{key}[#{@line_item_count}]", value)
|
29
|
+
end
|
30
|
+
|
31
|
+
@line_item_count += 1
|
32
|
+
end
|
33
|
+
|
34
|
+
def calculate_total
|
35
|
+
sum = 0
|
36
|
+
|
37
|
+
@line_item_count.times do |i|
|
38
|
+
sum += @fields["wsb_invoice_item_quantity[#{i}]"].to_i * @fields["wsb_invoice_item_price[#{i}]"].to_i
|
39
|
+
end
|
40
|
+
|
41
|
+
sum + @fields[mappings[:tax]].to_i + @fields[mappings[:shipping_price]].to_i - @fields[mappings[:discount_price]].to_i
|
42
|
+
end
|
43
|
+
|
44
|
+
mapping :scart, '*scart'
|
45
|
+
mapping :account, 'wsb_storeid'
|
46
|
+
mapping :store, 'wsb_store'
|
47
|
+
mapping :order, 'wsb_order_num'
|
48
|
+
mapping :currency, 'wsb_currency_id'
|
49
|
+
mapping :version, 'wsb_version'
|
50
|
+
mapping :language, 'wsb_language_id'
|
51
|
+
mapping :seed, 'wsb_seed'
|
52
|
+
mapping :success_url, 'wsb_return_url'
|
53
|
+
mapping :cancel_url, 'wsb_cancel_return_url'
|
54
|
+
mapping :notify_url, 'wsb_notify_url'
|
55
|
+
mapping :test, 'wsb_test'
|
56
|
+
mapping :tax, 'wsb_tax'
|
57
|
+
mapping :shipping_name, 'wsb_shipping_name'
|
58
|
+
mapping :shipping_price, 'wsb_shipping_price'
|
59
|
+
mapping :discount_name, 'wsb_discount_name'
|
60
|
+
mapping :discount_price, 'wsb_discount_price'
|
61
|
+
mapping :amount, 'wsb_total'
|
62
|
+
mapping :email, 'wsb_email'
|
63
|
+
mapping :phone, 'wsb_phone'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module WebPay
|
5
|
+
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
6
|
+
include Common
|
7
|
+
|
8
|
+
def self.recognizes?(params)
|
9
|
+
params.has_key?('site_order_id') && params.has_key?('amount')
|
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['site_order_id']
|
22
|
+
end
|
23
|
+
|
24
|
+
def security_key
|
25
|
+
params[ActiveMerchant::Billing::Integrations::WebPay.signature_parameter_name]
|
26
|
+
end
|
27
|
+
|
28
|
+
def gross
|
29
|
+
params['amount']
|
30
|
+
end
|
31
|
+
|
32
|
+
def status
|
33
|
+
'success'
|
34
|
+
end
|
35
|
+
|
36
|
+
def secret
|
37
|
+
@options[:secret]
|
38
|
+
end
|
39
|
+
|
40
|
+
def acknowledge
|
41
|
+
(security_key == generate_signature(:notify))
|
42
|
+
end
|
43
|
+
|
44
|
+
def success_response(*args)
|
45
|
+
{:nothing => true}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
|
5
|
+
# Documentation: You will get it after registration steps here:
|
6
|
+
# http://reg.webpay.by/registration-form.php
|
7
|
+
module WebPay
|
8
|
+
autoload :Helper, File.dirname(__FILE__) + '/web_pay/helper.rb'
|
9
|
+
autoload :Notification, File.dirname(__FILE__) + '/web_pay/notification.rb'
|
10
|
+
autoload :Common, File.dirname(__FILE__) + '/web_pay/common.rb'
|
11
|
+
|
12
|
+
# Overwrite this if you want to change the WebPay sandbox url
|
13
|
+
mattr_accessor :test_url
|
14
|
+
self.test_url = 'https://secure.sandbox.webpay.by:8843'
|
15
|
+
|
16
|
+
# Overwrite this if you want to change the WebPay production url
|
17
|
+
mattr_accessor :production_url
|
18
|
+
self.production_url = 'https://secure.webpay.by'
|
19
|
+
|
20
|
+
mattr_accessor :signature_parameter_name
|
21
|
+
self.signature_parameter_name = 'wsb_signature'
|
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
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Webmoney
|
5
|
+
module Common
|
6
|
+
def generate_signature_string
|
7
|
+
"#{params['LMI_PAYEE_PURSE']}#{params['LMI_PAYMENT_AMOUNT']}#{params['LMI_PAYMENT_NO']}#{params['LMI_MODE']}#{params['LMI_SYS_INVS_NO']}#{params['LMI_SYS_TRANS_NO']}#{params['LMI_SYS_TRANS_DATE']}#{secret}#{params['LMI_PAYER_PURSE']}#{params['LMI_PAYER_WM']}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def generate_signature
|
11
|
+
Digest::MD5.hexdigest(generate_signature_string).upcase
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Webmoney
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
include Common
|
7
|
+
|
8
|
+
def initialize(order, account, options = {})
|
9
|
+
@webmoney_options = options.dup
|
10
|
+
options.delete(:description)
|
11
|
+
options.delete(:fail_url)
|
12
|
+
options.delete(:success_url)
|
13
|
+
options.delete(:result_url)
|
14
|
+
super
|
15
|
+
@webmoney_options.each do |key, value|
|
16
|
+
add_field mappings[key], value
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def form_fields
|
21
|
+
@fields
|
22
|
+
end
|
23
|
+
|
24
|
+
def params
|
25
|
+
@fields
|
26
|
+
end
|
27
|
+
|
28
|
+
mapping :account, 'LMI_PAYEE_PURSE'
|
29
|
+
mapping :amount, 'LMI_PAYMENT_AMOUNT'
|
30
|
+
mapping :order, 'LMI_PAYMENT_NO'
|
31
|
+
mapping :description, 'LMI_PAYMENT_DESC'
|
32
|
+
mapping :fail_url, 'LMI_FAIL_URL'
|
33
|
+
mapping :success_url, 'LMI_SUCCESS_URL'
|
34
|
+
mapping :result_url, 'LMI_RESULT_URL'
|
35
|
+
mapping :debug, 'LMI_SIM_MODE'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Webmoney
|
5
|
+
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
6
|
+
include Common
|
7
|
+
|
8
|
+
def recognizes?
|
9
|
+
(params.has_key?('LMI_PAYMENT_NO') && params.has_key?('LMI_PAYMENT_AMOUNT'))
|
10
|
+
end
|
11
|
+
|
12
|
+
def amount
|
13
|
+
BigDecimal.new(gross)
|
14
|
+
end
|
15
|
+
|
16
|
+
def key_present?
|
17
|
+
params["LMI_HASH"].present?
|
18
|
+
end
|
19
|
+
|
20
|
+
def item_id
|
21
|
+
params['LMI_PAYMENT_NO']
|
22
|
+
end
|
23
|
+
|
24
|
+
def gross
|
25
|
+
params['LMI_PAYMENT_AMOUNT']
|
26
|
+
end
|
27
|
+
|
28
|
+
def security_key
|
29
|
+
params["LMI_HASH"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def secret
|
33
|
+
@options[:secret]
|
34
|
+
end
|
35
|
+
|
36
|
+
def acknowledge
|
37
|
+
(security_key == generate_signature)
|
38
|
+
end
|
39
|
+
|
40
|
+
def success_response(*args)
|
41
|
+
{:nothing => true}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
# Documentation:
|
5
|
+
# http://wiki.webmoney.ru/projects/webmoney/wiki/Web_Merchant_Interface
|
6
|
+
module Webmoney
|
7
|
+
autoload :Helper, File.dirname(__FILE__) + '/webmoney/helper.rb'
|
8
|
+
autoload :Notification, File.dirname(__FILE__) + '/webmoney/notification.rb'
|
9
|
+
autoload :Return, File.dirname(__FILE__) + '/webmoney/return.rb'
|
10
|
+
autoload :Common, File.dirname(__FILE__) + '/webmoney/common.rb'
|
11
|
+
|
12
|
+
mattr_accessor :test_url
|
13
|
+
self.test_url = "https://merchant.webmoney.ru/lmi/payment.asp"
|
14
|
+
|
15
|
+
mattr_accessor :production_url
|
16
|
+
self.production_url = "https://merchant.webmoney.ru/lmi/payment.asp"
|
17
|
+
|
18
|
+
mattr_accessor :signature_parameter_name
|
19
|
+
self.signature_parameter_name = 'LMI_HASH'
|
20
|
+
|
21
|
+
def self.service_url
|
22
|
+
mode = ActiveMerchant::Billing::Base.integration_mode
|
23
|
+
case mode
|
24
|
+
when :production
|
25
|
+
self.production_url
|
26
|
+
when :test
|
27
|
+
self.test_url
|
28
|
+
else
|
29
|
+
raise StandardError, "Integration mode set to an invalid value: #{mode}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.helper(order, account, options = {})
|
34
|
+
Helper.new(order, account, options)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.notification(query_string, options = {})
|
38
|
+
Notification.new(query_string, options)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|