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,272 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'check.rb')
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class SmartPs < Gateway #:nodoc:
|
6
|
+
|
7
|
+
##
|
8
|
+
# This is the base gateway for processors who use the smartPS processing system
|
9
|
+
|
10
|
+
self.abstract_class = true
|
11
|
+
|
12
|
+
def initialize(options = {})
|
13
|
+
requires!(options, :login, :password)
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
# Pass :store => true in the options to store the
|
18
|
+
# payment info at the gateway and get a generated
|
19
|
+
# customer_vault_id in the response.
|
20
|
+
# Pass :store => some_number_or_string to specify the
|
21
|
+
# customer_vault_id the gateway should use (make sure it's
|
22
|
+
# unique).
|
23
|
+
def authorize(money, creditcard, options = {})
|
24
|
+
post = {}
|
25
|
+
add_invoice(post, options)
|
26
|
+
add_payment_source(post, creditcard,options)
|
27
|
+
add_address(post, options[:billing_address] || options[:address])
|
28
|
+
add_address(post, options[:shipping_address], "shipping")
|
29
|
+
add_customer_data(post, options)
|
30
|
+
add_currency(post, money, options)
|
31
|
+
add_taxes(post, options)
|
32
|
+
add_processor(post, options)
|
33
|
+
commit('auth', money, post)
|
34
|
+
end
|
35
|
+
|
36
|
+
def purchase(money, payment_source, options = {})
|
37
|
+
post = {}
|
38
|
+
add_invoice(post, options)
|
39
|
+
add_payment_source(post, payment_source, options)
|
40
|
+
add_address(post, options[:billing_address] || options[:address])
|
41
|
+
add_address(post, options[:shipping_address], "shipping")
|
42
|
+
add_customer_data(post, options)
|
43
|
+
add_currency(post, money, options)
|
44
|
+
add_taxes(post, options)
|
45
|
+
add_processor(post, options)
|
46
|
+
commit('sale', money, post)
|
47
|
+
end
|
48
|
+
|
49
|
+
def capture(money, authorization, options = {})
|
50
|
+
post ={}
|
51
|
+
post[:transactionid] = authorization
|
52
|
+
commit('capture', money, post)
|
53
|
+
end
|
54
|
+
|
55
|
+
def void(authorization, options = {})
|
56
|
+
post ={}
|
57
|
+
post[:transactionid] = authorization
|
58
|
+
commit('void', nil, post)
|
59
|
+
end
|
60
|
+
|
61
|
+
def credit(money, payment_source, options = {})
|
62
|
+
post = {}
|
63
|
+
add_invoice(post, options)
|
64
|
+
add_payment_source(post, payment_source, options)
|
65
|
+
add_address(post, options[:billing_address] || options[:address])
|
66
|
+
add_customer_data(post, options)
|
67
|
+
add_sku(post,options)
|
68
|
+
add_currency(post, money, options)
|
69
|
+
add_processor(post, options)
|
70
|
+
commit('credit', money, post)
|
71
|
+
end
|
72
|
+
|
73
|
+
def refund(money, auth, options = {})
|
74
|
+
post = {}
|
75
|
+
add_transaction(post, auth)
|
76
|
+
commit('refund', money, post)
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
# Update the values (such as CC expiration) stored at
|
81
|
+
# the gateway. The CC number must be supplied in the
|
82
|
+
# CreditCard object.
|
83
|
+
def update(vault_id, creditcard, options = {})
|
84
|
+
post = {}
|
85
|
+
post[:customer_vault] = "update_customer"
|
86
|
+
add_customer_vault_id(post, vault_id)
|
87
|
+
add_creditcard(post, creditcard, options)
|
88
|
+
add_address(post, options[:billing_address] || options[:address])
|
89
|
+
add_customer_data(post, options)
|
90
|
+
|
91
|
+
commit(nil, nil, post)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Amend an existing transaction
|
95
|
+
def amend(auth, options = {})
|
96
|
+
post = {}
|
97
|
+
add_invoice(post, options)
|
98
|
+
add_transaction(post, auth)
|
99
|
+
commit('update', nil, post)
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
def delete(vault_id)
|
104
|
+
post = {}
|
105
|
+
post[:customer_vault] = "delete_customer"
|
106
|
+
add_customer_vault_id(post, vault_id)
|
107
|
+
commit(nil, nil, post)
|
108
|
+
end
|
109
|
+
|
110
|
+
# To match the other stored-value gateways, like TrustCommerce,
|
111
|
+
# store and unstore need to be defined
|
112
|
+
def store(payment_source, options = {})
|
113
|
+
post = {}
|
114
|
+
billing_id = options.delete(:billing_id).to_s || true
|
115
|
+
add_payment_source(post, payment_source, :store => billing_id)
|
116
|
+
add_address(post, options[:billing_address] || options[:address])
|
117
|
+
add_customer_data(post, options)
|
118
|
+
commit(nil, nil, post)
|
119
|
+
end
|
120
|
+
|
121
|
+
alias_method :unstore, :delete
|
122
|
+
|
123
|
+
private
|
124
|
+
def add_customer_data(post, options)
|
125
|
+
if options.has_key? :email
|
126
|
+
post[:email] = options[:email]
|
127
|
+
end
|
128
|
+
|
129
|
+
if options.has_key? :ip
|
130
|
+
post[:ipaddress] = options[:ip]
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def add_address(post, address,prefix="")
|
135
|
+
prefix +="_" unless prefix.blank?
|
136
|
+
unless address.blank? or address.values.blank?
|
137
|
+
post[prefix+"address1"] = address[:address1].to_s
|
138
|
+
post[prefix+"address2"] = address[:address2].to_s unless address[:address2].blank?
|
139
|
+
post[prefix+"company"] = address[:company].to_s
|
140
|
+
post[prefix+"phone"] = address[:phone].to_s
|
141
|
+
post[prefix+"zip"] = address[:zip].to_s
|
142
|
+
post[prefix+"city"] = address[:city].to_s
|
143
|
+
post[prefix+"country"] = address[:country].to_s
|
144
|
+
post[prefix+"state"] = address[:state].blank? ? 'n/a' : address[:state]
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def add_currency(post, money, options)
|
149
|
+
post[:currency] = options[:currency] || currency(money)
|
150
|
+
end
|
151
|
+
|
152
|
+
def add_taxes(post, options)
|
153
|
+
post[:tax] = amount(options[:tax])
|
154
|
+
end
|
155
|
+
|
156
|
+
def add_processor(post, options)
|
157
|
+
post[:processor] = options[:processor] unless options[:processor].nil?
|
158
|
+
end
|
159
|
+
|
160
|
+
def add_invoice(post, options)
|
161
|
+
post[:orderid] = options[:order_id].to_s.gsub(/[^\w.]/, '')
|
162
|
+
end
|
163
|
+
|
164
|
+
def add_payment_source(params, source, options={})
|
165
|
+
case determine_funding_source(source)
|
166
|
+
when :vault then add_customer_vault_id(params, source)
|
167
|
+
when :credit_card then add_creditcard(params, source, options)
|
168
|
+
when :check then add_check(params, source, options)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def add_customer_vault_id(params, vault_id)
|
173
|
+
params[:customer_vault_id] = vault_id
|
174
|
+
end
|
175
|
+
|
176
|
+
def add_creditcard(post, creditcard, options)
|
177
|
+
if options[:store]
|
178
|
+
post[:customer_vault] = "add_customer"
|
179
|
+
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
180
|
+
end
|
181
|
+
post[:ccnumber] = creditcard.number
|
182
|
+
post[:cvv] = creditcard.verification_value if creditcard.verification_value?
|
183
|
+
post[:ccexp] = expdate(creditcard)
|
184
|
+
post[:firstname] = creditcard.first_name
|
185
|
+
post[:lastname] = creditcard.last_name
|
186
|
+
end
|
187
|
+
|
188
|
+
def add_check(post, check, options)
|
189
|
+
if options[:store]
|
190
|
+
post[:customer_vault] = "add_customer"
|
191
|
+
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
192
|
+
end
|
193
|
+
|
194
|
+
post[:payment] = 'check' # Set transaction to ACH
|
195
|
+
post[:checkname] = check.name # The name on the customer's Checking Account
|
196
|
+
post[:checkaba] = check.routing_number # The customer's bank routing number
|
197
|
+
post[:checkaccount] = check.account_number # The customer's account number
|
198
|
+
post[:account_holder_type] = check.account_holder_type # The customer's type of ACH account
|
199
|
+
post[:account_type] = check.account_type # The customer's type of ACH account
|
200
|
+
end
|
201
|
+
|
202
|
+
def add_sku(post,options)
|
203
|
+
post["product_sku_#"] = options[:sku] || options["product_sku_#"]
|
204
|
+
end
|
205
|
+
|
206
|
+
def add_transaction(post, auth)
|
207
|
+
post[:transactionid] = auth
|
208
|
+
end
|
209
|
+
|
210
|
+
def parse(body)
|
211
|
+
results = {}
|
212
|
+
body.split(/&/).each do |pair|
|
213
|
+
key,val = pair.split(/=/)
|
214
|
+
results[key] = val
|
215
|
+
end
|
216
|
+
|
217
|
+
results
|
218
|
+
end
|
219
|
+
|
220
|
+
def commit(action, money, parameters)
|
221
|
+
parameters[:amount] = amount(money) if money
|
222
|
+
response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
|
223
|
+
Response.new(response["response"] == "1", message_from(response), response,
|
224
|
+
:authorization => (response["transactionid"] || response["customer_vault_id"]),
|
225
|
+
:test => test?,
|
226
|
+
:cvv_result => response["cvvresponse"],
|
227
|
+
:avs_result => { :code => response["avsresponse"] }
|
228
|
+
)
|
229
|
+
|
230
|
+
end
|
231
|
+
|
232
|
+
def expdate(creditcard)
|
233
|
+
year = sprintf("%.04i", creditcard.year.to_i)
|
234
|
+
month = sprintf("%.02i", creditcard.month.to_i)
|
235
|
+
|
236
|
+
"#{month}#{year[-2..-1]}"
|
237
|
+
end
|
238
|
+
|
239
|
+
|
240
|
+
def message_from(response)
|
241
|
+
case response["responsetext"]
|
242
|
+
when "SUCCESS", "Approved", nil # This is dubious, but responses from UPDATE are nil.
|
243
|
+
"This transaction has been approved"
|
244
|
+
when "DECLINE"
|
245
|
+
"This transaction has been declined"
|
246
|
+
else
|
247
|
+
response["responsetext"]
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
def post_data(action, parameters = {})
|
252
|
+
post = {}
|
253
|
+
post[:username] = @options[:login]
|
254
|
+
post[:password] = @options[:password]
|
255
|
+
post[:type] = action if action
|
256
|
+
|
257
|
+
request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&")
|
258
|
+
request
|
259
|
+
end
|
260
|
+
|
261
|
+
def determine_funding_source(source)
|
262
|
+
case
|
263
|
+
when source.is_a?(String) then :vault
|
264
|
+
when CreditCard.card_companies.keys.include?(card_brand(source)) then :credit_card
|
265
|
+
when card_brand(source) == 'check' then :check
|
266
|
+
else raise ArgumentError, "Unsupported funding source provided"
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
@@ -0,0 +1,233 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
# Public: This gateway allows you to interact with any gateway you've
|
6
|
+
# created in Spreedly (https://spreedly.com). It's an adapter which can be
|
7
|
+
# particularly useful if you already have code interacting with
|
8
|
+
# ActiveMerchant and want to easily take advantage of Spreedly's vault.
|
9
|
+
class SpreedlyCoreGateway < Gateway
|
10
|
+
self.live_url = 'https://core.spreedly.com/v1'
|
11
|
+
|
12
|
+
self.supported_countries = %w(AD AE AT AU BD BE BG BN CA CH CY CZ DE DK EE EG ES FI FR GB
|
13
|
+
GI GR HK HU ID IE IL IM IN IS IT JO KW LB LI LK LT LU LV MC
|
14
|
+
MT MU MV MX MY NL NO NZ OM PH PL PT QA RO SA SE SG SI SK SM
|
15
|
+
TR TT UM US VA VN ZA)
|
16
|
+
|
17
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
18
|
+
self.homepage_url = 'https://spreedly.com'
|
19
|
+
self.display_name = 'Spreedly'
|
20
|
+
self.money_format = :cents
|
21
|
+
self.default_currency = 'USD'
|
22
|
+
|
23
|
+
# Public: Create a new Spreedly gateway.
|
24
|
+
#
|
25
|
+
# options - A hash of options:
|
26
|
+
# :login - The environment key.
|
27
|
+
# :password - The access secret.
|
28
|
+
# :gateway_token - The token of the gateway you've created in
|
29
|
+
# Spreedly.
|
30
|
+
def initialize(options = {})
|
31
|
+
requires!(options, :login, :password, :gateway_token)
|
32
|
+
super
|
33
|
+
end
|
34
|
+
|
35
|
+
# Public: Run a purchase transaction.
|
36
|
+
#
|
37
|
+
# money - The monetary amount of the transaction in cents.
|
38
|
+
# payment_method - The CreditCard or the Spreedly payment method token.
|
39
|
+
# options - A standard ActiveMerchant options hash
|
40
|
+
def purchase(money, payment_method, options = {})
|
41
|
+
if payment_method.is_a?(String)
|
42
|
+
purchase_with_token(money, payment_method, options)
|
43
|
+
else
|
44
|
+
MultiResponse.run do |r|
|
45
|
+
r.process { save_card(false, payment_method, options) }
|
46
|
+
r.process { purchase_with_token(money, r.authorization, options) }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Public: Run an authorize transaction.
|
52
|
+
#
|
53
|
+
# money - The monetary amount of the transaction in cents.
|
54
|
+
# payment_method - The CreditCard or the Spreedly payment method token.
|
55
|
+
# options - A standard ActiveMerchant options hash
|
56
|
+
def authorize(money, payment_method, options = {})
|
57
|
+
if payment_method.is_a?(String)
|
58
|
+
authorize_with_token(money, payment_method, options)
|
59
|
+
else
|
60
|
+
MultiResponse.run do |r|
|
61
|
+
r.process { save_card(false, payment_method, options) }
|
62
|
+
r.process { authorize_with_token(money, r.authorization, options) }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def capture(money, authorization, options={})
|
68
|
+
request = build_xml_request('transaction') do |doc|
|
69
|
+
add_invoice(doc, money, options)
|
70
|
+
end
|
71
|
+
|
72
|
+
commit("transactions/#{authorization}/capture.xml", request)
|
73
|
+
end
|
74
|
+
|
75
|
+
def refund(money, authorization, options={})
|
76
|
+
request = build_xml_request('transaction') do |doc|
|
77
|
+
add_invoice(doc, money, options)
|
78
|
+
end
|
79
|
+
|
80
|
+
commit("transactions/#{authorization}/credit.xml", request)
|
81
|
+
end
|
82
|
+
|
83
|
+
def void(authorization, options={})
|
84
|
+
commit("transactions/#{authorization}/void.xml", '')
|
85
|
+
end
|
86
|
+
|
87
|
+
# Public: Store a credit card in the Spreedly vault and retain it.
|
88
|
+
#
|
89
|
+
# credit_card - The CreditCard to store
|
90
|
+
# options - A standard ActiveMerchant options hash
|
91
|
+
def store(credit_card, options={})
|
92
|
+
save_card(true, credit_card, options)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Public: Redact the CreditCard in Spreedly. This wipes the sensitive
|
96
|
+
# payment information from the card.
|
97
|
+
#
|
98
|
+
# credit_card - The CreditCard to store
|
99
|
+
# options - A standard ActiveMerchant options hash
|
100
|
+
def unstore(authorization, options={})
|
101
|
+
commit("payment_methods/#{authorization}/redact.xml", '', :put)
|
102
|
+
end
|
103
|
+
|
104
|
+
private
|
105
|
+
def save_card(retain, credit_card, options)
|
106
|
+
request = build_xml_request('payment_method') do |doc|
|
107
|
+
add_credit_card(doc, credit_card, options)
|
108
|
+
add_data(doc, options)
|
109
|
+
doc.retained(true) if retain
|
110
|
+
end
|
111
|
+
|
112
|
+
commit("payment_methods.xml", request, :post, :payment_method_token)
|
113
|
+
end
|
114
|
+
|
115
|
+
def purchase_with_token(money, payment_method_token, options)
|
116
|
+
request = auth_purchase_request(money, payment_method_token, options)
|
117
|
+
commit("gateways/#{@options[:gateway_token]}/purchase.xml", request)
|
118
|
+
end
|
119
|
+
|
120
|
+
def authorize_with_token(money, payment_method_token, options)
|
121
|
+
request = auth_purchase_request(money, payment_method_token, options)
|
122
|
+
commit("gateways/#{@options[:gateway_token]}/authorize.xml", request)
|
123
|
+
end
|
124
|
+
|
125
|
+
def auth_purchase_request(money, payment_method_token, options)
|
126
|
+
build_xml_request('transaction') do |doc|
|
127
|
+
add_invoice(doc, money, options)
|
128
|
+
doc.payment_method_token(payment_method_token)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def add_invoice(doc, money, options)
|
133
|
+
doc.amount amount(money)
|
134
|
+
doc.currency_code(options[:currency] || currency(money) || default_currency)
|
135
|
+
end
|
136
|
+
|
137
|
+
def add_credit_card(doc, credit_card, options)
|
138
|
+
doc.credit_card do
|
139
|
+
doc.number(credit_card.number)
|
140
|
+
doc.first_name(credit_card.first_name)
|
141
|
+
doc.last_name(credit_card.last_name)
|
142
|
+
doc.month(credit_card.month)
|
143
|
+
doc.year(credit_card.year)
|
144
|
+
doc.email(options[:email])
|
145
|
+
doc.address1(options[:billing_address].try(:[], :address1))
|
146
|
+
doc.address2(options[:billing_address].try(:[], :address2))
|
147
|
+
doc.city(options[:billing_address].try(:[], :city))
|
148
|
+
doc.state(options[:billing_address].try(:[], :state))
|
149
|
+
doc.zip(options[:billing_address].try(:[], :zip))
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def add_data(doc, options)
|
154
|
+
doc.data do
|
155
|
+
data_to_doc(doc, options[:data])
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def data_to_doc(doc, value)
|
160
|
+
return doc.text value unless value.kind_of? Hash
|
161
|
+
value.each do |k, v|
|
162
|
+
doc.send(k) do
|
163
|
+
data_to_doc(doc, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def parse(xml)
|
169
|
+
response = {}
|
170
|
+
|
171
|
+
doc = Nokogiri::XML(xml)
|
172
|
+
doc.root.xpath('*').each do |node|
|
173
|
+
if (node.elements.empty?)
|
174
|
+
response[node.name.downcase.to_sym] = node.text
|
175
|
+
else
|
176
|
+
node.elements.each do |childnode|
|
177
|
+
childnode_to_response(response, node, childnode)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
response
|
183
|
+
end
|
184
|
+
|
185
|
+
def childnode_to_response(response, node, childnode)
|
186
|
+
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
187
|
+
if name == 'payment_method_data' && !childnode.elements.empty?
|
188
|
+
response[name.to_sym] = Hash.from_xml(childnode.to_s).values.first
|
189
|
+
else
|
190
|
+
response[name.to_sym] = childnode.text
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def build_xml_request(root)
|
195
|
+
builder = Nokogiri::XML::Builder.new
|
196
|
+
builder.__send__(root) do |doc|
|
197
|
+
yield(doc)
|
198
|
+
end
|
199
|
+
builder.to_xml
|
200
|
+
end
|
201
|
+
|
202
|
+
def commit(relative_url, request, method = :post, authorization_field = :token)
|
203
|
+
begin
|
204
|
+
raw_response = ssl_request(method, "#{live_url}/#{relative_url}", request, headers)
|
205
|
+
rescue ResponseError => e
|
206
|
+
raw_response = e.response.body
|
207
|
+
end
|
208
|
+
|
209
|
+
response_from(raw_response, authorization_field)
|
210
|
+
end
|
211
|
+
|
212
|
+
def response_from(raw_response, authorization_field)
|
213
|
+
parsed = parse(raw_response)
|
214
|
+
options = {
|
215
|
+
:authorization => parsed[authorization_field],
|
216
|
+
:test => (parsed[:on_test_gateway] == 'true'),
|
217
|
+
:avs_result => { :code => parsed[:response_avs_code] },
|
218
|
+
:cvv_result => parsed[:response_cvv_code]
|
219
|
+
}
|
220
|
+
|
221
|
+
Response.new(parsed[:succeeded] == 'true', parsed[:message] || parsed[:error], parsed, options)
|
222
|
+
end
|
223
|
+
|
224
|
+
def headers
|
225
|
+
{
|
226
|
+
'Authorization' => ('Basic ' + Base64.strict_encode64("#{@options[:login]}:#{@options[:password]}").chomp),
|
227
|
+
'Content-Type' => 'text/xml'
|
228
|
+
}
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|