swiss-crm-activemerchant 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG +4033 -0
- data/CONTRIBUTORS +568 -0
- data/MIT-LICENSE +20 -0
- data/README.md +252 -0
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/avs_result.rb +95 -0
- data/lib/active_merchant/billing/base.rb +48 -0
- data/lib/active_merchant/billing/check.rb +112 -0
- data/lib/active_merchant/billing/compatibility.rb +118 -0
- data/lib/active_merchant/billing/credit_card.rb +451 -0
- data/lib/active_merchant/billing/credit_card_formatting.rb +24 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +512 -0
- data/lib/active_merchant/billing/cvv_result.rb +37 -0
- data/lib/active_merchant/billing/gateway.rb +332 -0
- data/lib/active_merchant/billing/gateways/adyen.rb +774 -0
- data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
- data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +1125 -0
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +424 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +977 -0
- data/lib/active_merchant/billing/gateways/axcessms.rb +242 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +263 -0
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +116 -0
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +397 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +15 -0
- data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +474 -0
- data/lib/active_merchant/billing/gateways/beanstream.rb +238 -0
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +57 -0
- data/lib/active_merchant/billing/gateways/blue_pay.rb +549 -0
- data/lib/active_merchant/billing/gateways/blue_snap.rb +644 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +190 -0
- data/lib/active_merchant/billing/gateways/borgun.rb +272 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +28 -0
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +19 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +952 -0
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +19 -0
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +244 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +338 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +21 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +394 -0
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +256 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +235 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +198 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +249 -0
- data/lib/active_merchant/billing/gateways/cenpos.rb +328 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +212 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +587 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +21 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +219 -0
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +366 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +142 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +230 -0
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +526 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +1148 -0
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +343 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +302 -0
- data/lib/active_merchant/billing/gateways/decidir.rb +358 -0
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +295 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +346 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +215 -0
- data/lib/active_merchant/billing/gateways/elavon.rb +475 -0
- data/lib/active_merchant/billing/gateways/element.rb +406 -0
- data/lib/active_merchant/billing/gateways/epay.rb +296 -0
- data/lib/active_merchant/billing/gateways/evo_ca.rb +307 -0
- data/lib/active_merchant/billing/gateways/eway.rb +226 -0
- data/lib/active_merchant/billing/gateways/eway_managed.rb +289 -0
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +578 -0
- data/lib/active_merchant/billing/gateways/exact.rb +219 -0
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +223 -0
- data/lib/active_merchant/billing/gateways/federated_canada.rb +158 -0
- data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
- data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +182 -0
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +452 -0
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/fluidpay.rb +275 -0
- data/lib/active_merchant/billing/gateways/forte.rb +286 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +256 -0
- data/lib/active_merchant/billing/gateways/global_collect.rb +580 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +193 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +205 -0
- data/lib/active_merchant/billing/gateways/hps.rb +472 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +312 -0
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +213 -0
- data/lib/active_merchant/billing/gateways/instapay.rb +159 -0
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +176 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +467 -0
- data/lib/active_merchant/billing/gateways/itransact.rb +448 -0
- data/lib/active_merchant/billing/gateways/iveri.rb +290 -0
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +395 -0
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +432 -0
- data/lib/active_merchant/billing/gateways/klarna.rb +317 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +297 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +412 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +448 -0
- data/lib/active_merchant/billing/gateways/litle.rb +643 -0
- data/lib/active_merchant/billing/gateways/mastercard.rb +286 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +348 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +228 -0
- data/lib/active_merchant/billing/gateways/merchant_one.rb +110 -0
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +313 -0
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +284 -0
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +248 -0
- data/lib/active_merchant/billing/gateways/mercury.rb +352 -0
- data/lib/active_merchant/billing/gateways/metrics_global.rb +293 -0
- data/lib/active_merchant/billing/gateways/micropayment.rb +182 -0
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
- data/lib/active_merchant/billing/gateways/migs.rb +329 -0
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +37 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +215 -0
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +424 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +488 -0
- data/lib/active_merchant/billing/gateways/money_movers.rb +150 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +366 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +299 -0
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +163 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +198 -0
- data/lib/active_merchant/billing/gateways/netaxept.rb +180 -0
- data/lib/active_merchant/billing/gateways/netbanx.rb +376 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +229 -0
- data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
- data/lib/active_merchant/billing/gateways/network_merchants.rb +238 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +396 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +509 -0
- data/lib/active_merchant/billing/gateways/omise.rb +323 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +246 -0
- data/lib/active_merchant/billing/gateways/opp.rb +394 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +331 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +45 -0
- data/lib/active_merchant/billing/gateways/orbital.rb +1267 -0
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +206 -0
- data/lib/active_merchant/billing/gateways/pagarme.rb +239 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +120 -0
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +277 -0
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +390 -0
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +206 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +110 -0
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +224 -0
- data/lib/active_merchant/billing/gateways/payeezy.rb +513 -0
- data/lib/active_merchant/billing/gateways/payex.rb +409 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +235 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +42 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +13 -0
- data/lib/active_merchant/billing/gateways/payflow.rb +473 -0
- data/lib/active_merchant/billing/gateways/payflow_express.rb +220 -0
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +14 -0
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +20 -0
- data/lib/active_merchant/billing/gateways/payment_express.rb +373 -0
- data/lib/active_merchant/billing/gateways/paymentez.rb +365 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +369 -0
- data/lib/active_merchant/billing/gateways/paynetworx.rb +228 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +718 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +69 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +262 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +136 -0
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +44 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +272 -0
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +30 -0
- data/lib/active_merchant/billing/gateways/paypal_standard.rb +281 -0
- data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +159 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +204 -0
- data/lib/active_merchant/billing/gateways/payu_in.rb +249 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +482 -0
- data/lib/active_merchant/billing/gateways/payway.rb +207 -0
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +273 -0
- data/lib/active_merchant/billing/gateways/pixxels.rb +263 -0
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +283 -0
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +325 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +227 -0
- data/lib/active_merchant/billing/gateways/psl_card.rb +295 -0
- data/lib/active_merchant/billing/gateways/qbms.rb +302 -0
- data/lib/active_merchant/billing/gateways/quantum.rb +274 -0
- data/lib/active_merchant/billing/gateways/quickbooks.rb +377 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +297 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +24 -0
- data/lib/active_merchant/billing/gateways/qvalent.rb +305 -0
- data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
- data/lib/active_merchant/billing/gateways/reach.rb +277 -0
- data/lib/active_merchant/billing/gateways/realex.rb +400 -0
- data/lib/active_merchant/billing/gateways/redsys.rb +723 -0
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +298 -0
- data/lib/active_merchant/billing/gateways/sage.rb +446 -0
- data/lib/active_merchant/billing/gateways/sage_pay.rb +434 -0
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +141 -0
- data/lib/active_merchant/billing/gateways/secure_net.rb +260 -0
- data/lib/active_merchant/billing/gateways/secure_pay.rb +191 -0
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +290 -0
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +103 -0
- data/lib/active_merchant/billing/gateways/securion_pay.rb +305 -0
- data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +450 -0
- data/lib/active_merchant/billing/gateways/smart_ps.rb +274 -0
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +354 -0
- data/lib/active_merchant/billing/gateways/stripe.rb +866 -0
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +602 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +151 -0
- data/lib/active_merchant/billing/gateways/telr.rb +273 -0
- data/lib/active_merchant/billing/gateways/tns.rb +23 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +240 -0
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +612 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +222 -0
- data/lib/active_merchant/billing/gateways/transax.rb +21 -0
- data/lib/active_merchant/billing/gateways/transnational.rb +9 -0
- data/lib/active_merchant/billing/gateways/trexle.rb +221 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +500 -0
- data/lib/active_merchant/billing/gateways/usa_epay.rb +24 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +1612 -0
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +367 -0
- data/lib/active_merchant/billing/gateways/vanco.rb +303 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +224 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +171 -0
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +250 -0
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +97 -0
- data/lib/active_merchant/billing/gateways/wepay.rb +235 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +430 -0
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +345 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +1050 -0
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +208 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +14 -0
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +121 -0
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +16 -0
- data/lib/active_merchant/connection.rb +194 -0
- data/lib/active_merchant/country.rb +338 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +38 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +11 -0
- data/lib/active_merchant/network_connection_retries.rb +78 -0
- data/lib/active_merchant/post_data.rb +26 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +3 -0
- data/lib/active_merchant.rb +63 -0
- data/lib/activemerchant.rb +1 -0
- data/lib/certs/cacert.pem +3214 -0
- data/lib/support/gateway_support.rb +69 -0
- data/lib/support/outbound_hosts.rb +28 -0
- data/lib/support/ssl_verify.rb +88 -0
- data/lib/support/ssl_version.rb +86 -0
- metadata +506 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'active_merchant/billing/gateways/smart_ps.rb'
|
2
|
+
require 'active_merchant/billing/gateways/braintree/braintree_common'
|
3
|
+
|
4
|
+
module ActiveMerchant #:nodoc:
|
5
|
+
module Billing #:nodoc:
|
6
|
+
class BraintreeOrangeGateway < SmartPs
|
7
|
+
include BraintreeCommon
|
8
|
+
|
9
|
+
self.display_name = 'Braintree (Orange Platform)'
|
10
|
+
self.supported_countries = ['US']
|
11
|
+
|
12
|
+
self.live_url = self.test_url = 'https://secure.braintreepaymentgateway.com/api/transact.php'
|
13
|
+
|
14
|
+
def add_processor(post, options)
|
15
|
+
post[:processor_id] = options[:processor] unless options[:processor].nil?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,244 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class BridgePayGateway < Gateway
|
6
|
+
self.display_name = 'BridgePay'
|
7
|
+
self.homepage_url = 'http://www.bridgepaynetwork.com/'
|
8
|
+
|
9
|
+
self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
|
10
|
+
self.live_url = 'https://gateway.itstgate.com/SmartPayments/transact3.asmx'
|
11
|
+
|
12
|
+
self.supported_countries = %w[CA US]
|
13
|
+
self.default_currency = 'USD'
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
15
|
+
|
16
|
+
def initialize(options = {})
|
17
|
+
requires!(options, :user_name, :password)
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def purchase(amount, payment_method, options = {})
|
22
|
+
post = initialize_required_fields('Sale')
|
23
|
+
|
24
|
+
# Allow the same amount in multiple transactions.
|
25
|
+
post[:ExtData] = '<Force>T</Force>'
|
26
|
+
add_invoice(post, amount, options)
|
27
|
+
add_payment_method(post, payment_method)
|
28
|
+
add_customer_data(post, options)
|
29
|
+
|
30
|
+
commit(post)
|
31
|
+
end
|
32
|
+
|
33
|
+
def authorize(amount, payment_method, options = {})
|
34
|
+
post = initialize_required_fields('Auth')
|
35
|
+
|
36
|
+
add_invoice(post, amount, options)
|
37
|
+
add_payment_method(post, payment_method)
|
38
|
+
add_customer_data(post, options)
|
39
|
+
|
40
|
+
commit(post)
|
41
|
+
end
|
42
|
+
|
43
|
+
def capture(amount, authorization, options = {})
|
44
|
+
post = initialize_required_fields('Force')
|
45
|
+
|
46
|
+
add_invoice(post, amount, options)
|
47
|
+
add_reference(post, authorization)
|
48
|
+
add_customer_data(post, options)
|
49
|
+
|
50
|
+
commit(post)
|
51
|
+
end
|
52
|
+
|
53
|
+
def refund(amount, authorization, options = {})
|
54
|
+
post = initialize_required_fields('Return')
|
55
|
+
|
56
|
+
add_invoice(post, amount, options)
|
57
|
+
add_reference(post, authorization)
|
58
|
+
|
59
|
+
commit(post)
|
60
|
+
end
|
61
|
+
|
62
|
+
def void(authorization, options = {})
|
63
|
+
post = initialize_required_fields('Void')
|
64
|
+
|
65
|
+
add_reference(post, authorization)
|
66
|
+
|
67
|
+
commit(post)
|
68
|
+
end
|
69
|
+
|
70
|
+
def verify(creditcard, options = {})
|
71
|
+
MultiResponse.run(:use_first_response) do |r|
|
72
|
+
r.process { authorize(100, creditcard, options) }
|
73
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def store(creditcard, options = {})
|
78
|
+
post = initialize_required_fields('')
|
79
|
+
post[:transaction] = 'Create'
|
80
|
+
post[:CardNumber] = creditcard.number
|
81
|
+
post[:CustomerPaymentInfoKey] = ''
|
82
|
+
post[:token] = ''
|
83
|
+
add_payment_method(post, creditcard)
|
84
|
+
|
85
|
+
commit(post)
|
86
|
+
end
|
87
|
+
|
88
|
+
def supports_scrubbing?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
def scrub(transcript)
|
93
|
+
transcript.
|
94
|
+
gsub(%r((&?CardNum=)[^&]*)i, '\1[FILTERED]').
|
95
|
+
gsub(%r((&?CVNum=)[^&]*)i, '\1[FILTERED]').
|
96
|
+
gsub(%r((&?Password=)[^&]*)i, '\1[FILTERED]').
|
97
|
+
gsub(%r((&?TransitNum=)[^&]*)i, '\1[FILTERED]').
|
98
|
+
gsub(%r((&?AccountNum=)[^&]*)i, '\1[FILTERED]')
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def add_payment_method(post, payment_method)
|
104
|
+
if payment_method.respond_to? :brand
|
105
|
+
post[:NameOnCard] = payment_method.name if payment_method.name
|
106
|
+
post[:ExpDate] = expdate(payment_method)
|
107
|
+
post[:CardNum] = payment_method.number
|
108
|
+
post[:CVNum] = payment_method.verification_value
|
109
|
+
elsif payment_method.is_a?(String)
|
110
|
+
add_token(post, payment_method)
|
111
|
+
else
|
112
|
+
post[:CheckNum] = payment_method.number
|
113
|
+
post[:TransitNum] = payment_method.routing_number
|
114
|
+
post[:AccountNum] = payment_method.account_number
|
115
|
+
post[:NameOnCheck] = payment_method.name
|
116
|
+
post[:ExtData] = "<AccountType>#{payment_method.account_type.capitalize}</AccountType>" if payment_method.account_type
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def add_token(post, payment_method)
|
121
|
+
payment_method = payment_method.split('|')
|
122
|
+
post[:ExtData] = "<Force>T</Force><CardVault><Transaction>Read</Transaction><CustomerPaymentInfoKey>#{payment_method[1]}</CustomerPaymentInfoKey><Token>#{payment_method[0]}</Token><ExpDate>#{payment_method[2]}</ExpDate></CardVault>"
|
123
|
+
end
|
124
|
+
|
125
|
+
def initialize_required_fields(transaction_type)
|
126
|
+
post = {}
|
127
|
+
post[:TransType] = transaction_type
|
128
|
+
post[:Amount] = ''
|
129
|
+
post[:PNRef] = ''
|
130
|
+
post[:InvNum] = ''
|
131
|
+
post[:CardNum] = ''
|
132
|
+
post[:ExpDate] = ''
|
133
|
+
post[:MagData] = ''
|
134
|
+
post[:NameOnCard] = ''
|
135
|
+
post[:Zip] = ''
|
136
|
+
post[:Street] = ''
|
137
|
+
post[:CVNum] = ''
|
138
|
+
post[:MagData] = ''
|
139
|
+
post[:ExtData] = ''
|
140
|
+
post[:MICR] = ''
|
141
|
+
post[:DL] = ''
|
142
|
+
post[:SS] = ''
|
143
|
+
post[:DOB] = ''
|
144
|
+
post[:StateCode] = ''
|
145
|
+
post[:CheckType] = ''
|
146
|
+
post
|
147
|
+
end
|
148
|
+
|
149
|
+
def add_customer_data(post, options)
|
150
|
+
if (billing_address = (options[:billing_address] || options[:address]))
|
151
|
+
post[:Street] = billing_address[:address1]
|
152
|
+
post[:Zip] = billing_address[:zip]
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def add_invoice(post, amount, options)
|
157
|
+
post[:Amount] = amount(amount)
|
158
|
+
post[:InvNum] = options[:order_id]
|
159
|
+
end
|
160
|
+
|
161
|
+
def expdate(creditcard)
|
162
|
+
"#{format(creditcard.month, :two_digits)}#{format(creditcard.year, :two_digits)}"
|
163
|
+
end
|
164
|
+
|
165
|
+
def parse(xml)
|
166
|
+
response = {}
|
167
|
+
|
168
|
+
doc = Nokogiri::XML(xml)
|
169
|
+
doc.root&.xpath('*')&.each do |node|
|
170
|
+
if node.elements.size == 0
|
171
|
+
response[node.name.downcase.to_sym] = node.text
|
172
|
+
else
|
173
|
+
node.elements.each do |childnode|
|
174
|
+
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
175
|
+
response[name.to_sym] = childnode.text
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
response
|
181
|
+
end
|
182
|
+
|
183
|
+
def commit(parameters)
|
184
|
+
data = post_data(parameters)
|
185
|
+
raw = parse(ssl_post(url(parameters), data))
|
186
|
+
|
187
|
+
Response.new(
|
188
|
+
success_from(raw),
|
189
|
+
message_from(raw),
|
190
|
+
raw,
|
191
|
+
authorization: authorization_from(raw),
|
192
|
+
test: test?
|
193
|
+
)
|
194
|
+
end
|
195
|
+
|
196
|
+
def url(params)
|
197
|
+
if params[:transaction]
|
198
|
+
"#{base_url}/ManageCardVault"
|
199
|
+
else
|
200
|
+
action = params[:TransitNum] ? 'ProcessCheck' : 'ProcessCreditCard'
|
201
|
+
"#{base_url}/#{action}"
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
def base_url
|
206
|
+
test? ? test_url : live_url
|
207
|
+
end
|
208
|
+
|
209
|
+
def success_from(response)
|
210
|
+
response[:result] == '0'
|
211
|
+
end
|
212
|
+
|
213
|
+
def message_from(response)
|
214
|
+
response[:respmsg] || response[:message]
|
215
|
+
end
|
216
|
+
|
217
|
+
def authorization_from(response)
|
218
|
+
if response[:token]
|
219
|
+
[response[:token], response[:customerpaymentinfokey], response[:expdate]].join('|')
|
220
|
+
else
|
221
|
+
[response[:authcode], response[:pnref]].join('|')
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
def split_authorization(authorization)
|
226
|
+
authcode, pnref = authorization.split('|')
|
227
|
+
[authcode, pnref]
|
228
|
+
end
|
229
|
+
|
230
|
+
def add_reference(post, authorization)
|
231
|
+
authcode, pnref = split_authorization(authorization)
|
232
|
+
post[:AuthCode] = authcode
|
233
|
+
post[:PNRef] = pnref
|
234
|
+
end
|
235
|
+
|
236
|
+
def post_data(post)
|
237
|
+
{
|
238
|
+
UserName: @options[:user_name],
|
239
|
+
Password: @options[:password]
|
240
|
+
}.merge(post).collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -0,0 +1,230 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class CamsGateway < Gateway
|
4
|
+
self.live_url = 'https://secure.centralams.com/gw/api/transact.php'
|
5
|
+
|
6
|
+
self.supported_countries = ['US']
|
7
|
+
self.default_currency = 'USD'
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
9
|
+
|
10
|
+
self.homepage_url = 'https://www.centralams.com/'
|
11
|
+
self.display_name = 'CAMS: Central Account Management System'
|
12
|
+
|
13
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
14
|
+
'200' => STANDARD_ERROR_CODE[:card_declined],
|
15
|
+
'201' => STANDARD_ERROR_CODE[:card_declined],
|
16
|
+
'202' => STANDARD_ERROR_CODE[:card_declined],
|
17
|
+
'203' => STANDARD_ERROR_CODE[:card_declined],
|
18
|
+
'204' => STANDARD_ERROR_CODE[:card_declined],
|
19
|
+
'220' => STANDARD_ERROR_CODE[:card_declined],
|
20
|
+
'221' => STANDARD_ERROR_CODE[:card_declined],
|
21
|
+
'222' => STANDARD_ERROR_CODE[:incorrect_number],
|
22
|
+
'223' => STANDARD_ERROR_CODE[:expired_card],
|
23
|
+
'224' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
24
|
+
'225' => STANDARD_ERROR_CODE[:invalid_cvc],
|
25
|
+
'240' => STANDARD_ERROR_CODE[:call_issuer],
|
26
|
+
'250' => STANDARD_ERROR_CODE[:pickup_card],
|
27
|
+
'251' => STANDARD_ERROR_CODE[:pickup_card],
|
28
|
+
'252' => STANDARD_ERROR_CODE[:pickup_card],
|
29
|
+
'253' => STANDARD_ERROR_CODE[:pickup_card],
|
30
|
+
'260' => STANDARD_ERROR_CODE[:card_declined],
|
31
|
+
'261' => STANDARD_ERROR_CODE[:card_declined],
|
32
|
+
'262' => STANDARD_ERROR_CODE[:card_declined],
|
33
|
+
'263' => STANDARD_ERROR_CODE[:processing_error],
|
34
|
+
'264' => STANDARD_ERROR_CODE[:card_declined],
|
35
|
+
'300' => STANDARD_ERROR_CODE[:card_declined],
|
36
|
+
'400' => STANDARD_ERROR_CODE[:processing_error],
|
37
|
+
'410' => STANDARD_ERROR_CODE[:processing_error],
|
38
|
+
'411' => STANDARD_ERROR_CODE[:processing_error],
|
39
|
+
'420' => STANDARD_ERROR_CODE[:processing_error],
|
40
|
+
'421' => STANDARD_ERROR_CODE[:processing_error],
|
41
|
+
'430' => STANDARD_ERROR_CODE[:processing_error],
|
42
|
+
'440' => STANDARD_ERROR_CODE[:processing_error],
|
43
|
+
'441' => STANDARD_ERROR_CODE[:processing_error],
|
44
|
+
'460' => STANDARD_ERROR_CODE[:invalid_number],
|
45
|
+
'461' => STANDARD_ERROR_CODE[:processing_error],
|
46
|
+
'801' => STANDARD_ERROR_CODE[:processing_error],
|
47
|
+
'811' => STANDARD_ERROR_CODE[:processing_error],
|
48
|
+
'812' => STANDARD_ERROR_CODE[:processing_error],
|
49
|
+
'813' => STANDARD_ERROR_CODE[:processing_error],
|
50
|
+
'814' => STANDARD_ERROR_CODE[:processing_error],
|
51
|
+
'815' => STANDARD_ERROR_CODE[:processing_error],
|
52
|
+
'823' => STANDARD_ERROR_CODE[:processing_error],
|
53
|
+
'824' => STANDARD_ERROR_CODE[:processing_error],
|
54
|
+
'881' => STANDARD_ERROR_CODE[:processing_error],
|
55
|
+
'882' => STANDARD_ERROR_CODE[:processing_error],
|
56
|
+
'883' => STANDARD_ERROR_CODE[:processing_error],
|
57
|
+
'884' => STANDARD_ERROR_CODE[:card_declined],
|
58
|
+
'885' => STANDARD_ERROR_CODE[:card_declined],
|
59
|
+
'886' => STANDARD_ERROR_CODE[:card_declined],
|
60
|
+
'887' => STANDARD_ERROR_CODE[:processing_error],
|
61
|
+
'888' => STANDARD_ERROR_CODE[:processing_error],
|
62
|
+
'889' => STANDARD_ERROR_CODE[:processing_error],
|
63
|
+
'890' => STANDARD_ERROR_CODE[:processing_error],
|
64
|
+
'891' => STANDARD_ERROR_CODE[:incorrect_cvc],
|
65
|
+
'892' => STANDARD_ERROR_CODE[:incorrect_cvc],
|
66
|
+
'893' => STANDARD_ERROR_CODE[:processing_error],
|
67
|
+
'894' => STANDARD_ERROR_CODE[:processing_error]
|
68
|
+
}
|
69
|
+
|
70
|
+
def initialize(options = {})
|
71
|
+
requires!(options, :username, :password)
|
72
|
+
super
|
73
|
+
end
|
74
|
+
|
75
|
+
def purchase(money, payment, options = {})
|
76
|
+
post = {}
|
77
|
+
add_invoice(post, money, options)
|
78
|
+
|
79
|
+
if payment.respond_to?(:number)
|
80
|
+
add_payment(post, payment)
|
81
|
+
add_address(post, payment, options)
|
82
|
+
elsif payment.kind_of?(String)
|
83
|
+
post[:transactionid] = split_authorization(payment)[0]
|
84
|
+
end
|
85
|
+
|
86
|
+
commit('sale', post)
|
87
|
+
end
|
88
|
+
|
89
|
+
def authorize(money, payment, options = {})
|
90
|
+
post = {}
|
91
|
+
add_invoice(post, money, options)
|
92
|
+
add_payment(post, payment)
|
93
|
+
add_address(post, payment, options)
|
94
|
+
|
95
|
+
commit('auth', post)
|
96
|
+
end
|
97
|
+
|
98
|
+
def capture(money, authorization, options = {})
|
99
|
+
post = {}
|
100
|
+
add_reference(post, authorization)
|
101
|
+
add_invoice(post, money, options)
|
102
|
+
|
103
|
+
commit('capture', post)
|
104
|
+
end
|
105
|
+
|
106
|
+
def refund(money, authorization, options = {})
|
107
|
+
post = {}
|
108
|
+
add_reference(post, authorization)
|
109
|
+
add_invoice(post, money, options)
|
110
|
+
commit('refund', post)
|
111
|
+
end
|
112
|
+
|
113
|
+
def void(authorization, options = {})
|
114
|
+
post = {}
|
115
|
+
add_reference(post, authorization)
|
116
|
+
commit('void', post)
|
117
|
+
end
|
118
|
+
|
119
|
+
def verify(credit_card, options = {})
|
120
|
+
post = {}
|
121
|
+
add_invoice(post, 0, options)
|
122
|
+
add_payment(post, credit_card)
|
123
|
+
add_address(post, credit_card, options)
|
124
|
+
commit('verify', post)
|
125
|
+
end
|
126
|
+
|
127
|
+
def supports_scrubbing?
|
128
|
+
true
|
129
|
+
end
|
130
|
+
|
131
|
+
def scrub(transcript)
|
132
|
+
%w(ccnumber cvv password).each do |field|
|
133
|
+
transcript = transcript.gsub(%r((#{field}=)[^&]+), '\1[FILTERED]\2')
|
134
|
+
end
|
135
|
+
|
136
|
+
transcript
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
140
|
+
|
141
|
+
def add_address(post, creditcard, options = {})
|
142
|
+
post[:firstname] = creditcard.first_name
|
143
|
+
post[:lastname] = creditcard.last_name
|
144
|
+
|
145
|
+
return unless options[:billing_address]
|
146
|
+
|
147
|
+
address = options[:billing_address]
|
148
|
+
post[:address1] = address[:address1]
|
149
|
+
post[:address2] = address[:address2]
|
150
|
+
post[:city] = address[:city]
|
151
|
+
post[:state] = address[:state]
|
152
|
+
post[:zip] = address[:zip]
|
153
|
+
post[:country] = address[:country]
|
154
|
+
post[:phone] = address[:phone]
|
155
|
+
end
|
156
|
+
|
157
|
+
def add_reference(post, authorization)
|
158
|
+
transaction_id, authcode = split_authorization(authorization)
|
159
|
+
post['transactionid'] = transaction_id
|
160
|
+
post['authcode'] = authcode
|
161
|
+
end
|
162
|
+
|
163
|
+
def add_invoice(post, money, options)
|
164
|
+
post[:amount] = amount(money)
|
165
|
+
post[:currency] = (options[:currency] || default_currency)
|
166
|
+
end
|
167
|
+
|
168
|
+
def add_payment(post, payment)
|
169
|
+
post[:ccnumber] = payment.number
|
170
|
+
post[:ccexp] = "#{payment.month.to_s.rjust(2, '0')}#{payment.year.to_s[-2..-1]}"
|
171
|
+
post[:cvv] = payment.verification_value
|
172
|
+
end
|
173
|
+
|
174
|
+
def parse(body)
|
175
|
+
kvs = body.split('&')
|
176
|
+
|
177
|
+
kvs.inject({}) { |h, kv|
|
178
|
+
k, v = kv.split('=')
|
179
|
+
h[k] = v
|
180
|
+
h
|
181
|
+
}
|
182
|
+
end
|
183
|
+
|
184
|
+
def commit(action, parameters)
|
185
|
+
url = live_url
|
186
|
+
parameters[:type] = action
|
187
|
+
|
188
|
+
response_body = ssl_post(url, post_data(parameters))
|
189
|
+
response = parse(response_body)
|
190
|
+
|
191
|
+
Response.new(
|
192
|
+
success_from(response),
|
193
|
+
message_from(response),
|
194
|
+
response,
|
195
|
+
authorization: authorization_from(response),
|
196
|
+
test: test?,
|
197
|
+
error_code: error_code_from(response)
|
198
|
+
)
|
199
|
+
end
|
200
|
+
|
201
|
+
def success_from(response)
|
202
|
+
response['response_code'] == '100'
|
203
|
+
end
|
204
|
+
|
205
|
+
def message_from(response)
|
206
|
+
response['responsetext']
|
207
|
+
end
|
208
|
+
|
209
|
+
def authorization_from(response)
|
210
|
+
[response['transactionid'], response['authcode']].join('#')
|
211
|
+
end
|
212
|
+
|
213
|
+
def split_authorization(authorization)
|
214
|
+
transaction_id, authcode = authorization.split('#')
|
215
|
+
[transaction_id, authcode]
|
216
|
+
end
|
217
|
+
|
218
|
+
def post_data(parameters = {})
|
219
|
+
parameters[:password] = @options[:password]
|
220
|
+
parameters[:username] = @options[:username]
|
221
|
+
|
222
|
+
parameters.collect { |k, v| "#{k}=#{v}" }.join('&')
|
223
|
+
end
|
224
|
+
|
225
|
+
def error_code_from(response)
|
226
|
+
STANDARD_ERROR_CODE_MAPPING[response['response_code']]
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|