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,207 @@
|
|
1
|
+
require "nokogiri"
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class HdfcGateway < Gateway
|
6
|
+
self.display_name = "HDFC"
|
7
|
+
self.homepage_url = "http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i"
|
8
|
+
|
9
|
+
self.test_url = "https://securepgtest.fssnet.co.in/pgway/servlet/"
|
10
|
+
self.live_url = "https://securepg.fssnet.co.in/pgway/servlet/"
|
11
|
+
|
12
|
+
self.supported_countries = ["IN"]
|
13
|
+
self.default_currency = "INR"
|
14
|
+
self.money_format = :dollars
|
15
|
+
self.supported_cardtypes = [:visa, :master, :discover, :diners_club]
|
16
|
+
|
17
|
+
def initialize(options={})
|
18
|
+
requires!(options, :login, :password)
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
def purchase(amount, payment_method, options={})
|
23
|
+
post = {}
|
24
|
+
add_invoice(post, amount, options)
|
25
|
+
add_payment_method(post, payment_method)
|
26
|
+
add_customer_data(post, options)
|
27
|
+
|
28
|
+
commit("purchase", post)
|
29
|
+
end
|
30
|
+
|
31
|
+
def authorize(amount, payment_method, options={})
|
32
|
+
post = {}
|
33
|
+
add_invoice(post, amount, options)
|
34
|
+
add_payment_method(post, payment_method)
|
35
|
+
add_customer_data(post, options)
|
36
|
+
|
37
|
+
commit("authorize", post)
|
38
|
+
end
|
39
|
+
|
40
|
+
def capture(amount, authorization, options={})
|
41
|
+
post = {}
|
42
|
+
add_invoice(post, amount, options)
|
43
|
+
add_reference(post, authorization)
|
44
|
+
add_customer_data(post, options)
|
45
|
+
|
46
|
+
commit("capture", post)
|
47
|
+
end
|
48
|
+
|
49
|
+
def refund(amount, authorization, options={})
|
50
|
+
post = {}
|
51
|
+
add_invoice(post, amount, options)
|
52
|
+
add_reference(post, authorization)
|
53
|
+
add_customer_data(post, options)
|
54
|
+
|
55
|
+
commit("refund", post)
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}")}
|
61
|
+
CURRENCY_CODES["AED"] = "784"
|
62
|
+
CURRENCY_CODES["AUD"] = "036"
|
63
|
+
CURRENCY_CODES["CAD"] = "124"
|
64
|
+
CURRENCY_CODES["EUR"] = "978"
|
65
|
+
CURRENCY_CODES["GBP"] = "826"
|
66
|
+
CURRENCY_CODES["INR"] = "356"
|
67
|
+
CURRENCY_CODES["OMR"] = "512"
|
68
|
+
CURRENCY_CODES["QAR"] = "634"
|
69
|
+
CURRENCY_CODES["SGD"] = "702"
|
70
|
+
CURRENCY_CODES["USD"] = "840"
|
71
|
+
|
72
|
+
def add_invoice(post, amount, options)
|
73
|
+
post[:amt] = amount(amount)
|
74
|
+
post[:currencycode] = CURRENCY_CODES[options[:currency] || currency(amount)]
|
75
|
+
post[:trackid] = escape(options[:order_id], 40) if options[:order_id]
|
76
|
+
post[:udf1] = escape(options[:description]) if options[:description]
|
77
|
+
post[:eci] = options[:eci] if options[:eci]
|
78
|
+
end
|
79
|
+
|
80
|
+
def add_customer_data(post, options)
|
81
|
+
post[:udf2] = escape(options[:email]) if options[:email]
|
82
|
+
if address = (options[:billing_address] || options[:address])
|
83
|
+
post[:udf3] = escape(address[:phone]) if address[:phone]
|
84
|
+
post[:udf4] = escape(<<EOA)
|
85
|
+
#{address[:name]}
|
86
|
+
#{address[:company]}
|
87
|
+
#{address[:address1]}
|
88
|
+
#{address[:address2]}
|
89
|
+
#{address[:city]} #{address[:state]} #{address[:zip]}
|
90
|
+
#{address[:country]}
|
91
|
+
EOA
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def add_payment_method(post, payment_method)
|
96
|
+
post[:member] = escape(payment_method.name, 30)
|
97
|
+
post[:card] = escape(payment_method.number)
|
98
|
+
post[:cvv2] = escape(payment_method.verification_value)
|
99
|
+
post[:expyear] = format(payment_method.year, :four_digits)
|
100
|
+
post[:expmonth] = format(payment_method.month, :two_digits)
|
101
|
+
end
|
102
|
+
|
103
|
+
def add_reference(post, authorization)
|
104
|
+
tranid, member = split_authorization(authorization)
|
105
|
+
post[:transid] = tranid
|
106
|
+
post[:member] = member
|
107
|
+
end
|
108
|
+
|
109
|
+
def parse(xml)
|
110
|
+
response = {}
|
111
|
+
|
112
|
+
doc = Nokogiri::XML.fragment(fix_xml(xml))
|
113
|
+
doc.children.each do |node|
|
114
|
+
if node.text?
|
115
|
+
next
|
116
|
+
elsif (node.elements.size == 0)
|
117
|
+
response[node.name.downcase.to_sym] = node.text
|
118
|
+
else
|
119
|
+
node.elements.each do |childnode|
|
120
|
+
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
121
|
+
response[name.to_sym] = childnode.text
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
response
|
127
|
+
end
|
128
|
+
|
129
|
+
def fix_xml(xml)
|
130
|
+
xml.gsub(/&(?!(?:amp|quot|apos|lt|gt);)/, "&")
|
131
|
+
end
|
132
|
+
|
133
|
+
ACTIONS = {
|
134
|
+
"purchase" => "1",
|
135
|
+
"refund" => "2",
|
136
|
+
"authorize" => "4",
|
137
|
+
"capture" => "5",
|
138
|
+
}
|
139
|
+
|
140
|
+
def commit(action, post)
|
141
|
+
post[:id] = @options[:login]
|
142
|
+
post[:password] = @options[:password]
|
143
|
+
post[:action] = ACTIONS[action] if ACTIONS[action]
|
144
|
+
|
145
|
+
raw = parse(ssl_post(url(action), build_request(post)))
|
146
|
+
|
147
|
+
succeeded = success_from(raw[:result])
|
148
|
+
Response.new(
|
149
|
+
succeeded,
|
150
|
+
message_from(succeeded, raw),
|
151
|
+
raw,
|
152
|
+
:authorization => authorization_from(post, raw),
|
153
|
+
:test => test?
|
154
|
+
)
|
155
|
+
end
|
156
|
+
|
157
|
+
def build_request(post)
|
158
|
+
xml = Builder::XmlMarkup.new :indent => 2
|
159
|
+
xml.instruct!
|
160
|
+
post.each do |field, value|
|
161
|
+
xml.tag!(field, value)
|
162
|
+
end
|
163
|
+
xml.target!
|
164
|
+
end
|
165
|
+
|
166
|
+
def url(action)
|
167
|
+
endpoint = "TranPortalXMLServlet"
|
168
|
+
(test? ? test_url : live_url) + endpoint
|
169
|
+
end
|
170
|
+
|
171
|
+
def success_from(result)
|
172
|
+
case result
|
173
|
+
when "CAPTURED", "APPROVED", "NOT ENROLLED", "ENROLLED"
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def message_from(succeeded, response)
|
181
|
+
if succeeded
|
182
|
+
"Succeeded"
|
183
|
+
else
|
184
|
+
(response[:error_text] || response[:result] || "Unable to read error message").split("-").last
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def authorization_from(request, response)
|
189
|
+
[response[:tranid], request[:member]].join("|")
|
190
|
+
end
|
191
|
+
|
192
|
+
def split_authorization(authorization)
|
193
|
+
tranid, member = authorization.split("|")
|
194
|
+
[tranid, member]
|
195
|
+
end
|
196
|
+
|
197
|
+
def escape(string, max_length=250)
|
198
|
+
return "" unless string
|
199
|
+
if max_length
|
200
|
+
string = string[0...max_length]
|
201
|
+
end
|
202
|
+
string.gsub(/[^A-Za-z0-9 \-_@\.\n]/, '')
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class IatsPaymentsGateway < AuthorizeNetGateway
|
4
|
+
self.live_url = self.test_url = 'https://www.iatspayments.com/netgate/AEGateway.aspx'
|
5
|
+
|
6
|
+
self.homepage_url = 'http://www.iatspayments.com/'
|
7
|
+
self.display_name = 'IATSPayments'
|
8
|
+
|
9
|
+
def authorize(money, paysource, options = {})
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
def capture(money, authorization, options = {})
|
14
|
+
raise NotImplementedError
|
15
|
+
end
|
16
|
+
|
17
|
+
def void(authorization, options = {})
|
18
|
+
raise NotImplementedError
|
19
|
+
end
|
20
|
+
|
21
|
+
def refund(money, identification, options = {})
|
22
|
+
raise NotImplementedError
|
23
|
+
end
|
24
|
+
|
25
|
+
def credit(money, identification, options = {})
|
26
|
+
raise NotImplementedError
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def split(response)
|
31
|
+
response.split(',')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,249 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/ideal_response'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
# Implementation contains some simplifications
|
6
|
+
# - does not support multiple subID per merchant
|
7
|
+
# - language is fixed to 'nl'
|
8
|
+
class IdealBaseGateway < Gateway
|
9
|
+
class_attribute :server_pem, :pem_password, :default_expiration_period
|
10
|
+
self.default_expiration_period = 'PT10M'
|
11
|
+
self.default_currency = 'EUR'
|
12
|
+
self.pem_password = true
|
13
|
+
|
14
|
+
self.abstract_class = true
|
15
|
+
|
16
|
+
# These constants will never change for most users
|
17
|
+
AUTHENTICATION_TYPE = 'SHA1_RSA'
|
18
|
+
LANGUAGE = 'nl'
|
19
|
+
SUB_ID = '0'
|
20
|
+
API_VERSION = '1.1.0'
|
21
|
+
|
22
|
+
def initialize(options = {})
|
23
|
+
requires!(options, :login, :password, :pem)
|
24
|
+
|
25
|
+
options[:pem_password] = options[:password]
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
29
|
+
# Setup transaction. Get redirect_url from response.service_url
|
30
|
+
def setup_purchase(money, options = {})
|
31
|
+
requires!(options, :issuer_id, :return_url, :order_id, :currency, :description, :entrance_code)
|
32
|
+
|
33
|
+
commit(build_transaction_request(money, options))
|
34
|
+
end
|
35
|
+
|
36
|
+
# Check status of transaction and confirm payment
|
37
|
+
# transaction_id must be a valid transaction_id from a prior setup.
|
38
|
+
def capture(transaction, options = {})
|
39
|
+
options[:transaction_id] = transaction
|
40
|
+
commit(build_status_request(options))
|
41
|
+
end
|
42
|
+
|
43
|
+
# Get list of issuers from response.issuer_list
|
44
|
+
def issuers
|
45
|
+
commit(build_directory_request)
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def url
|
51
|
+
(test? ? test_url : live_url)
|
52
|
+
end
|
53
|
+
|
54
|
+
def token
|
55
|
+
if @token.nil?
|
56
|
+
@token = create_fingerprint(@options[:pem])
|
57
|
+
end
|
58
|
+
@token
|
59
|
+
end
|
60
|
+
|
61
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
62
|
+
# <AcquirerTrxReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
63
|
+
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
64
|
+
# <Issuer>
|
65
|
+
# <issuerID>1003</issuerID>
|
66
|
+
# </Issuer>
|
67
|
+
# <Merchant>
|
68
|
+
# <merchantID>000123456</merchantID>
|
69
|
+
# <subID>0</subID>
|
70
|
+
# <authentication>passkey</authentication>
|
71
|
+
# <token>1</token>
|
72
|
+
# <tokenCode>3823ad872eff23</tokenCode>
|
73
|
+
# <merchantReturnURL>https://www.mijnwinkel.nl/betaalafhandeling
|
74
|
+
# </merchantReturnURL>
|
75
|
+
# </Merchant>
|
76
|
+
# <Transaction>
|
77
|
+
# <purchaseID>iDEAL-aankoop 21</purchaseID>
|
78
|
+
# <amount>5999</amount>
|
79
|
+
# <currency>EUR</currency>
|
80
|
+
# <expirationPeriod>PT3M30S</expirationPeriod>
|
81
|
+
# <language>nl</language>
|
82
|
+
# <description>Documentensuite</description>
|
83
|
+
# <entranceCode>D67tyx6rw9IhY71</entranceCode>
|
84
|
+
# </Transaction>
|
85
|
+
# </AcquirerTrxReq>
|
86
|
+
def build_transaction_request(money, options)
|
87
|
+
date_time_stamp = create_time_stamp
|
88
|
+
message = date_time_stamp +
|
89
|
+
options[:issuer_id] +
|
90
|
+
@options[:login] +
|
91
|
+
SUB_ID +
|
92
|
+
options[:return_url] +
|
93
|
+
options[:order_id] +
|
94
|
+
money.to_s +
|
95
|
+
(options[:currency] || currency(money)) +
|
96
|
+
LANGUAGE +
|
97
|
+
options[:description] +
|
98
|
+
options[:entrance_code]
|
99
|
+
token_code = sign_message(@options[:pem], @options[:password], message)
|
100
|
+
|
101
|
+
xml = Builder::XmlMarkup.new(:indent => 2)
|
102
|
+
xml.instruct!
|
103
|
+
xml.tag! 'AcquirerTrxReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
104
|
+
xml.tag! 'createDateTimeStamp', date_time_stamp
|
105
|
+
xml.tag! 'Issuer' do
|
106
|
+
xml.tag! 'issuerID', options[:issuer_id]
|
107
|
+
end
|
108
|
+
xml.tag! 'Merchant' do
|
109
|
+
xml.tag! 'merchantID', @options[:login]
|
110
|
+
xml.tag! 'subID', SUB_ID
|
111
|
+
xml.tag! 'authentication', AUTHENTICATION_TYPE
|
112
|
+
xml.tag! 'token', token
|
113
|
+
xml.tag! 'tokenCode', token_code
|
114
|
+
xml.tag! 'merchantReturnURL', options[:return_url]
|
115
|
+
end
|
116
|
+
xml.tag! 'Transaction' do
|
117
|
+
xml.tag! 'purchaseID', options[:order_id]
|
118
|
+
xml.tag! 'amount', money
|
119
|
+
xml.tag! 'currency', options[:currency]
|
120
|
+
xml.tag! 'expirationPeriod', options[:expiration_period] || default_expiration_period
|
121
|
+
xml.tag! 'language', LANGUAGE
|
122
|
+
xml.tag! 'description', options[:description]
|
123
|
+
xml.tag! 'entranceCode', options[:entrance_code]
|
124
|
+
end
|
125
|
+
xml.target!
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
130
|
+
# <AcquirerStatusReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
131
|
+
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
132
|
+
# <Merchant>
|
133
|
+
# <merchantID>000123456</merchantID>
|
134
|
+
# <subID>0</subID>
|
135
|
+
# <authentication>keyed hash</authentication>
|
136
|
+
# <token>1</token>
|
137
|
+
# <tokenCode>3823ad872eff23</tokenCode>
|
138
|
+
# </Merchant>
|
139
|
+
# <Transaction>
|
140
|
+
# <transactionID>0001023456789112</transactionID>
|
141
|
+
# </Transaction>
|
142
|
+
# </AcquirerStatusReq>
|
143
|
+
def build_status_request(options)
|
144
|
+
datetimestamp = create_time_stamp
|
145
|
+
message = datetimestamp + @options[:login] + SUB_ID + options[:transaction_id]
|
146
|
+
tokenCode = sign_message(@options[:pem], @options[:password], message)
|
147
|
+
|
148
|
+
xml = Builder::XmlMarkup.new(:indent => 2)
|
149
|
+
xml.instruct!
|
150
|
+
xml.tag! 'AcquirerStatusReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
151
|
+
xml.tag! 'createDateTimeStamp', datetimestamp
|
152
|
+
xml.tag! 'Merchant' do
|
153
|
+
xml.tag! 'merchantID', @options[:login]
|
154
|
+
xml.tag! 'subID', SUB_ID
|
155
|
+
xml.tag! 'authentication' , AUTHENTICATION_TYPE
|
156
|
+
xml.tag! 'token', token
|
157
|
+
xml.tag! 'tokenCode', tokenCode
|
158
|
+
end
|
159
|
+
xml.tag! 'Transaction' do
|
160
|
+
xml.tag! 'transactionID', options[:transaction_id]
|
161
|
+
end
|
162
|
+
end
|
163
|
+
xml.target!
|
164
|
+
end
|
165
|
+
|
166
|
+
# <?xml version="1.0" encoding="UTF-8"?>
|
167
|
+
# <DirectoryReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
168
|
+
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
169
|
+
# <Merchant>
|
170
|
+
# <merchantID>000000001</merchantID>
|
171
|
+
# <subID>0</subID>
|
172
|
+
# <authentication>1</authentication>
|
173
|
+
# <token>hashkey</token>
|
174
|
+
# <tokenCode>WajqV1a3nDen0be2r196g9FGFF=</tokenCode>
|
175
|
+
# </Merchant>
|
176
|
+
# </DirectoryReq>
|
177
|
+
def build_directory_request
|
178
|
+
datetimestamp = create_time_stamp
|
179
|
+
message = datetimestamp + @options[:login] + SUB_ID
|
180
|
+
tokenCode = sign_message(@options[:pem], @options[:password], message)
|
181
|
+
|
182
|
+
xml = Builder::XmlMarkup.new(:indent => 2)
|
183
|
+
xml.instruct!
|
184
|
+
xml.tag! 'DirectoryReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
185
|
+
xml.tag! 'createDateTimeStamp', datetimestamp
|
186
|
+
xml.tag! 'Merchant' do
|
187
|
+
xml.tag! 'merchantID', @options[:login]
|
188
|
+
xml.tag! 'subID', SUB_ID
|
189
|
+
xml.tag! 'authentication', AUTHENTICATION_TYPE
|
190
|
+
xml.tag! 'token', token
|
191
|
+
xml.tag! 'tokenCode', tokenCode
|
192
|
+
end
|
193
|
+
end
|
194
|
+
xml.target!
|
195
|
+
end
|
196
|
+
|
197
|
+
def commit(request)
|
198
|
+
raw_response = ssl_post(url, request)
|
199
|
+
response = Hash.from_xml(raw_response.to_s)
|
200
|
+
response_type = response.keys[0]
|
201
|
+
|
202
|
+
case response_type
|
203
|
+
when 'AcquirerTrxRes', 'DirectoryRes'
|
204
|
+
success = true
|
205
|
+
when 'ErrorRes'
|
206
|
+
success = false
|
207
|
+
when 'AcquirerStatusRes'
|
208
|
+
raise SecurityError, "Message verification failed.", caller unless status_response_verified?(response)
|
209
|
+
success = (response['AcquirerStatusRes']['Transaction']['status'] == 'Success')
|
210
|
+
else
|
211
|
+
raise ArgumentError, "Unknown response type.", caller
|
212
|
+
end
|
213
|
+
|
214
|
+
return IdealResponse.new(success, response.keys[0], response, :test => test?)
|
215
|
+
end
|
216
|
+
|
217
|
+
def create_fingerprint(cert_file)
|
218
|
+
cert_data = OpenSSL::X509::Certificate.new(cert_file).to_s
|
219
|
+
cert_data = cert_data.sub(/-----BEGIN CERTIFICATE-----/, '')
|
220
|
+
cert_data = cert_data.sub(/-----END CERTIFICATE-----/, '')
|
221
|
+
fingerprint = Base64.decode64(cert_data)
|
222
|
+
fingerprint = Digest::SHA1.hexdigest(fingerprint)
|
223
|
+
return fingerprint.upcase
|
224
|
+
end
|
225
|
+
|
226
|
+
def sign_message(private_key_data, password, data)
|
227
|
+
private_key = OpenSSL::PKey::RSA.new(private_key_data, password)
|
228
|
+
signature = private_key.sign(OpenSSL::Digest::SHA1.new, data.gsub('\s', ''))
|
229
|
+
return Base64.encode64(signature).gsub(/\n/, '')
|
230
|
+
end
|
231
|
+
|
232
|
+
def verify_message(cert_file, data, signature)
|
233
|
+
public_key = OpenSSL::X509::Certificate.new(cert_file).public_key
|
234
|
+
return public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), data)
|
235
|
+
end
|
236
|
+
|
237
|
+
def status_response_verified?(response)
|
238
|
+
transaction = response['AcquirerStatusRes']['Transaction']
|
239
|
+
message = response['AcquirerStatusRes']['createDateTimeStamp'] + transaction['transactionID' ] + transaction['status']
|
240
|
+
message << transaction['consumerAccountNumber'].to_s
|
241
|
+
verify_message(server_pem, message, response['AcquirerStatusRes']['Signature']['signatureValue'])
|
242
|
+
end
|
243
|
+
|
244
|
+
def create_time_stamp
|
245
|
+
Time.now.gmtime.strftime('%Y-%m-%dT%H:%M:%S.000Z')
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIICQDCCAakCBELvbPYwDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCREUxDzANBgNVBAgTBkhl
|
3
|
+
c3NlbjESMBAGA1UEBxMJRnJhbmtmdXJ0MQ4wDAYDVQQKEwVpREVBTDEOMAwGA1UECxMFaURFQUwx
|
4
|
+
EzARBgNVBAMTCmlERUFMIFJhYm8wHhcNMDUwODAyMTI1NDE0WhcNMTUwNzMxMTI1NDE0WjBnMQsw
|
5
|
+
CQYDVQQGEwJERTEPMA0GA1UECBMGSGVzc2VuMRIwEAYDVQQHEwlGcmFua2Z1cnQxDjAMBgNVBAoT
|
6
|
+
BWlERUFMMQ4wDAYDVQQLEwVpREVBTDETMBEGA1UEAxMKaURFQUwgUmFibzCBnzANBgkqhkiG9w0B
|
7
|
+
AQEFAAOBjQAwgYkCgYEA486iIKVhr8RNjxH+PZ3yTWx/8k2fqDFm8XU8I1Z5esRmPFnXmlgA8cG7
|
8
|
+
e9AaBPaLoP7Dc8dRQoUO66KMakzGI/WAVdHIJiiKrz8xOcioIgrzPSqec7aqse3J28UraEHkGESJ
|
9
|
+
7dAW7Pw/shrmpmkzKsunLt6AkXss4W3JUndZUN0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCGy/FK
|
10
|
+
Lotp2ZOTtuLMgvDy74eicq/Znv4bLfpglzAPHycRHcHsXuer/lNHyvpKf2gdYe+IFalUW3OJZWIM
|
11
|
+
jpm4UniJ16RPdgwWVRJEdPr/P7JXMIqD2IEOgujuuTQ7x0VgCf9XrsPsP9ZR5DIPcDDhbrpSE0yF
|
12
|
+
Do77nwG61xMaGA==
|
13
|
+
-----END CERTIFICATE-----
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class IdealResponse < Response
|
4
|
+
|
5
|
+
def issuer_list
|
6
|
+
list = @params.values[0]['Directory']['Issuer']
|
7
|
+
case list
|
8
|
+
when Hash
|
9
|
+
return [list]
|
10
|
+
when Array
|
11
|
+
return list
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def service_url
|
16
|
+
@params.values[0]['Issuer']['issuerAuthenticationURL']
|
17
|
+
end
|
18
|
+
|
19
|
+
def transaction
|
20
|
+
@params.values[0]['Transaction']
|
21
|
+
end
|
22
|
+
|
23
|
+
def error
|
24
|
+
@params.values[0]['Error']
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/ideal/ideal_base'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
# First, make sure you have everything setup correctly and all of your dependencies in place with:
|
6
|
+
#
|
7
|
+
# require 'rubygems'
|
8
|
+
# require 'active_merchant'
|
9
|
+
#
|
10
|
+
# ActiveMerchant expects the amounts to be given as an Integer in cents. In this case, 10 EUR becomes 1000.
|
11
|
+
#
|
12
|
+
# Create certificates for authentication:
|
13
|
+
#
|
14
|
+
# The PEM file expected should contain both the certificate and the generated PEM file.
|
15
|
+
# Some sample shell commands to generate the certificates:
|
16
|
+
#
|
17
|
+
# openssl genrsa -aes128 -out priv.pem -passout pass:[YOUR PASSWORD] 1024
|
18
|
+
# openssl req -x509 -new -key priv.pem -passin pass:[YOUR PASSWORD] -days 3000 -out cert.cer
|
19
|
+
# cat cert.cer priv.pem > ideal.pem
|
20
|
+
#
|
21
|
+
# Following the steps above, upload cert.cer to the ideal web interface and pass the path of ideal.pem to the :pem option.
|
22
|
+
#
|
23
|
+
# Configure the gateway using your iDEAL bank account info and security settings:
|
24
|
+
#
|
25
|
+
# Create gateway:
|
26
|
+
# gateway = ActiveMerchant::Billing::IdealRabobankGateway.new(
|
27
|
+
# :login => '123456789', # 9 digit merchant number
|
28
|
+
# :pem => File.read(Rails.root + 'config/ideal.pem'),
|
29
|
+
# :password => 'password' # password for the PEM key
|
30
|
+
# )
|
31
|
+
#
|
32
|
+
# Get list of issuers to fill selection list on your payment form:
|
33
|
+
# response = gateway.issuers
|
34
|
+
# list = response.issuer_list
|
35
|
+
#
|
36
|
+
# Request transaction:
|
37
|
+
#
|
38
|
+
# options = {
|
39
|
+
# :issuer_id => '0001',
|
40
|
+
# :expiration_period => 'PT10M',
|
41
|
+
# :return_url => 'http://www.return.url',
|
42
|
+
# :order_id => '1234567890123456',
|
43
|
+
# :currency => 'EUR',
|
44
|
+
# :description => 'Een omschrijving',
|
45
|
+
# :entrance_code => '1234'
|
46
|
+
# }
|
47
|
+
#
|
48
|
+
# response = gateway.setup_purchase(amount, options)
|
49
|
+
# transaction_id = response.transaction['transactionID']
|
50
|
+
# redirect_url = response.service_url
|
51
|
+
#
|
52
|
+
# Mandatory status request will confirm transaction:
|
53
|
+
# response = gateway.capture(transaction_id)
|
54
|
+
#
|
55
|
+
# Implementation contains some simplifications
|
56
|
+
# - does not support multiple subID per merchant
|
57
|
+
# - language is fixed to 'nl'
|
58
|
+
class IdealRabobankGateway < IdealBaseGateway
|
59
|
+
class_attribute :test_url, :live_url
|
60
|
+
|
61
|
+
self.test_url = 'https://idealtest.rabobank.nl/ideal/iDeal'
|
62
|
+
self.live_url = 'https://ideal.rabobank.nl/ideal/iDeal'
|
63
|
+
self.server_pem = File.read(File.dirname(__FILE__) + '/ideal/ideal_rabobank.pem')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|