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,244 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
|
6
|
+
# To learn more about the Moneris gateway, please contact
|
7
|
+
# eselectplus@moneris.com for a copy of their integration guide. For
|
8
|
+
# information on remote testing, please see "Test Environment Penny Value
|
9
|
+
# Response Table", and "Test Environment eFraud (AVS and CVD) Penny
|
10
|
+
# Response Values", available at Moneris' {eSelect Plus Documentation
|
11
|
+
# Centre}[https://www3.moneris.com/connect/en/documents/index.html].
|
12
|
+
class MonerisGateway < Gateway
|
13
|
+
self.test_url = 'https://esqa.moneris.com/gateway2/servlet/MpgRequest'
|
14
|
+
self.live_url = 'https://www3.moneris.com/gateway2/servlet/MpgRequest'
|
15
|
+
|
16
|
+
self.supported_countries = ['CA']
|
17
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover]
|
18
|
+
self.homepage_url = 'http://www.moneris.com/'
|
19
|
+
self.display_name = 'Moneris'
|
20
|
+
|
21
|
+
# login is your Store ID
|
22
|
+
# password is your API Token
|
23
|
+
def initialize(options = {})
|
24
|
+
requires!(options, :login, :password)
|
25
|
+
options = { :crypt_type => 7 }.merge(options)
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
29
|
+
# Referred to as "PreAuth" in the Moneris integration guide, this action
|
30
|
+
# verifies and locks funds on a customer's card, which then must be
|
31
|
+
# captured at a later date.
|
32
|
+
#
|
33
|
+
# Pass in +order_id+ and optionally a +customer+ parameter.
|
34
|
+
def authorize(money, creditcard_or_datakey, options = {})
|
35
|
+
requires!(options, :order_id)
|
36
|
+
post = {}
|
37
|
+
add_payment_source(post, creditcard_or_datakey)
|
38
|
+
post[:amount] = amount(money)
|
39
|
+
post[:order_id] = options[:order_id]
|
40
|
+
post[:cust_id] = options[:customer]
|
41
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
42
|
+
action = (post[:data_key].blank?) ? 'preauth' : 'res_preauth_cc'
|
43
|
+
commit(action, post)
|
44
|
+
end
|
45
|
+
|
46
|
+
# This action verifies funding on a customer's card and readies them for
|
47
|
+
# deposit in a merchant's account.
|
48
|
+
#
|
49
|
+
# Pass in <tt>order_id</tt> and optionally a <tt>customer</tt> parameter
|
50
|
+
def purchase(money, creditcard_or_datakey, options = {})
|
51
|
+
requires!(options, :order_id)
|
52
|
+
post = {}
|
53
|
+
add_payment_source(post, creditcard_or_datakey)
|
54
|
+
post[:amount] = amount(money)
|
55
|
+
post[:order_id] = options[:order_id]
|
56
|
+
post[:cust_id] = options[:customer]
|
57
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
58
|
+
action = (post[:data_key].blank?) ? 'purchase' : 'res_purchase_cc'
|
59
|
+
commit(action, post)
|
60
|
+
end
|
61
|
+
|
62
|
+
# This method retrieves locked funds from a customer's account (from a
|
63
|
+
# PreAuth) and prepares them for deposit in a merchant's account.
|
64
|
+
#
|
65
|
+
# Note: Moneris requires both the order_id and the transaction number of
|
66
|
+
# the original authorization. To maintain the same interface as the other
|
67
|
+
# gateways the two numbers are concatenated together with a ; separator as
|
68
|
+
# the authorization number returned by authorization
|
69
|
+
def capture(money, authorization, options = {})
|
70
|
+
commit 'completion', crediting_params(authorization, :comp_amount => amount(money))
|
71
|
+
end
|
72
|
+
|
73
|
+
# Voiding cancels an open authorization.
|
74
|
+
#
|
75
|
+
# Concatenate your transaction number and order_id by using a semicolon
|
76
|
+
# (';'). This is to keep the Moneris interface consistent with other
|
77
|
+
# gateways. (See +capture+ for details.)
|
78
|
+
def void(authorization, options = {})
|
79
|
+
capture(0, authorization, options)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Performs a refund. This method requires that the original transaction
|
83
|
+
# number and order number be included. Concatenate your transaction
|
84
|
+
# number and order_id by using a semicolon (';'). This is to keep the
|
85
|
+
# Moneris interface consistent with other gateways. (See +capture+ for
|
86
|
+
# details.)
|
87
|
+
def credit(money, authorization, options = {})
|
88
|
+
deprecated CREDIT_DEPRECATION_MESSAGE
|
89
|
+
refund(money, authorization, options)
|
90
|
+
end
|
91
|
+
|
92
|
+
def refund(money, authorization, options = {})
|
93
|
+
commit 'refund', crediting_params(authorization, :amount => amount(money))
|
94
|
+
end
|
95
|
+
|
96
|
+
def store(credit_card, options = {})
|
97
|
+
post = {}
|
98
|
+
post[:pan] = credit_card.number
|
99
|
+
post[:expdate] = expdate(credit_card)
|
100
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
101
|
+
commit('res_add_cc', post)
|
102
|
+
end
|
103
|
+
|
104
|
+
def unstore(data_key, options = {})
|
105
|
+
post = {}
|
106
|
+
post[:data_key] = data_key
|
107
|
+
commit('res_delete', post)
|
108
|
+
end
|
109
|
+
|
110
|
+
def update(data_key, credit_card, options = {})
|
111
|
+
post = {}
|
112
|
+
post[:pan] = credit_card.number
|
113
|
+
post[:expdate] = expdate(credit_card)
|
114
|
+
post[:data_key] = data_key
|
115
|
+
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
116
|
+
commit('res_update_cc', post)
|
117
|
+
end
|
118
|
+
|
119
|
+
private # :nodoc: all
|
120
|
+
|
121
|
+
def expdate(creditcard)
|
122
|
+
sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
|
123
|
+
end
|
124
|
+
|
125
|
+
def add_payment_source(post, source)
|
126
|
+
if source.is_a?(String)
|
127
|
+
post[:data_key] = source
|
128
|
+
else
|
129
|
+
post[:pan] = source.number
|
130
|
+
post[:expdate] = expdate(source)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# Common params used amongst the +credit+, +void+ and +capture+ methods
|
135
|
+
def crediting_params(authorization, options = {})
|
136
|
+
{
|
137
|
+
:txn_number => split_authorization(authorization).first,
|
138
|
+
:order_id => split_authorization(authorization).last,
|
139
|
+
:crypt_type => options[:crypt_type] || @options[:crypt_type]
|
140
|
+
}.merge(options)
|
141
|
+
end
|
142
|
+
|
143
|
+
# Splits an +authorization+ param and retrives the order id and
|
144
|
+
# transaction number in that order.
|
145
|
+
def split_authorization(authorization)
|
146
|
+
if authorization.nil? || authorization.empty? || authorization !~ /;/
|
147
|
+
raise ArgumentError, 'You must include a valid authorization code (e.g. "1234;567")'
|
148
|
+
else
|
149
|
+
authorization.split(';')
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def commit(action, parameters = {})
|
154
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(action, parameters)))
|
155
|
+
|
156
|
+
Response.new(successful?(response), message_from(response[:message]), response,
|
157
|
+
:test => test?,
|
158
|
+
:authorization => authorization_from(response)
|
159
|
+
)
|
160
|
+
end
|
161
|
+
|
162
|
+
# Generates a Moneris authorization string of the form 'trans_id;receipt_id'.
|
163
|
+
def authorization_from(response = {})
|
164
|
+
if response[:trans_id] && response[:receipt_id]
|
165
|
+
"#{response[:trans_id]};#{response[:receipt_id]}"
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
# Tests for a successful response from Moneris' servers
|
170
|
+
def successful?(response)
|
171
|
+
response[:response_code] &&
|
172
|
+
response[:complete] &&
|
173
|
+
(0..49).include?(response[:response_code].to_i)
|
174
|
+
end
|
175
|
+
|
176
|
+
def parse(xml)
|
177
|
+
response = { :message => "Global Error Receipt", :complete => false }
|
178
|
+
hashify_xml!(xml, response)
|
179
|
+
response
|
180
|
+
end
|
181
|
+
|
182
|
+
def hashify_xml!(xml, response)
|
183
|
+
xml = REXML::Document.new(xml)
|
184
|
+
return if xml.root.nil?
|
185
|
+
xml.elements.each('//receipt/*') do |node|
|
186
|
+
response[node.name.underscore.to_sym] = normalize(node.text)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def post_data(action, parameters = {})
|
191
|
+
xml = REXML::Document.new
|
192
|
+
root = xml.add_element("request")
|
193
|
+
root.add_element("store_id").text = options[:login]
|
194
|
+
root.add_element("api_token").text = options[:password]
|
195
|
+
transaction = root.add_element(action)
|
196
|
+
|
197
|
+
# Must add the elements in the correct order
|
198
|
+
actions[action].each do |key|
|
199
|
+
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
|
200
|
+
end
|
201
|
+
|
202
|
+
xml.to_s
|
203
|
+
end
|
204
|
+
|
205
|
+
def message_from(message)
|
206
|
+
return 'Unspecified error' if message.blank?
|
207
|
+
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
208
|
+
end
|
209
|
+
|
210
|
+
# Make a Ruby type out of the response string
|
211
|
+
def normalize(field)
|
212
|
+
case field
|
213
|
+
when "true" then true
|
214
|
+
when "false" then false
|
215
|
+
when '', "null" then nil
|
216
|
+
else field
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
def actions
|
221
|
+
{
|
222
|
+
"purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
223
|
+
"preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
224
|
+
"command" => [:order_id],
|
225
|
+
"refund" => [:order_id, :amount, :txn_number, :crypt_type],
|
226
|
+
"indrefund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
227
|
+
"completion" => [:order_id, :comp_amount, :txn_number, :crypt_type],
|
228
|
+
"purchasecorrection" => [:order_id, :txn_number, :crypt_type],
|
229
|
+
"cavvpurcha" => [:order_id, :cust_id, :amount, :pan, :expdate, :cav],
|
230
|
+
"cavvpreaut" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv],
|
231
|
+
"transact" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
232
|
+
"Batchcloseall" => [],
|
233
|
+
"opentotals" => [:ecr_number],
|
234
|
+
"batchclose" => [:ecr_number],
|
235
|
+
"res_add_cc" => [:pan, :expdate, :crypt_type],
|
236
|
+
"res_delete" => [:data_key],
|
237
|
+
"res_update_cc" => [:data_key, :pan, :expdate, :crypt_type],
|
238
|
+
"res_purchase_cc" => [:data_key, :order_id, :cust_id, :amount, :crypt_type],
|
239
|
+
"res_preauth_cc" => [:data_key, :order_id, :cust_id, :amount, :crypt_type]
|
240
|
+
}
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -0,0 +1,208 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
|
6
|
+
# To learn more about the Moneris (US) gateway, please contact
|
7
|
+
# ussales@moneris.com for a copy of their integration guide. For
|
8
|
+
# information on remote testing, please see "Test Environment Penny Value
|
9
|
+
# Response Table", and "Test Environment eFraud (AVS and CVD) Penny
|
10
|
+
# Response Values", available at Moneris' {eSelect Plus Documentation
|
11
|
+
# Centre}[https://www3.moneris.com/connect/en/documents/index.html].
|
12
|
+
class MonerisUsGateway < Gateway
|
13
|
+
self.test_url = 'https://esplusqa.moneris.com/gateway_us/servlet/MpgRequest'
|
14
|
+
self.live_url = 'https://esplus.moneris.com/gateway_us/servlet/MpgRequest'
|
15
|
+
|
16
|
+
self.supported_countries = ['US']
|
17
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover]
|
18
|
+
self.homepage_url = 'http://www.monerisusa.com/'
|
19
|
+
self.display_name = 'Moneris (US)'
|
20
|
+
|
21
|
+
# login is your Store ID
|
22
|
+
# password is your API Token
|
23
|
+
def initialize(options = {})
|
24
|
+
requires!(options, :login, :password)
|
25
|
+
options = { :crypt_type => 7 }.merge(options)
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
29
|
+
# Referred to as "PreAuth" in the Moneris integration guide, this action
|
30
|
+
# verifies and locks funds on a customer's card, which then must be
|
31
|
+
# captured at a later date.
|
32
|
+
#
|
33
|
+
# Pass in +order_id+ and optionally a +customer+ parameter.
|
34
|
+
def authorize(money, creditcard, options = {})
|
35
|
+
debit_commit 'us_preauth', money, creditcard, options
|
36
|
+
end
|
37
|
+
|
38
|
+
# This action verifies funding on a customer's card, and readies them for
|
39
|
+
# deposit in a merchant's account.
|
40
|
+
#
|
41
|
+
# Pass in <tt>order_id</tt> and optionally a <tt>customer</tt> parameter
|
42
|
+
def purchase(money, creditcard, options = {})
|
43
|
+
debit_commit 'us_purchase', money, creditcard, options
|
44
|
+
end
|
45
|
+
|
46
|
+
# This method retrieves locked funds from a customer's account (from a
|
47
|
+
# PreAuth) and prepares them for deposit in a merchant's account.
|
48
|
+
#
|
49
|
+
# Note: Moneris requires both the order_id and the transaction number of
|
50
|
+
# the original authorization. To maintain the same interface as the other
|
51
|
+
# gateways the two numbers are concatenated together with a ; separator as
|
52
|
+
# the authorization number returned by authorization
|
53
|
+
def capture(money, authorization, options = {})
|
54
|
+
commit 'us_completion', crediting_params(authorization, :comp_amount => amount(money))
|
55
|
+
end
|
56
|
+
|
57
|
+
# Voiding requires the original transaction ID and order ID of some open
|
58
|
+
# transaction. Closed transactions must be refunded. Note that the only
|
59
|
+
# methods which may be voided are +capture+ and +purchase+.
|
60
|
+
#
|
61
|
+
# Concatenate your transaction number and order_id by using a semicolon
|
62
|
+
# (';'). This is to keep the Moneris interface consistent with other
|
63
|
+
# gateways. (See +capture+ for details.)
|
64
|
+
def void(authorization, options = {})
|
65
|
+
commit 'us_purchasecorrection', crediting_params(authorization)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Performs a refund. This method requires that the original transaction
|
69
|
+
# number and order number be included. Concatenate your transaction
|
70
|
+
# number and order_id by using a semicolon (';'). This is to keep the
|
71
|
+
# Moneris interface consistent with other gateways. (See +capture+ for
|
72
|
+
# details.)
|
73
|
+
def credit(money, authorization, options = {})
|
74
|
+
deprecated CREDIT_DEPRECATION_MESSAGE
|
75
|
+
refund(money, authorization, options)
|
76
|
+
end
|
77
|
+
|
78
|
+
def refund(money, authorization, options = {})
|
79
|
+
commit 'us_refund', crediting_params(authorization, :amount => amount(money))
|
80
|
+
end
|
81
|
+
|
82
|
+
private # :nodoc: all
|
83
|
+
|
84
|
+
def expdate(creditcard)
|
85
|
+
sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
|
86
|
+
end
|
87
|
+
|
88
|
+
def debit_commit(commit_type, money, creditcard, options)
|
89
|
+
requires!(options, :order_id)
|
90
|
+
commit(commit_type, debit_params(money, creditcard, options))
|
91
|
+
end
|
92
|
+
|
93
|
+
# Common params used amongst the +purchase+ and +authorization+ methods
|
94
|
+
def debit_params(money, creditcard, options = {})
|
95
|
+
{
|
96
|
+
:order_id => options[:order_id],
|
97
|
+
:cust_id => options[:customer],
|
98
|
+
:amount => amount(money),
|
99
|
+
:pan => creditcard.number,
|
100
|
+
:expdate => expdate(creditcard),
|
101
|
+
:crypt_type => options[:crypt_type] || @options[:crypt_type]
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# Common params used amongst the +credit+, +void+ and +capture+ methods
|
106
|
+
def crediting_params(authorization, options = {})
|
107
|
+
{
|
108
|
+
:txn_number => split_authorization(authorization).first,
|
109
|
+
:order_id => split_authorization(authorization).last,
|
110
|
+
:crypt_type => options[:crypt_type] || @options[:crypt_type]
|
111
|
+
}.merge(options)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Splits an +authorization+ param and retrives the order id and
|
115
|
+
# transaction number in that order.
|
116
|
+
def split_authorization(authorization)
|
117
|
+
if authorization.nil? || authorization.empty? || authorization !~ /;/
|
118
|
+
raise ArgumentError, 'You must include a valid authorization code (e.g. "1234;567")'
|
119
|
+
else
|
120
|
+
authorization.split(';')
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def commit(action, parameters = {})
|
125
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(action, parameters)))
|
126
|
+
|
127
|
+
Response.new(successful?(response), message_from(response[:message]), response,
|
128
|
+
:test => test?,
|
129
|
+
:authorization => authorization_from(response)
|
130
|
+
)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Generates a Moneris authorization string of the form 'trans_id;receipt_id'.
|
134
|
+
def authorization_from(response = {})
|
135
|
+
if response[:trans_id] && response[:receipt_id]
|
136
|
+
"#{response[:trans_id]};#{response[:receipt_id]}"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Tests for a successful response from Moneris' servers
|
141
|
+
def successful?(response)
|
142
|
+
response[:response_code] &&
|
143
|
+
response[:complete] &&
|
144
|
+
(0..49).include?(response[:response_code].to_i)
|
145
|
+
end
|
146
|
+
|
147
|
+
def parse(xml)
|
148
|
+
response = { :message => "Global Error Receipt", :complete => false }
|
149
|
+
hashify_xml!(xml, response)
|
150
|
+
response
|
151
|
+
end
|
152
|
+
|
153
|
+
def hashify_xml!(xml, response)
|
154
|
+
xml = REXML::Document.new(xml)
|
155
|
+
return if xml.root.nil?
|
156
|
+
xml.elements.each('//receipt/*') do |node|
|
157
|
+
response[node.name.underscore.to_sym] = normalize(node.text)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def post_data(action, parameters = {})
|
162
|
+
xml = REXML::Document.new
|
163
|
+
root = xml.add_element("request")
|
164
|
+
root.add_element("store_id").text = options[:login]
|
165
|
+
root.add_element("api_token").text = options[:password]
|
166
|
+
transaction = root.add_element(action)
|
167
|
+
|
168
|
+
# Must add the elements in the correct order
|
169
|
+
actions[action].each do |key|
|
170
|
+
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
|
171
|
+
end
|
172
|
+
|
173
|
+
xml.to_s
|
174
|
+
end
|
175
|
+
|
176
|
+
def message_from(message)
|
177
|
+
return 'Unspecified error' if message.blank?
|
178
|
+
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
179
|
+
end
|
180
|
+
|
181
|
+
# Make a Ruby type out of the response string
|
182
|
+
def normalize(field)
|
183
|
+
case field
|
184
|
+
when "true" then true
|
185
|
+
when "false" then false
|
186
|
+
when '', "null" then nil
|
187
|
+
else field
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def actions
|
192
|
+
{
|
193
|
+
"us_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
194
|
+
"us_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
195
|
+
"us_refund" => [:order_id, :amount, :txn_number, :crypt_type],
|
196
|
+
"us_ind_refund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
197
|
+
"us_completion" => [:order_id, :comp_amount, :txn_number, :crypt_type],
|
198
|
+
"us_purchasecorrection" => [:order_id, :txn_number, :crypt_type],
|
199
|
+
"us_cavv_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv],
|
200
|
+
"us_cavv_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv],
|
201
|
+
"us_batchcloseall" => [],
|
202
|
+
"us_opentotals" => [:ecr_number],
|
203
|
+
"us_batchclose" => [:ecr_number]
|
204
|
+
}
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|