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,340 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
module ActiveMerchant #:nodoc:
|
3
|
+
module Billing #:nodoc:
|
4
|
+
module Integrations #:nodoc:
|
5
|
+
|
6
|
+
# # Example:
|
7
|
+
# parser = AuthorizeNetSim::Notification.new(request.raw_post)
|
8
|
+
# passed = parser.complete?
|
9
|
+
#
|
10
|
+
# order = Order.find_by_order_number(parser.invoice_num)
|
11
|
+
#
|
12
|
+
# unless order
|
13
|
+
# @message = 'Error--unable to find your transaction! Please contact us directly.'
|
14
|
+
# return render :partial => 'authorize_net_sim_payment_response'
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# if order.total != parser.gross.to_f
|
18
|
+
# logger.error "Authorize.Net sim said they paid for #{parser.gross} and it should have been #{order.total}!"
|
19
|
+
# passed = false
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# # Theoretically, Authorize.net will *never* pass us the same transaction
|
23
|
+
# # ID twice, but we can double check that... by using
|
24
|
+
# # parser.transaction_id, and checking against previous orders' transaction
|
25
|
+
# # id's (which you can save when the order is completed)....
|
26
|
+
# unless parser.acknowledge MD5_HASH_SET_IN_AUTHORIZE_NET, AUTHORIZE_LOGIN
|
27
|
+
# passed = false
|
28
|
+
# logger.error "ALERT POSSIBLE FRAUD ATTEMPT either that or you haven't setup your md5 hash setting right in #{__FILE__}
|
29
|
+
# because a transaction came back from Authorize.Net with the wrong hash value--rejecting!"
|
30
|
+
# end
|
31
|
+
#
|
32
|
+
# unless parser.cavv_matches? and parser.avs_code_matches?
|
33
|
+
# logger.error 'Warning--non matching CC!' + params.inspect
|
34
|
+
# # Could fail them here, as well (recommended)...
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# if passed
|
38
|
+
# # Set up your session, and render something that will redirect them to
|
39
|
+
# # your site, most likely.
|
40
|
+
# else
|
41
|
+
# # Render failure or redirect them to your site where you will render failure
|
42
|
+
# end
|
43
|
+
|
44
|
+
module AuthorizeNetSim
|
45
|
+
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
46
|
+
|
47
|
+
def unescape(val) #:nodoc:
|
48
|
+
if val
|
49
|
+
CGI::unescape val
|
50
|
+
else
|
51
|
+
val
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Passes a hash of the address the user entered in at Authorize.Net
|
56
|
+
def billing_address
|
57
|
+
all = {}
|
58
|
+
[:fax, :city, :company, :last_name, :country, :zip, :first_name, :address, :email, :state].each do |key_out|
|
59
|
+
all[key_out] = unescape params['x_' + key_out.to_s]
|
60
|
+
end
|
61
|
+
all
|
62
|
+
end
|
63
|
+
|
64
|
+
def customer_id
|
65
|
+
unescape params['x_cust_id']
|
66
|
+
end
|
67
|
+
|
68
|
+
def auth_code
|
69
|
+
unescape params['x_auth_code']
|
70
|
+
end
|
71
|
+
|
72
|
+
def po_num
|
73
|
+
unescape params['x_po_num']
|
74
|
+
end
|
75
|
+
|
76
|
+
def ship_to_address
|
77
|
+
all = {}
|
78
|
+
[:city, :last_name, :first_name, :country, :zip, :address].each do |key_out|
|
79
|
+
all[key_out] = unescape params['x_ship_to_' + key_out.to_s]
|
80
|
+
end
|
81
|
+
all
|
82
|
+
end
|
83
|
+
|
84
|
+
# Tax amount we sent them.
|
85
|
+
def tax
|
86
|
+
unescape params['x_tax']
|
87
|
+
end
|
88
|
+
|
89
|
+
# Transaction type (probably going to be auth_capture, since that's
|
90
|
+
# all we set it as).
|
91
|
+
def transaction_type
|
92
|
+
unescape params['x_type']
|
93
|
+
end
|
94
|
+
|
95
|
+
# Payment method used--almost always CC (for credit card).
|
96
|
+
def method
|
97
|
+
unescape params['x_method']
|
98
|
+
end
|
99
|
+
|
100
|
+
# Ff our payment method is available. Almost always "true".
|
101
|
+
def method_available
|
102
|
+
params['x_method_available']
|
103
|
+
end
|
104
|
+
|
105
|
+
# Invoice num we passed in as invoice_num to them.
|
106
|
+
def invoice_num
|
107
|
+
item_id
|
108
|
+
end
|
109
|
+
|
110
|
+
# If you pass any values to authorize that aren't its expected, it
|
111
|
+
# will pass them back to you verbatim, returned by this method.
|
112
|
+
# custom values:
|
113
|
+
def all_custom_values_passed_in_and_now_passed_back_to_us
|
114
|
+
all = {}
|
115
|
+
params.each do |key, value|
|
116
|
+
if key[0..1] != 'x_'
|
117
|
+
all[key] = unescape value
|
118
|
+
end
|
119
|
+
end
|
120
|
+
all
|
121
|
+
end
|
122
|
+
|
123
|
+
def duty
|
124
|
+
unescape params['x_duty']
|
125
|
+
end
|
126
|
+
|
127
|
+
# Shipping we sent them.
|
128
|
+
def freight
|
129
|
+
unescape params['x_freight']
|
130
|
+
end
|
131
|
+
alias_method :shipping, :freight
|
132
|
+
|
133
|
+
def description
|
134
|
+
unescape params['x_description']
|
135
|
+
end
|
136
|
+
|
137
|
+
# Returns the response code as a symbol.
|
138
|
+
# {'1' => :approved, '2' => :declined, '3' => :error, '4' => :held_for_review}
|
139
|
+
def response_code_as_ruby_symbol
|
140
|
+
map = {'1' => :approved, '2' => :declined, '3' => :error, '4' => :held_for_review}
|
141
|
+
map[params['x_response_code']]
|
142
|
+
end
|
143
|
+
|
144
|
+
def response_reason_text
|
145
|
+
unescape params['x_response_reason_text']
|
146
|
+
end
|
147
|
+
|
148
|
+
# The response reason text's numeric id [equivalent--just a number]
|
149
|
+
def response_reason_code
|
150
|
+
unescape params['x_response_reason_code']
|
151
|
+
end
|
152
|
+
|
153
|
+
# 'used internally by their gateway'
|
154
|
+
def response_subcode
|
155
|
+
params['x_response_subcode']
|
156
|
+
end
|
157
|
+
|
158
|
+
# They pass back a tax_exempt value.
|
159
|
+
def tax_exempt
|
160
|
+
params['x_tax_exempt']
|
161
|
+
end
|
162
|
+
|
163
|
+
# avs [address verification] code
|
164
|
+
# A = Address (Street)
|
165
|
+
# matches, ZIP does not
|
166
|
+
# B = Address information
|
167
|
+
# not provided for AVS
|
168
|
+
# check
|
169
|
+
# E = AVS error
|
170
|
+
# G = Non-U.S. Card Issuing
|
171
|
+
# Bank
|
172
|
+
# N = No Match on Address
|
173
|
+
# (Street) or ZIP
|
174
|
+
# P = AVS not applicable for
|
175
|
+
# this transaction
|
176
|
+
# R = Retry – System
|
177
|
+
# unavailable or timed out
|
178
|
+
# S = Service not supported
|
179
|
+
# by issuer
|
180
|
+
# U = Address information is
|
181
|
+
# unavailable
|
182
|
+
# W = Nine digit ZIP
|
183
|
+
# matches, Address (Street)
|
184
|
+
# does not
|
185
|
+
# X = Address (Street) and
|
186
|
+
# nine digit ZIP match
|
187
|
+
# Y = Address (Street) and
|
188
|
+
# five digit ZIP match
|
189
|
+
# Z = Five digit ZIP matches
|
190
|
+
# Address (Street) does not
|
191
|
+
def avs_code
|
192
|
+
params['x_avs_code']
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns true if their address completely matched [Y or X, P from
|
196
|
+
# #avs_code, which mean 'add+zip match', 'address + 9-zip match', and
|
197
|
+
# not applicable, respectively].
|
198
|
+
def avs_code_matches?
|
199
|
+
return ['Y', 'X', 'P'].include? params['x_avs_code']
|
200
|
+
end
|
201
|
+
|
202
|
+
# cvv2 response
|
203
|
+
# M = Match
|
204
|
+
# N = No Match
|
205
|
+
# P = Not Processed
|
206
|
+
# S = Should have been
|
207
|
+
# present
|
208
|
+
# U = Issuer unable to
|
209
|
+
# process request
|
210
|
+
def cvv2_resp_code
|
211
|
+
params['x_cvv2_resp_code']
|
212
|
+
end
|
213
|
+
|
214
|
+
# check if #cvv2_resp_code == 'm' for Match. otherwise false
|
215
|
+
def cvv2_resp_code_matches?
|
216
|
+
return ['M'].include? cvv2_resp_code
|
217
|
+
end
|
218
|
+
|
219
|
+
# cavv_response--'cardholder authentication verification response code'--most likely not use for SIM
|
220
|
+
# Blank or not present =
|
221
|
+
# CAVV not validated
|
222
|
+
# 0 = CAVV not validated
|
223
|
+
# because erroneous data
|
224
|
+
# was submitted
|
225
|
+
# 1 = CAVV failed validation
|
226
|
+
# 2 = CAVV passed
|
227
|
+
# validation
|
228
|
+
# 3 = CAVV validation could
|
229
|
+
# not be performed; issuer
|
230
|
+
# attempt incomplete
|
231
|
+
# 4 = CAVV validation could
|
232
|
+
# not be performed; issuer
|
233
|
+
# system error
|
234
|
+
# 5 = Reserved for future
|
235
|
+
# use
|
236
|
+
# 6 = Reserved for future
|
237
|
+
# use
|
238
|
+
# 7 = CAVV attempt – failed
|
239
|
+
# validation – issuer
|
240
|
+
# available (U.S.-issued
|
241
|
+
# card/non-U.S acquirer)
|
242
|
+
# 8 = CAVV attempt –
|
243
|
+
# passed validation – issuer
|
244
|
+
# available (U.S.-issued
|
245
|
+
# card/non-U.S. acquirer)
|
246
|
+
# 9 = CAVV attempt – failed
|
247
|
+
# validation – issuer
|
248
|
+
def cavv_response
|
249
|
+
params['x_cavv_response']
|
250
|
+
end
|
251
|
+
|
252
|
+
# Check if #cavv_response == '', '2', '8' one of those [non failing]
|
253
|
+
# [blank means no validated, 2 is passed, 8 is passed issuer
|
254
|
+
# available]
|
255
|
+
def cavv_matches?
|
256
|
+
['','2','8'].include? cavv_response
|
257
|
+
end
|
258
|
+
|
259
|
+
# Payment is complete -- returns true if x_response_code == '1'
|
260
|
+
def complete?
|
261
|
+
params["x_response_code"] == '1'
|
262
|
+
end
|
263
|
+
|
264
|
+
# Alias for invoice number--this is the only id they pass back to us
|
265
|
+
# that we passed to them, except customer id is also passed back.
|
266
|
+
def item_id
|
267
|
+
unescape params['x_invoice_num']
|
268
|
+
end
|
269
|
+
|
270
|
+
# They return this number to us [it's unique to Authorize.net].
|
271
|
+
def transaction_id
|
272
|
+
params['x_trans_id']
|
273
|
+
end
|
274
|
+
|
275
|
+
# When was this payment was received by the client. --unimplemented --
|
276
|
+
# always returns nil
|
277
|
+
def received_at
|
278
|
+
nil
|
279
|
+
end
|
280
|
+
|
281
|
+
# End-user's email
|
282
|
+
def payer_email
|
283
|
+
unescape params['x_email']
|
284
|
+
end
|
285
|
+
|
286
|
+
# They don't pass merchant email back to us -- unimplemented -- always
|
287
|
+
# returns nil
|
288
|
+
def receiver_email
|
289
|
+
nil
|
290
|
+
end
|
291
|
+
|
292
|
+
# md5 hash used internally
|
293
|
+
def security_key
|
294
|
+
params['x_MD5_Hash']
|
295
|
+
end
|
296
|
+
|
297
|
+
# The money amount we received in X.2 decimal. Returns a string
|
298
|
+
def gross
|
299
|
+
unescape params['x_amount']
|
300
|
+
end
|
301
|
+
|
302
|
+
# Was this a test transaction?
|
303
|
+
def test?
|
304
|
+
params['x_test_request'] == 'true'
|
305
|
+
end
|
306
|
+
|
307
|
+
# #method_available alias
|
308
|
+
def status
|
309
|
+
complete?
|
310
|
+
end
|
311
|
+
|
312
|
+
# Called to request back and check if it was a valid request.
|
313
|
+
# Authorize.net passes us back a hash that includes a hash of our
|
314
|
+
# 'unique' MD5 value that we set within their system.
|
315
|
+
#
|
316
|
+
# Example:
|
317
|
+
# acknowledge('my secret md5 hash that I set within Authorize.Net', 'authorize_login')
|
318
|
+
#
|
319
|
+
# Note this is somewhat unsafe unless you actually set that md5 hash
|
320
|
+
# to something (defaults to '' in their system).
|
321
|
+
def acknowledge(md5_hash_set_in_authorize_net, authorize_net_login_name)
|
322
|
+
Digest::MD5.hexdigest(md5_hash_set_in_authorize_net + authorize_net_login_name + params['x_trans_id'] + gross) == params['x_MD5_Hash'].downcase
|
323
|
+
end
|
324
|
+
|
325
|
+
private
|
326
|
+
|
327
|
+
# Take the posted data and move the relevant data into a hash.
|
328
|
+
def parse(post)
|
329
|
+
@raw = post
|
330
|
+
post.split('&').each do |line|
|
331
|
+
key, value = *line.scan( %r{^(\w+)\=(.*)$} ).flatten
|
332
|
+
params[key] = value
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
end
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module AuthorizeNetSim
|
5
|
+
autoload :Helper, 'active_merchant/billing/integrations/authorize_net_sim/helper.rb'
|
6
|
+
autoload :Notification, 'active_merchant/billing/integrations/authorize_net_sim/notification.rb'
|
7
|
+
|
8
|
+
# Overwrite this if you want to change the ANS test url
|
9
|
+
mattr_accessor :test_url
|
10
|
+
self.test_url = 'https://test.authorize.net/gateway/transact.dll'
|
11
|
+
|
12
|
+
# Overwrite this if you want to change the ANS production url
|
13
|
+
mattr_accessor :production_url
|
14
|
+
self.production_url = 'https://secure.authorize.net/gateway/transact.dll'
|
15
|
+
|
16
|
+
def self.service_url
|
17
|
+
mode = ActiveMerchant::Billing::Base.integration_mode
|
18
|
+
case mode
|
19
|
+
when :production
|
20
|
+
self.production_url
|
21
|
+
when :test
|
22
|
+
self.test_url
|
23
|
+
else
|
24
|
+
raise StandardError, "Integration mode set to an invalid value: #{mode}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.notification(post)
|
29
|
+
Notification.new(post)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.return(query_string)
|
33
|
+
Return.new(query_string)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Bogus
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
mapping :account, 'account'
|
7
|
+
mapping :order, 'order'
|
8
|
+
mapping :amount, 'amount'
|
9
|
+
mapping :currency, 'currency'
|
10
|
+
mapping :customer, :first_name => 'first_name',
|
11
|
+
:last_name => 'last_name'
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
module ActiveMerchant #:nodoc:
|
3
|
+
module Billing #:nodoc:
|
4
|
+
module Integrations #:nodoc:
|
5
|
+
module Bogus
|
6
|
+
autoload :Return, 'active_merchant/billing/integrations/bogus/return.rb'
|
7
|
+
autoload :Helper, 'active_merchant/billing/integrations/bogus/helper.rb'
|
8
|
+
autoload :Notification, 'active_merchant/billing/integrations/bogus/notification.rb'
|
9
|
+
|
10
|
+
mattr_accessor :service_url
|
11
|
+
self.service_url = 'http://www.bogus.com'
|
12
|
+
|
13
|
+
def self.notification(post, options = {})
|
14
|
+
Notification.new(post)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.return(query_string, options = {})
|
18
|
+
Return.new(query_string)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Chronopay
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
# All currently supported checkout languages:
|
7
|
+
# es (Spanish)
|
8
|
+
# en (English)
|
9
|
+
# de (German)
|
10
|
+
# pt (Portuguese)
|
11
|
+
# lv (Latvian)
|
12
|
+
# cn1 (Chinese Version 1)
|
13
|
+
# cn2 (Chinese version 2)
|
14
|
+
# nl (Dutch)
|
15
|
+
# ru (Russian)
|
16
|
+
COUNTRIES_FOR_LANG = {
|
17
|
+
'ES' => %w( AR BO CL CO CR CU DO EC SV GQ GT HN MX NI PA PY PE ES UY VE),
|
18
|
+
'DE' => %w( DE AT CH LI ),
|
19
|
+
'PT' => %w( AO BR CV GW MZ PT ST TL),
|
20
|
+
'RU' => %w( BY KG KZ RU ),
|
21
|
+
'LV' => %w( LV ),
|
22
|
+
'CN1' => %w( CN ),
|
23
|
+
'NL' => %w( NL )
|
24
|
+
}
|
25
|
+
|
26
|
+
LANG_FOR_COUNTRY = COUNTRIES_FOR_LANG.inject(Hash.new("EN")) do |memo, (lang, countries)|
|
27
|
+
countries.each do |code|
|
28
|
+
memo[code] = lang
|
29
|
+
end
|
30
|
+
memo
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
self.country_format = :alpha3
|
35
|
+
|
36
|
+
def initialize(order, account, options = {})
|
37
|
+
super
|
38
|
+
add_field('cb_type', 'p')
|
39
|
+
end
|
40
|
+
|
41
|
+
# product_id
|
42
|
+
mapping :account, 'product_id'
|
43
|
+
# product_name
|
44
|
+
mapping :invoice, 'product_name'
|
45
|
+
# product_price
|
46
|
+
mapping :amount, 'product_price'
|
47
|
+
# product_price_currency
|
48
|
+
mapping :currency, 'product_price_currency'
|
49
|
+
|
50
|
+
# f_name
|
51
|
+
# s_name
|
52
|
+
# email
|
53
|
+
mapping :customer, :first_name => 'f_name',
|
54
|
+
:last_name => 's_name',
|
55
|
+
:phone => 'phone',
|
56
|
+
:email => 'email'
|
57
|
+
|
58
|
+
# city
|
59
|
+
# street
|
60
|
+
# state
|
61
|
+
# zip
|
62
|
+
# country - The country must be a 3 digit country code
|
63
|
+
# phone
|
64
|
+
|
65
|
+
mapping :billing_address, :city => 'city',
|
66
|
+
:address1 => 'street',
|
67
|
+
:state => 'state',
|
68
|
+
:zip => 'zip',
|
69
|
+
:country => 'country'
|
70
|
+
|
71
|
+
def billing_address(mapping = {})
|
72
|
+
# Gets the country code in the appropriate format or returns what we were given
|
73
|
+
# The appropriate format for Chronopay is the alpha 3 country code
|
74
|
+
country_code = lookup_country_code(mapping.delete(:country))
|
75
|
+
add_field(mappings[:billing_address][:country], country_code)
|
76
|
+
|
77
|
+
countries_with_supported_states = ['USA', 'CAN']
|
78
|
+
if !countries_with_supported_states.include?(country_code)
|
79
|
+
mapping.delete(:state)
|
80
|
+
add_field(mappings[:billing_address][:state], 'XX')
|
81
|
+
end
|
82
|
+
mapping.each do |k, v|
|
83
|
+
field = mappings[:billing_address][k]
|
84
|
+
add_field(field, v) unless field.nil?
|
85
|
+
end
|
86
|
+
add_field('language', checkout_language_from_country(country_code))
|
87
|
+
end
|
88
|
+
|
89
|
+
# card_no
|
90
|
+
# exp_month
|
91
|
+
# exp_year
|
92
|
+
mapping :credit_card, :number => 'card_no',
|
93
|
+
:expiry_month => 'exp_month',
|
94
|
+
:expiry_year => 'exp_year'
|
95
|
+
|
96
|
+
# cb_url
|
97
|
+
mapping :notify_url, 'cb_url'
|
98
|
+
|
99
|
+
# cs1
|
100
|
+
mapping :order, 'cs1'
|
101
|
+
|
102
|
+
# cs2
|
103
|
+
# cs3
|
104
|
+
# decline_url
|
105
|
+
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def checkout_language_from_country(country_code)
|
110
|
+
country = Country.find(country_code)
|
111
|
+
short_code = country.code(:alpha2).to_s
|
112
|
+
LANG_FOR_COUNTRY[short_code]
|
113
|
+
rescue InvalidCountryCodeError
|
114
|
+
'EN'
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|