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,325 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class ProPayGateway < Gateway
|
6
|
+
self.test_url = 'https://xmltest.propay.com/API/PropayAPI.aspx'
|
7
|
+
self.live_url = 'https://epay.propay.com/api/propayapi.aspx'
|
8
|
+
|
9
|
+
self.supported_countries = %w[US CA]
|
10
|
+
self.default_currency = 'USD'
|
11
|
+
self.money_format = :cents
|
12
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
13
|
+
|
14
|
+
self.homepage_url = 'https://www.propay.com/'
|
15
|
+
self.display_name = 'ProPay'
|
16
|
+
|
17
|
+
STATUS_RESPONSE_CODES = {
|
18
|
+
'00' => 'Success',
|
19
|
+
'20' => 'Invalid username',
|
20
|
+
'21' => 'Invalid transType',
|
21
|
+
'22' => 'Invalid Currency Code',
|
22
|
+
'23' => 'Invalid accountType',
|
23
|
+
'24' => 'Invalid sourceEmail',
|
24
|
+
'25' => 'Invalid firstName',
|
25
|
+
'26' => 'Invalid mInitial',
|
26
|
+
'27' => 'Invalid lastName',
|
27
|
+
'28' => 'Invalid billAddr',
|
28
|
+
'29' => 'Invalid aptNum',
|
29
|
+
'30' => 'Invalid city',
|
30
|
+
'31' => 'Invalid state',
|
31
|
+
'32' => 'Invalid billZip',
|
32
|
+
'33' => 'Invalid mailAddr',
|
33
|
+
'34' => 'Invalid mailApt',
|
34
|
+
'35' => 'Invalid mailCity',
|
35
|
+
'36' => 'Invalid mailState',
|
36
|
+
'37' => 'Invalid mailZip',
|
37
|
+
'38' => 'Invalid dayPhone',
|
38
|
+
'39' => 'Invalid evenPhone',
|
39
|
+
'40' => 'Invalid ssn',
|
40
|
+
'41' => 'Invalid dob',
|
41
|
+
'42' => 'Invalid recEmail',
|
42
|
+
'43' => 'Invalid knownAccount',
|
43
|
+
'44' => 'Invalid amount',
|
44
|
+
'45' => 'Invalid invNum',
|
45
|
+
'46' => 'Invalid rtNum',
|
46
|
+
'47' => 'Invalid accntNum',
|
47
|
+
'48' => 'Invalid ccNum',
|
48
|
+
'49' => 'Invalid expDate',
|
49
|
+
'50' => 'Invalid cvv2',
|
50
|
+
'51' => 'Invalid transNum and/or Unable to act perform actions on transNum due to funding',
|
51
|
+
'52' => 'Invalid splitNum',
|
52
|
+
'53' => 'A ProPay account with this email address already exists AND/OR User has no account number',
|
53
|
+
'54' => 'A ProPay account with this social security number already exists',
|
54
|
+
'55' => 'The email address provided does not correspond to a ProPay account.',
|
55
|
+
'56' => 'Recipient’s email address shouldn’t have a ProPay account and does',
|
56
|
+
'57' => 'Cannot settle transaction because it already expired',
|
57
|
+
'58' => 'Credit card declined',
|
58
|
+
'59' => 'Invalid Credential or IP address not allowed',
|
59
|
+
'60' => 'Credit card authorization timed out; retry at a later time',
|
60
|
+
'61' => 'Amount exceeds single transaction limit',
|
61
|
+
'62' => 'Amount exceeds monthly volume limit',
|
62
|
+
'63' => 'Insufficient funds in account',
|
63
|
+
'64' => 'Over credit card use limit',
|
64
|
+
'65' => 'Miscellaneous error',
|
65
|
+
'66' => 'Denied a ProPay account',
|
66
|
+
'67' => 'Unauthorized service requested',
|
67
|
+
'68' => 'Account not affiliated',
|
68
|
+
'69' => 'Duplicate invoice number (The same card was charged for the same amount with the same invoice number (including blank invoices) in a 1 minute period. Details about the original transaction are included whenever a 69 response is returned. These details include a repeat of the auth code, the original AVS response, and the original CVV response.)',
|
69
|
+
'70' => 'Duplicate external ID',
|
70
|
+
'71' => 'Account previously set up, but problem affiliating it with partner',
|
71
|
+
'72' => 'The ProPay Account has already been upgraded to a Premium Account',
|
72
|
+
'73' => 'Invalid Destination Account',
|
73
|
+
'74' => 'Account or Trans Error',
|
74
|
+
'75' => 'Money already pulled',
|
75
|
+
'76' => 'Not Premium (used only for push/pull transactions)',
|
76
|
+
'77' => 'Empty results',
|
77
|
+
'78' => 'Invalid Authentication',
|
78
|
+
'79' => 'Generic account status error',
|
79
|
+
'80' => 'Invalid Password',
|
80
|
+
'81' => 'Account Expired',
|
81
|
+
'82' => 'InvalidUserID',
|
82
|
+
'83' => 'BatchTransCountError',
|
83
|
+
'84' => 'InvalidBeginDate',
|
84
|
+
'85' => 'InvalidEndDate',
|
85
|
+
'86' => 'InvalidExternalID',
|
86
|
+
'87' => 'DuplicateUserID',
|
87
|
+
'88' => 'Invalid track 1',
|
88
|
+
'89' => 'Invalid track 2',
|
89
|
+
'90' => 'Transaction already refunded',
|
90
|
+
'91' => 'Duplicate Batch ID'
|
91
|
+
}
|
92
|
+
|
93
|
+
TRANSACTION_RESPONSE_CODES = {
|
94
|
+
'00' => 'Success',
|
95
|
+
'1' => 'Transaction blocked by issuer',
|
96
|
+
'4' => 'Pick up card and deny transaction',
|
97
|
+
'5' => 'Problem with the account',
|
98
|
+
'6' => 'Customer requested stop to recurring payment',
|
99
|
+
'7' => 'Customer requested stop to all recurring payments',
|
100
|
+
'8' => 'Honor with ID only',
|
101
|
+
'9' => 'Unpaid items on customer account',
|
102
|
+
'12' => 'Invalid transaction',
|
103
|
+
'13' => 'Amount Error',
|
104
|
+
'14' => 'Invalid card number',
|
105
|
+
'15' => 'No such issuer. Could not route transaction',
|
106
|
+
'16' => 'Refund error',
|
107
|
+
'17' => 'Over limit',
|
108
|
+
'19' => 'Reenter transaction or the merchant account may be boarded incorrectly',
|
109
|
+
'25' => 'Invalid terminal 41 Lost card',
|
110
|
+
'43' => 'Stolen card',
|
111
|
+
'51' => 'Insufficient funds',
|
112
|
+
'52' => 'No such account',
|
113
|
+
'54' => 'Expired card',
|
114
|
+
'55' => 'Incorrect PIN',
|
115
|
+
'57' => 'Bank does not allow this type of purchase',
|
116
|
+
'58' => 'Credit card network does not allow this type of purchase for your merchant account.',
|
117
|
+
'61' => 'Exceeds issuer withdrawal limit',
|
118
|
+
'62' => 'Issuer does not allow this card to be charged for your business.',
|
119
|
+
'63' => 'Security Violation',
|
120
|
+
'65' => 'Activity limit exceeded',
|
121
|
+
'75' => 'PIN tries exceeded',
|
122
|
+
'76' => 'Unable to locate account',
|
123
|
+
'78' => 'Account not recognized',
|
124
|
+
'80' => 'Invalid Date',
|
125
|
+
'82' => 'Invalid CVV2',
|
126
|
+
'83' => 'Cannot verify the PIN',
|
127
|
+
'85' => 'Service not supported for this card',
|
128
|
+
'93' => 'Cannot complete transaction. Customer should call 800 number.',
|
129
|
+
'95' => 'Misc Error Transaction failure',
|
130
|
+
'96' => 'Issuer system malfunction or timeout.',
|
131
|
+
'97' => 'Approved for a lesser amount. ProPay will not settle and consider this a decline.',
|
132
|
+
'98' => 'Failure HV',
|
133
|
+
'99' => 'Generic decline or unable to parse issuer response code'
|
134
|
+
}
|
135
|
+
|
136
|
+
def initialize(options = {})
|
137
|
+
requires!(options, :cert_str)
|
138
|
+
super
|
139
|
+
end
|
140
|
+
|
141
|
+
def purchase(money, payment, options = {})
|
142
|
+
request = build_xml_request do |xml|
|
143
|
+
add_invoice(xml, money, options)
|
144
|
+
add_payment(xml, payment, options)
|
145
|
+
add_address(xml, options)
|
146
|
+
add_account(xml, options)
|
147
|
+
add_recurring(xml, options)
|
148
|
+
xml.transType '04'
|
149
|
+
end
|
150
|
+
|
151
|
+
commit(request)
|
152
|
+
end
|
153
|
+
|
154
|
+
def authorize(money, payment, options = {})
|
155
|
+
request = build_xml_request do |xml|
|
156
|
+
add_invoice(xml, money, options)
|
157
|
+
add_payment(xml, payment, options)
|
158
|
+
add_address(xml, options)
|
159
|
+
add_account(xml, options)
|
160
|
+
add_recurring(xml, options)
|
161
|
+
xml.transType '05'
|
162
|
+
end
|
163
|
+
|
164
|
+
commit(request)
|
165
|
+
end
|
166
|
+
|
167
|
+
def capture(money, authorization, options = {})
|
168
|
+
request = build_xml_request do |xml|
|
169
|
+
add_invoice(xml, money, options)
|
170
|
+
add_account(xml, options)
|
171
|
+
xml.transNum authorization
|
172
|
+
xml.transType '06'
|
173
|
+
end
|
174
|
+
|
175
|
+
commit(request)
|
176
|
+
end
|
177
|
+
|
178
|
+
def refund(money, authorization, options = {})
|
179
|
+
request = build_xml_request do |xml|
|
180
|
+
add_invoice(xml, money, options)
|
181
|
+
add_account(xml, options)
|
182
|
+
xml.transNum authorization
|
183
|
+
xml.transType '07'
|
184
|
+
end
|
185
|
+
|
186
|
+
commit(request)
|
187
|
+
end
|
188
|
+
|
189
|
+
def void(authorization, options = {})
|
190
|
+
refund(nil, authorization, options)
|
191
|
+
end
|
192
|
+
|
193
|
+
def credit(money, payment, options = {})
|
194
|
+
request = build_xml_request do |xml|
|
195
|
+
add_invoice(xml, money, options)
|
196
|
+
add_payment(xml, payment, options)
|
197
|
+
add_account(xml, options)
|
198
|
+
xml.transType '35'
|
199
|
+
end
|
200
|
+
|
201
|
+
commit(request)
|
202
|
+
end
|
203
|
+
|
204
|
+
def verify(credit_card, options = {})
|
205
|
+
MultiResponse.run(:use_first_response) do |r|
|
206
|
+
r.process { authorize(100, credit_card, options) }
|
207
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def supports_scrubbing?
|
212
|
+
true
|
213
|
+
end
|
214
|
+
|
215
|
+
def scrub(transcript)
|
216
|
+
transcript.
|
217
|
+
gsub(%r((<certStr>).+(</certStr>)), '\1[FILTERED]\2').
|
218
|
+
gsub(%r((<ccNum>).+(</ccNum>)), '\1[FILTERED]\2').
|
219
|
+
gsub(%r((<CVV2>).+(</CVV2>)), '\1[FILTERED]\2')
|
220
|
+
end
|
221
|
+
|
222
|
+
private
|
223
|
+
|
224
|
+
def add_payment(xml, payment, options)
|
225
|
+
xml.ccNum payment.number
|
226
|
+
xml.expDate "#{format(payment.month, :two_digits)}#{format(payment.year, :two_digits)}"
|
227
|
+
xml.CVV2 payment.verification_value
|
228
|
+
xml.cardholderName payment.name
|
229
|
+
end
|
230
|
+
|
231
|
+
def add_address(xml, options)
|
232
|
+
if address = options[:billing_address] || options[:address]
|
233
|
+
xml.addr address[:address1]
|
234
|
+
xml.aptNum address[:address2]
|
235
|
+
xml.city address[:city]
|
236
|
+
xml.state address[:state]
|
237
|
+
xml.zip address[:zip].to_s.delete('-')
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
def add_account(xml, options)
|
242
|
+
xml.accountNum options[:account_num]
|
243
|
+
end
|
244
|
+
|
245
|
+
def add_invoice(xml, money, options)
|
246
|
+
xml.amount amount(money)
|
247
|
+
xml.currencyCode options[:currency] || currency(money)
|
248
|
+
xml.invNum options[:order_id] || SecureRandom.hex(25)
|
249
|
+
end
|
250
|
+
|
251
|
+
def add_recurring(xml, options)
|
252
|
+
xml.recurringPayment options[:recurring_payment]
|
253
|
+
end
|
254
|
+
|
255
|
+
def parse(body)
|
256
|
+
results = {}
|
257
|
+
xml = Nokogiri::XML(body)
|
258
|
+
resp = xml.xpath('//XMLResponse/XMLTrans')
|
259
|
+
resp.children.each do |element|
|
260
|
+
results[element.name.underscore.downcase.to_sym] = element.text
|
261
|
+
end
|
262
|
+
results
|
263
|
+
end
|
264
|
+
|
265
|
+
def commit(parameters)
|
266
|
+
url = (test? ? test_url : live_url)
|
267
|
+
response = parse(ssl_post(url, parameters))
|
268
|
+
|
269
|
+
Response.new(
|
270
|
+
success_from(response),
|
271
|
+
message_from(response),
|
272
|
+
response,
|
273
|
+
authorization: authorization_from(response),
|
274
|
+
avs_result: AVSResult.new(code: response[:avs]),
|
275
|
+
cvv_result: CVVResult.new(response[:cvv2_resp]),
|
276
|
+
test: test?,
|
277
|
+
error_code: error_code_from(response)
|
278
|
+
)
|
279
|
+
end
|
280
|
+
|
281
|
+
def success_from(response)
|
282
|
+
response[:status] == '00'
|
283
|
+
end
|
284
|
+
|
285
|
+
def message_from(response)
|
286
|
+
return 'Success' if success_from(response)
|
287
|
+
|
288
|
+
message = STATUS_RESPONSE_CODES[response[:status]]
|
289
|
+
message += " - #{TRANSACTION_RESPONSE_CODES[response[:response_code]]}" if response[:response_code]
|
290
|
+
|
291
|
+
message
|
292
|
+
end
|
293
|
+
|
294
|
+
def authorization_from(response)
|
295
|
+
response[:trans_num]
|
296
|
+
end
|
297
|
+
|
298
|
+
def error_code_from(response)
|
299
|
+
response[:status] unless success_from(response)
|
300
|
+
end
|
301
|
+
|
302
|
+
def build_xml_request
|
303
|
+
builder = Nokogiri::XML::Builder.new do |xml|
|
304
|
+
xml.XMLRequest do
|
305
|
+
xml.certStr @options[:cert_str]
|
306
|
+
xml.class_ 'partner'
|
307
|
+
xml.XMLTrans do
|
308
|
+
yield(xml)
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
builder.to_xml
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
def underscore(camel_cased_word)
|
318
|
+
camel_cased_word.to_s.gsub(/::/, '/').
|
319
|
+
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
|
320
|
+
gsub(/([a-z\d])([A-Z])/, '\1_\2').
|
321
|
+
tr('-', '_').
|
322
|
+
downcase
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|
@@ -0,0 +1,227 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
# This class implements the Psigate gateway for the ActiveMerchant module.
|
6
|
+
#
|
7
|
+
# Modifications by Sean O'Hara ( sohara at sohara dot com )
|
8
|
+
#
|
9
|
+
# Usage for a PreAuth (authorize) is as follows:
|
10
|
+
#
|
11
|
+
# gateway = PsigateGateway.new(
|
12
|
+
# :login => 'teststore',
|
13
|
+
# :password => 'psigate1234'
|
14
|
+
# )
|
15
|
+
#
|
16
|
+
# creditcard = CreditCard.new(
|
17
|
+
# :number => '4242424242424242',
|
18
|
+
# :month => 8,
|
19
|
+
# :year => 2006,
|
20
|
+
# :first_name => 'Longbob',
|
21
|
+
# :last_name => 'Longsen'
|
22
|
+
# )
|
23
|
+
#
|
24
|
+
# twenty = 2000
|
25
|
+
# response = @gateway.authorize(twenty, creditcard,
|
26
|
+
# :order_id => 1234,
|
27
|
+
# :billing_address => {
|
28
|
+
# :address1 => '123 fairweather Lane',
|
29
|
+
# :address2 => 'Apt B',
|
30
|
+
# :city => 'New York',
|
31
|
+
# :state => 'NY',
|
32
|
+
# :country => 'U.S.A.',
|
33
|
+
# :zip => '10010'
|
34
|
+
# },
|
35
|
+
# :email => 'jack@yahoo.com'
|
36
|
+
# )
|
37
|
+
class PsigateGateway < Gateway
|
38
|
+
self.test_url = 'https://realtimestaging.psigate.com/xml'
|
39
|
+
self.live_url = 'https://realtime.psigate.com/xml'
|
40
|
+
|
41
|
+
self.supported_cardtypes = %i[visa master american_express]
|
42
|
+
self.supported_countries = ['CA']
|
43
|
+
self.homepage_url = 'http://www.psigate.com/'
|
44
|
+
self.display_name = 'Psigate'
|
45
|
+
|
46
|
+
SUCCESS_MESSAGE = 'Success'
|
47
|
+
FAILURE_MESSAGE = 'The transaction was declined'
|
48
|
+
|
49
|
+
def initialize(options = {})
|
50
|
+
requires!(options, :login, :password)
|
51
|
+
super
|
52
|
+
end
|
53
|
+
|
54
|
+
def authorize(money, creditcard, options = {})
|
55
|
+
requires!(options, :order_id)
|
56
|
+
options[:CardAction] = '1'
|
57
|
+
commit(money, creditcard, options)
|
58
|
+
end
|
59
|
+
|
60
|
+
def purchase(money, creditcard, options = {})
|
61
|
+
requires!(options, :order_id)
|
62
|
+
options[:CardAction] = '0'
|
63
|
+
commit(money, creditcard, options)
|
64
|
+
end
|
65
|
+
|
66
|
+
def capture(money, authorization, options = {})
|
67
|
+
options[:CardAction] = '2'
|
68
|
+
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
69
|
+
commit(money, nil, options)
|
70
|
+
end
|
71
|
+
|
72
|
+
def credit(money, authorization, options = {})
|
73
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
74
|
+
refund(money, authorization, options)
|
75
|
+
end
|
76
|
+
|
77
|
+
def refund(money, authorization, options = {})
|
78
|
+
options[:CardAction] = '3'
|
79
|
+
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
80
|
+
commit(money, nil, options)
|
81
|
+
end
|
82
|
+
|
83
|
+
def void(authorization, options = {})
|
84
|
+
options[:CardAction] = '9'
|
85
|
+
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
86
|
+
commit(nil, nil, options)
|
87
|
+
end
|
88
|
+
|
89
|
+
def supports_scrubbing?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
def scrub(transcript)
|
94
|
+
transcript.
|
95
|
+
gsub(%r((<Passphrase>)[^<]*(</Passphrase>))i, '\1[FILTERED]\2').
|
96
|
+
gsub(%r((<CardNumber>)[^<]*(</CardNumber>))i, '\1[FILTERED]\2').
|
97
|
+
gsub(%r((<CardIDNumber>)[^<]*(</CardIDNumber>))i, '\1[FILTERED]\2')
|
98
|
+
end
|
99
|
+
|
100
|
+
private
|
101
|
+
|
102
|
+
def commit(money, creditcard, options = {})
|
103
|
+
response = parse(ssl_post(url, post_data(money, creditcard, options)))
|
104
|
+
|
105
|
+
Response.new(successful?(response), message_from(response), response,
|
106
|
+
test: test?,
|
107
|
+
authorization: build_authorization(response),
|
108
|
+
avs_result: { code: response[:avsresult] },
|
109
|
+
cvv_result: response[:cardidresult])
|
110
|
+
end
|
111
|
+
|
112
|
+
def url
|
113
|
+
(test? ? self.test_url : self.live_url)
|
114
|
+
end
|
115
|
+
|
116
|
+
def successful?(response)
|
117
|
+
response[:approved] == 'APPROVED'
|
118
|
+
end
|
119
|
+
|
120
|
+
def parse(xml)
|
121
|
+
response = { message: 'Global Error Receipt', complete: false }
|
122
|
+
|
123
|
+
xml = REXML::Document.new(xml)
|
124
|
+
xml.elements.each('//Result/*') do |node|
|
125
|
+
response[node.name.downcase.to_sym] = normalize(node.text)
|
126
|
+
end unless xml.root.nil?
|
127
|
+
|
128
|
+
response
|
129
|
+
end
|
130
|
+
|
131
|
+
def post_data(money, creditcard, options)
|
132
|
+
xml = REXML::Document.new
|
133
|
+
xml << REXML::XMLDecl.new
|
134
|
+
root = xml.add_element('Order')
|
135
|
+
|
136
|
+
parameters(money, creditcard, options).each do |key, value|
|
137
|
+
root.add_element(key.to_s).text = value if value
|
138
|
+
end
|
139
|
+
|
140
|
+
xml.to_s
|
141
|
+
end
|
142
|
+
|
143
|
+
def parameters(money, creditcard, options = {})
|
144
|
+
params = {
|
145
|
+
# General order parameters
|
146
|
+
StoreID: @options[:login],
|
147
|
+
Passphrase: @options[:password],
|
148
|
+
TestResult: options[:test_result],
|
149
|
+
OrderID: options[:order_id],
|
150
|
+
UserID: options[:user_id],
|
151
|
+
Phone: options[:phone],
|
152
|
+
Fax: options[:fax],
|
153
|
+
Email: options[:email],
|
154
|
+
TransRefNumber: options[:trans_ref_number],
|
155
|
+
|
156
|
+
# Credit Card parameters
|
157
|
+
PaymentType: 'CC',
|
158
|
+
CardAction: options[:CardAction],
|
159
|
+
|
160
|
+
# Financial parameters
|
161
|
+
CustomerIP: options[:ip],
|
162
|
+
SubTotal: amount(money),
|
163
|
+
Tax1: options[:tax1],
|
164
|
+
Tax2: options[:tax2],
|
165
|
+
ShippingTotal: options[:shipping_total]
|
166
|
+
}
|
167
|
+
|
168
|
+
if creditcard
|
169
|
+
exp_month = sprintf('%.2i', creditcard.month) unless creditcard.month.blank?
|
170
|
+
exp_year = creditcard.year.to_s[2, 2] unless creditcard.year.blank?
|
171
|
+
card_id_code = (creditcard.verification_value.blank? ? nil : '1')
|
172
|
+
|
173
|
+
params.update(
|
174
|
+
CardNumber: creditcard.number,
|
175
|
+
CardExpMonth: exp_month,
|
176
|
+
CardExpYear: exp_year,
|
177
|
+
CardIDCode: card_id_code,
|
178
|
+
CardIDNumber: creditcard.verification_value
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
if (address = (options[:billing_address] || options[:address]))
|
183
|
+
params[:Bname] = address[:name] || creditcard.name
|
184
|
+
params[:Baddress1] = address[:address1] unless address[:address1].blank?
|
185
|
+
params[:Baddress2] = address[:address2] unless address[:address2].blank?
|
186
|
+
params[:Bcity] = address[:city] unless address[:city].blank?
|
187
|
+
params[:Bprovince] = address[:state] unless address[:state].blank?
|
188
|
+
params[:Bpostalcode] = address[:zip] unless address[:zip].blank?
|
189
|
+
params[:Bcountry] = address[:country] unless address[:country].blank?
|
190
|
+
params[:Bcompany] = address[:company] unless address[:company].blank?
|
191
|
+
end
|
192
|
+
|
193
|
+
if address = options[:shipping_address]
|
194
|
+
params[:Sname] = address[:name] || creditcard.name
|
195
|
+
params[:Saddress1] = address[:address1] unless address[:address1].blank?
|
196
|
+
params[:Saddress2] = address[:address2] unless address[:address2].blank?
|
197
|
+
params[:Scity] = address[:city] unless address[:city].blank?
|
198
|
+
params[:Sprovince] = address[:state] unless address[:state].blank?
|
199
|
+
params[:Spostalcode] = address[:zip] unless address[:zip].blank?
|
200
|
+
params[:Scountry] = address[:country] unless address[:country].blank?
|
201
|
+
params[:Scompany] = address[:company] unless address[:company].blank?
|
202
|
+
end
|
203
|
+
|
204
|
+
params
|
205
|
+
end
|
206
|
+
|
207
|
+
def message_from(response)
|
208
|
+
if response[:approved] == 'APPROVED'
|
209
|
+
return SUCCESS_MESSAGE
|
210
|
+
else
|
211
|
+
return FAILURE_MESSAGE if response[:errmsg].blank?
|
212
|
+
|
213
|
+
return response[:errmsg].gsub(/[^\w]/, ' ').split.join(' ').capitalize
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
def split_authorization(authorization)
|
218
|
+
order_id, trans_ref_number = authorization.split(';')
|
219
|
+
[order_id, trans_ref_number]
|
220
|
+
end
|
221
|
+
|
222
|
+
def build_authorization(response)
|
223
|
+
[response[:orderid], response[:transrefnumber]].join(';')
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|