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,447 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
|
6
|
+
# Initialization Options
|
7
|
+
# :login Your store number
|
8
|
+
# :pem The text of your linkpoint PEM file. Note
|
9
|
+
# this is not the path to file, but its
|
10
|
+
# contents. If you are only using one PEM
|
11
|
+
# file on your site you can declare it
|
12
|
+
# globally and then you won't need to
|
13
|
+
# include this option
|
14
|
+
#
|
15
|
+
#
|
16
|
+
# A valid store number is required. Unfortunately, with LinkPoint
|
17
|
+
# YOU CAN'T JUST USE ANY OLD STORE NUMBER. Also, you can't just
|
18
|
+
# generate your own PEM file. You'll need to use a special PEM file
|
19
|
+
# provided by LinkPoint.
|
20
|
+
#
|
21
|
+
# Go to http://www.linkpoint.com/support/sup_teststore.asp to set up
|
22
|
+
# a test account and obtain your PEM file.
|
23
|
+
#
|
24
|
+
# Declaring PEM file Globally
|
25
|
+
# ActiveMerchant::Billing::LinkpointGateway.pem_file = File.read( File.dirname(__FILE__) + '/../mycert.pem' )
|
26
|
+
#
|
27
|
+
#
|
28
|
+
# Valid Order Options
|
29
|
+
# :result =>
|
30
|
+
# LIVE Production mode
|
31
|
+
# GOOD Approved response in test mode
|
32
|
+
# DECLINE Declined response in test mode
|
33
|
+
# DUPLICATE Duplicate response in test mode
|
34
|
+
#
|
35
|
+
# :ponumber Order number
|
36
|
+
#
|
37
|
+
# :transactionorigin => Source of the transaction
|
38
|
+
# ECI Email or Internet
|
39
|
+
# MAIL Mail order
|
40
|
+
# MOTO Mail order/Telephone
|
41
|
+
# TELEPHONE Telephone
|
42
|
+
# RETAIL Face-to-face
|
43
|
+
#
|
44
|
+
# :ordertype =>
|
45
|
+
# SALE Real live sale
|
46
|
+
# PREAUTH Authorize only
|
47
|
+
# POSTAUTH Forced Ticket or Ticket Only transaction
|
48
|
+
# VOID
|
49
|
+
# CREDIT
|
50
|
+
# CALCSHIPPING For shipping charges calculations
|
51
|
+
# CALCTAX For sales tax calculations
|
52
|
+
#
|
53
|
+
# Recurring Options
|
54
|
+
# :action =>
|
55
|
+
# SUBMIT
|
56
|
+
# MODIFY
|
57
|
+
# CANCEL
|
58
|
+
#
|
59
|
+
# :installments Identifies how many recurring payments to charge the customer
|
60
|
+
# :startdate Date to begin charging the recurring payments. Format: YYYYMMDD or "immediate"
|
61
|
+
# :periodicity =>
|
62
|
+
# MONTHLY
|
63
|
+
# BIMONTHLY
|
64
|
+
# WEEKLY
|
65
|
+
# BIWEEKLY
|
66
|
+
# YEARLY
|
67
|
+
# DAILY
|
68
|
+
# :threshold Tells how many times to retry the transaction (if it fails) before contacting the merchant.
|
69
|
+
# :comments Uh... comments
|
70
|
+
#
|
71
|
+
#
|
72
|
+
# For reference:
|
73
|
+
#
|
74
|
+
# https://www.linkpointcentral.com/lpc/docs/Help/APIHelp/lpintguide.htm
|
75
|
+
#
|
76
|
+
# Entities = {
|
77
|
+
# :payment => [:subtotal, :tax, :vattax, :shipping, :chargetotal],
|
78
|
+
# :billing => [:name, :address1, :address2, :city, :state, :zip, :country, :email, :phone, :fax, :addrnum],
|
79
|
+
# :shipping => [:name, :address1, :address2, :city, :state, :zip, :country, :weight, :items, :carrier, :total],
|
80
|
+
# :creditcard => [:cardnumber, :cardexpmonth, :cardexpyear, :cvmvalue, :track],
|
81
|
+
# :telecheck => [:routing, :account, :checknumber, :bankname, :bankstate, :dl, :dlstate, :void, :accounttype, :ssn],
|
82
|
+
# :transactiondetails => [:transactionorigin, :oid, :ponumber, :taxexempt, :terminaltype, :ip, :reference_number, :recurring, :tdate],
|
83
|
+
# :periodic => [:action, :installments, :threshold, :startdate, :periodicity, :comments],
|
84
|
+
# :notes => [:comments, :referred]
|
85
|
+
# :items => [:item => [:price, :quantity, :description, :id, :options => [:option => [:name, :value]]]]
|
86
|
+
# }
|
87
|
+
#
|
88
|
+
#
|
89
|
+
# LinkPoint's Items entity is an optional entity that can be attached to orders.
|
90
|
+
# It is entered as :line_items to be consistent with the CyberSource implementation
|
91
|
+
#
|
92
|
+
# The line_item hash goes in the options hash and should look like
|
93
|
+
#
|
94
|
+
# :line_items => [
|
95
|
+
# {
|
96
|
+
# :id => '123456',
|
97
|
+
# :description => 'Logo T-Shirt',
|
98
|
+
# :price => '12.00',
|
99
|
+
# :quantity => '1',
|
100
|
+
# :options => [
|
101
|
+
# {
|
102
|
+
# :name => 'Color',
|
103
|
+
# :value => 'Red'
|
104
|
+
# },
|
105
|
+
# {
|
106
|
+
# :name => 'Size',
|
107
|
+
# :value => 'XL'
|
108
|
+
# }
|
109
|
+
# ]
|
110
|
+
# },
|
111
|
+
# {
|
112
|
+
# :id => '111',
|
113
|
+
# :description => 'keychain',
|
114
|
+
# :price => '3.00',
|
115
|
+
# :quantity => '1'
|
116
|
+
# }
|
117
|
+
# ]
|
118
|
+
# This functionality is only supported by this particular gateway may
|
119
|
+
# be changed at any time
|
120
|
+
#
|
121
|
+
class LinkpointGateway < Gateway
|
122
|
+
# Your global PEM file. This will be assigned to you by linkpoint
|
123
|
+
#
|
124
|
+
# Example:
|
125
|
+
#
|
126
|
+
# ActiveMerchant::Billing::LinkpointGateway.pem_file = File.read( File.dirname(__FILE__) + '/../mycert.pem' )
|
127
|
+
#
|
128
|
+
cattr_accessor :pem_file
|
129
|
+
|
130
|
+
self.test_url = 'https://staging.linkpt.net:1129/'
|
131
|
+
self.live_url = 'https://secure.linkpt.net:1129/'
|
132
|
+
|
133
|
+
self.supported_countries = ['US']
|
134
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
|
135
|
+
self.homepage_url = 'http://www.linkpoint.com/'
|
136
|
+
self.display_name = 'LinkPoint'
|
137
|
+
|
138
|
+
def initialize(options = {})
|
139
|
+
requires!(options, :login)
|
140
|
+
|
141
|
+
@options = {
|
142
|
+
:result => 'LIVE',
|
143
|
+
:pem => LinkpointGateway.pem_file
|
144
|
+
}.update(options)
|
145
|
+
|
146
|
+
raise ArgumentError, "You need to pass in your pem file using the :pem parameter or set it globally using ActiveMerchant::Billing::LinkpointGateway.pem_file = File.read( File.dirname(__FILE__) + '/../mycert.pem' ) or similar" if @options[:pem].blank?
|
147
|
+
end
|
148
|
+
|
149
|
+
# Send a purchase request with periodic options
|
150
|
+
# Recurring Options
|
151
|
+
# :action =>
|
152
|
+
# SUBMIT
|
153
|
+
# MODIFY
|
154
|
+
# CANCEL
|
155
|
+
#
|
156
|
+
# :installments Identifies how many recurring payments to charge the customer
|
157
|
+
# :startdate Date to begin charging the recurring payments. Format: YYYYMMDD or "immediate"
|
158
|
+
# :periodicity =>
|
159
|
+
# :monthly
|
160
|
+
# :bimonthly
|
161
|
+
# :weekly
|
162
|
+
# :biweekly
|
163
|
+
# :yearly
|
164
|
+
# :daily
|
165
|
+
# :threshold Tells how many times to retry the transaction (if it fails) before contacting the merchant.
|
166
|
+
# :comments Uh... comments
|
167
|
+
#
|
168
|
+
def recurring(money, creditcard, options={})
|
169
|
+
requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily], :installments, :order_id )
|
170
|
+
|
171
|
+
options.update(
|
172
|
+
:ordertype => "SALE",
|
173
|
+
:action => options[:action] || "SUBMIT",
|
174
|
+
:installments => options[:installments] || 12,
|
175
|
+
:startdate => options[:startdate] || "immediate",
|
176
|
+
:periodicity => options[:periodicity].to_s || "monthly",
|
177
|
+
:comments => options[:comments] || nil,
|
178
|
+
:threshold => options[:threshold] || 3
|
179
|
+
)
|
180
|
+
commit(money, creditcard, options)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Buy the thing
|
184
|
+
def purchase(money, creditcard, options={})
|
185
|
+
requires!(options, :order_id)
|
186
|
+
options.update(
|
187
|
+
:ordertype => "SALE"
|
188
|
+
)
|
189
|
+
commit(money, creditcard, options)
|
190
|
+
end
|
191
|
+
|
192
|
+
#
|
193
|
+
# Authorize the transaction
|
194
|
+
#
|
195
|
+
# Reserves the funds on the customer's credit card, but does not charge the card.
|
196
|
+
#
|
197
|
+
def authorize(money, creditcard, options = {})
|
198
|
+
requires!(options, :order_id)
|
199
|
+
options.update(
|
200
|
+
:ordertype => "PREAUTH"
|
201
|
+
)
|
202
|
+
commit(money, creditcard, options)
|
203
|
+
end
|
204
|
+
|
205
|
+
#
|
206
|
+
# Post an authorization.
|
207
|
+
#
|
208
|
+
# Captures the funds from an authorized transaction.
|
209
|
+
# Order_id must be a valid order id from a prior authorized transaction.
|
210
|
+
#
|
211
|
+
def capture(money, authorization, options = {})
|
212
|
+
options.update(
|
213
|
+
:order_id => authorization,
|
214
|
+
:ordertype => "POSTAUTH"
|
215
|
+
)
|
216
|
+
commit(money, nil, options)
|
217
|
+
end
|
218
|
+
|
219
|
+
# Void a previous transaction
|
220
|
+
def void(identification, options = {})
|
221
|
+
options.update(
|
222
|
+
:order_id => identification,
|
223
|
+
:ordertype => "VOID"
|
224
|
+
)
|
225
|
+
commit(nil, nil, options)
|
226
|
+
end
|
227
|
+
|
228
|
+
#
|
229
|
+
# Refund an order
|
230
|
+
#
|
231
|
+
# identification must be a valid order id previously submitted by SALE
|
232
|
+
#
|
233
|
+
def refund(money, identification, options = {})
|
234
|
+
options.update(
|
235
|
+
:ordertype => "CREDIT",
|
236
|
+
:order_id => identification
|
237
|
+
)
|
238
|
+
commit(money, nil, options)
|
239
|
+
end
|
240
|
+
|
241
|
+
def credit(money, identification, options = {})
|
242
|
+
deprecated CREDIT_DEPRECATION_MESSAGE
|
243
|
+
refund(money, identification, options)
|
244
|
+
end
|
245
|
+
|
246
|
+
private
|
247
|
+
# Commit the transaction by posting the XML file to the LinkPoint server
|
248
|
+
def commit(money, creditcard, options = {})
|
249
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(money, creditcard, options)))
|
250
|
+
|
251
|
+
Response.new(successful?(response), response[:message], response,
|
252
|
+
:test => test?,
|
253
|
+
:authorization => response[:ordernum],
|
254
|
+
:avs_result => { :code => response[:avs].to_s[2,1] },
|
255
|
+
:cvv_result => response[:avs].to_s[3,1]
|
256
|
+
)
|
257
|
+
end
|
258
|
+
|
259
|
+
def successful?(response)
|
260
|
+
response[:approved] == "APPROVED"
|
261
|
+
end
|
262
|
+
|
263
|
+
# Build the XML file
|
264
|
+
def post_data(money, creditcard, options)
|
265
|
+
params = parameters(money, creditcard, options)
|
266
|
+
|
267
|
+
xml = REXML::Document.new
|
268
|
+
order = xml.add_element("order")
|
269
|
+
|
270
|
+
# Merchant Info
|
271
|
+
merchantinfo = order.add_element("merchantinfo")
|
272
|
+
merchantinfo.add_element("configfile").text = @options[:login]
|
273
|
+
|
274
|
+
# Loop over the params hash to construct the XML string
|
275
|
+
for key, value in params
|
276
|
+
elem = order.add_element(key.to_s)
|
277
|
+
if key == :items
|
278
|
+
build_items(elem, value)
|
279
|
+
else
|
280
|
+
for k, v in params[key]
|
281
|
+
elem.add_element(k.to_s).text = params[key][k].to_s if params[key][k]
|
282
|
+
end
|
283
|
+
end
|
284
|
+
# Linkpoint doesn't understand empty elements:
|
285
|
+
order.delete(elem) if elem.size == 0
|
286
|
+
end
|
287
|
+
return xml.to_s
|
288
|
+
end
|
289
|
+
|
290
|
+
# adds LinkPoint's Items entity to the XML. Called from post_data
|
291
|
+
def build_items(element, items)
|
292
|
+
for item in items
|
293
|
+
item_element = element.add_element("item")
|
294
|
+
for key, value in item
|
295
|
+
if key == :options
|
296
|
+
options_element = item_element.add_element("options")
|
297
|
+
for option in value
|
298
|
+
opt_element = options_element.add_element("option")
|
299
|
+
opt_element.add_element("name").text = option[:name] unless option[:name].blank?
|
300
|
+
opt_element.add_element("value").text = option[:value] unless option[:value].blank?
|
301
|
+
end
|
302
|
+
else
|
303
|
+
item_element.add_element(key.to_s).text = item[key].to_s unless item[key].blank?
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
# Set up the parameters hash just once so we don't have to do it
|
310
|
+
# for every action.
|
311
|
+
def parameters(money, creditcard, options = {})
|
312
|
+
|
313
|
+
params = {
|
314
|
+
:payment => {
|
315
|
+
:subtotal => amount(options[:subtotal]),
|
316
|
+
:tax => amount(options[:tax]),
|
317
|
+
:vattax => amount(options[:vattax]),
|
318
|
+
:shipping => amount(options[:shipping]),
|
319
|
+
:chargetotal => amount(money)
|
320
|
+
},
|
321
|
+
:transactiondetails => {
|
322
|
+
:transactionorigin => options[:transactionorigin] || "ECI",
|
323
|
+
:oid => options[:order_id],
|
324
|
+
:ponumber => options[:ponumber],
|
325
|
+
:taxexempt => options[:taxexempt],
|
326
|
+
:terminaltype => options[:terminaltype],
|
327
|
+
:ip => options[:ip],
|
328
|
+
:reference_number => options[:reference_number],
|
329
|
+
:recurring => options[:recurring] || "NO", #DO NOT USE if you are using the periodic billing option.
|
330
|
+
:tdate => options[:tdate]
|
331
|
+
},
|
332
|
+
:orderoptions => {
|
333
|
+
:ordertype => options[:ordertype],
|
334
|
+
:result => @options[:result]
|
335
|
+
},
|
336
|
+
:periodic => {
|
337
|
+
:action => options[:action],
|
338
|
+
:installments => options[:installments],
|
339
|
+
:threshold => options[:threshold],
|
340
|
+
:startdate => options[:startdate],
|
341
|
+
:periodicity => options[:periodicity],
|
342
|
+
:comments => options[:comments]
|
343
|
+
},
|
344
|
+
:telecheck => {
|
345
|
+
:routing => options[:telecheck_routing],
|
346
|
+
:account => options[:telecheck_account],
|
347
|
+
:checknumber => options[:telecheck_checknumber],
|
348
|
+
:bankname => options[:telecheck_bankname],
|
349
|
+
:dl => options[:telecheck_dl],
|
350
|
+
:dlstate => options[:telecheck_dlstate],
|
351
|
+
:void => options[:telecheck_void],
|
352
|
+
:accounttype => options[:telecheck_accounttype],
|
353
|
+
:ssn => options[:telecheck_ssn],
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
if creditcard
|
358
|
+
params[:creditcard] = {
|
359
|
+
:cardnumber => creditcard.number,
|
360
|
+
:cardexpmonth => creditcard.month,
|
361
|
+
:cardexpyear => format_creditcard_expiry_year(creditcard.year),
|
362
|
+
:track => nil
|
363
|
+
}
|
364
|
+
|
365
|
+
if creditcard.verification_value?
|
366
|
+
params[:creditcard][:cvmvalue] = creditcard.verification_value
|
367
|
+
params[:creditcard][:cvmindicator] = 'provided'
|
368
|
+
else
|
369
|
+
params[:creditcard][:cvmindicator] = 'not_provided'
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
if billing_address = options[:billing_address] || options[:address]
|
374
|
+
|
375
|
+
params[:billing] = {}
|
376
|
+
params[:billing][:name] = billing_address[:name] || (creditcard ? creditcard.name : nil)
|
377
|
+
params[:billing][:address1] = billing_address[:address1] unless billing_address[:address1].blank?
|
378
|
+
params[:billing][:address2] = billing_address[:address2] unless billing_address[:address2].blank?
|
379
|
+
params[:billing][:city] = billing_address[:city] unless billing_address[:city].blank?
|
380
|
+
params[:billing][:state] = billing_address[:state] unless billing_address[:state].blank?
|
381
|
+
params[:billing][:zip] = billing_address[:zip] unless billing_address[:zip].blank?
|
382
|
+
params[:billing][:country] = billing_address[:country] unless billing_address[:country].blank?
|
383
|
+
params[:billing][:company] = billing_address[:company] unless billing_address[:company].blank?
|
384
|
+
params[:billing][:phone] = billing_address[:phone] unless billing_address[:phone].blank?
|
385
|
+
params[:billing][:email] = options[:email] unless options[:email].blank?
|
386
|
+
end
|
387
|
+
|
388
|
+
if shipping_address = options[:shipping_address]
|
389
|
+
|
390
|
+
params[:shipping] = {}
|
391
|
+
params[:shipping][:name] = shipping_address[:name] || (creditcard ? creditcard.name : nil)
|
392
|
+
params[:shipping][:address1] = shipping_address[:address1] unless shipping_address[:address1].blank?
|
393
|
+
params[:shipping][:address2] = shipping_address[:address2] unless shipping_address[:address2].blank?
|
394
|
+
params[:shipping][:city] = shipping_address[:city] unless shipping_address[:city].blank?
|
395
|
+
params[:shipping][:state] = shipping_address[:state] unless shipping_address[:state].blank?
|
396
|
+
params[:shipping][:zip] = shipping_address[:zip] unless shipping_address[:zip].blank?
|
397
|
+
params[:shipping][:country] = shipping_address[:country] unless shipping_address[:country].blank?
|
398
|
+
end
|
399
|
+
|
400
|
+
params[:items] = options[:line_items] if options[:line_items]
|
401
|
+
|
402
|
+
return params
|
403
|
+
end
|
404
|
+
|
405
|
+
def parse(xml)
|
406
|
+
|
407
|
+
# For reference, a typical response...
|
408
|
+
# <r_csp></r_csp>
|
409
|
+
# <r_time></r_time>
|
410
|
+
# <r_ref></r_ref>
|
411
|
+
# <r_error></r_error>
|
412
|
+
# <r_ordernum></r_ordernum>
|
413
|
+
# <r_message>This is a test transaction and will not show up in the Reports</r_message>
|
414
|
+
# <r_code></r_code>
|
415
|
+
# <r_tdate>Thu Feb 2 15:40:21 2006</r_tdate>
|
416
|
+
# <r_score></r_score>
|
417
|
+
# <r_authresponse></r_authresponse>
|
418
|
+
# <r_approved>APPROVED</r_approved>
|
419
|
+
# <r_avs></r_avs>
|
420
|
+
|
421
|
+
response = {:message => "Global Error Receipt", :complete => false}
|
422
|
+
|
423
|
+
xml = REXML::Document.new("<response>#{xml}</response>")
|
424
|
+
xml.root.elements.each do |node|
|
425
|
+
response[node.name.downcase.sub(/^r_/, '').to_sym] = normalize(node.text)
|
426
|
+
end unless xml.root.nil?
|
427
|
+
|
428
|
+
response
|
429
|
+
end
|
430
|
+
|
431
|
+
# Make a ruby type out of the response string
|
432
|
+
def normalize(field)
|
433
|
+
case field
|
434
|
+
when "true" then true
|
435
|
+
when "false" then false
|
436
|
+
when "" then nil
|
437
|
+
when "null" then nil
|
438
|
+
else field
|
439
|
+
end
|
440
|
+
end
|
441
|
+
|
442
|
+
def format_creditcard_expiry_year(year)
|
443
|
+
sprintf("%.4i", year)[-2..-1]
|
444
|
+
end
|
445
|
+
end
|
446
|
+
end
|
447
|
+
end
|