activemerchant 1.45.0 → 1.126.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +2167 -2
- data/CONTRIBUTORS +57 -0
- data/README.md +62 -41
- data/lib/active_merchant/billing/avs_result.rb +25 -28
- data/lib/active_merchant/billing/base.rb +11 -35
- data/lib/active_merchant/billing/check.rb +28 -24
- data/lib/active_merchant/billing/compatibility.rb +10 -12
- data/lib/active_merchant/billing/credit_card.rb +141 -69
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +348 -52
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +125 -61
- data/lib/active_merchant/billing/gateways/adyen.rb +633 -127
- data/lib/active_merchant/billing/gateways/airwallex.rb +341 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +883 -195
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +104 -103
- data/lib/active_merchant/billing/gateways/axcessms.rb +179 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
- data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
- data/lib/active_merchant/billing/gateways/banwire.rb +24 -13
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +397 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
- data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +143 -62
- data/lib/active_merchant/billing/gateways/beanstream.rb +45 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +13 -10
- data/lib/active_merchant/billing/gateways/blue_pay.rb +549 -506
- data/lib/active_merchant/billing/gateways/blue_snap.rb +623 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +82 -36
- data/lib/active_merchant/billing/gateways/borgun.rb +61 -40
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +21 -2
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +3 -3
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +592 -203
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +116 -61
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +320 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +248 -97
- 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 +70 -26
- data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
- data/lib/active_merchant/billing/gateways/cecabank.rb +73 -53
- data/lib/active_merchant/billing/gateways/cenpos.rb +328 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +32 -33
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +340 -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/commercegate.rb +11 -12
- data/lib/active_merchant/billing/gateways/conekta.rb +55 -34
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +506 -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.rb +637 -221
- data/lib/active_merchant/billing/gateways/d_local.rb +303 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +57 -355
- data/lib/active_merchant/billing/gateways/decidir.rb +347 -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 +334 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
- data/lib/active_merchant/billing/gateways/elavon.rb +377 -250
- data/lib/active_merchant/billing/gateways/element.rb +386 -0
- data/lib/active_merchant/billing/gateways/epay.rb +92 -71
- data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
- data/lib/active_merchant/billing/gateways/eway.rb +85 -73
- data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +134 -80
- data/lib/active_merchant/billing/gateways/exact.rb +37 -36
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +124 -74
- data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
- data/lib/active_merchant/billing/gateways/finansbank.rb +4 -5
- data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
- data/lib/active_merchant/billing/gateways/first_pay.rb +45 -23
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +184 -87
- 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/forte.rb +286 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +31 -32
- data/lib/active_merchant/billing/gateways/global_collect.rb +507 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +25 -15
- data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
- data/lib/active_merchant/billing/gateways/hps.rb +252 -68
- data/lib/active_merchant/billing/gateways/iats_payments.rb +99 -38
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +48 -48
- data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
- data/lib/active_merchant/billing/gateways/ipg.rb +415 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +176 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +254 -244
- data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
- data/lib/active_merchant/billing/gateways/iveri.rb +254 -0
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +200 -80
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +432 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +277 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +412 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +95 -85
- data/lib/active_merchant/billing/gateways/litle.rb +371 -94
- data/lib/active_merchant/billing/gateways/mastercard.rb +293 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +146 -123
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +331 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +47 -23
- data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +60 -44
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +76 -23
- data/lib/active_merchant/billing/gateways/mercury.rb +73 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +33 -43
- data/lib/active_merchant/billing/gateways/micropayment.rb +182 -0
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +101 -37
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +30 -34
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +422 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +236 -72
- data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
- data/lib/active_merchant/billing/gateways/mundipagg.rb +363 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +87 -68
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +163 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
- data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
- data/lib/active_merchant/billing/gateways/netbanx.rb +376 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +82 -43
- data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
- data/lib/active_merchant/billing/gateways/nmi.rb +279 -174
- data/lib/active_merchant/billing/gateways/ogone.rb +96 -50
- data/lib/active_merchant/billing/gateways/omise.rb +323 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +58 -23
- data/lib/active_merchant/billing/gateways/opp.rb +394 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +87 -69
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
- data/lib/active_merchant/billing/gateways/orbital.rb +771 -328
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +31 -32
- data/lib/active_merchant/billing/gateways/pagarme.rb +239 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
- 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 +84 -68
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +206 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
- data/lib/active_merchant/billing/gateways/pay_trace.rb +404 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +85 -49
- data/lib/active_merchant/billing/gateways/payeezy.rb +458 -0
- data/lib/active_merchant/billing/gateways/payex.rb +39 -42
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +67 -41
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +215 -46
- data/lib/active_merchant/billing/gateways/payflow_express.rb +64 -68
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +78 -58
- data/lib/active_merchant/billing/gateways/paymentez.rb +353 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +163 -75
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal.rb +37 -18
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal_express.rb +12 -6
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/paysafe.rb +412 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -91
- data/lib/active_merchant/billing/gateways/payu_in.rb +249 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +479 -0
- data/lib/active_merchant/billing/gateways/payway.rb +27 -27
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +113 -37
- data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
- data/lib/active_merchant/billing/gateways/priority.rb +369 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +325 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +55 -44
- data/lib/active_merchant/billing/gateways/psl_card.rb +32 -40
- data/lib/active_merchant/billing/gateways/qbms.rb +86 -76
- data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
- 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 +10 -353
- data/lib/active_merchant/billing/gateways/qvalent.rb +305 -0
- data/lib/active_merchant/billing/gateways/rapyd.rb +258 -0
- data/lib/active_merchant/billing/gateways/realex.rb +154 -52
- data/lib/active_merchant/billing/gateways/redsys.rb +488 -161
- 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 +404 -133
- data/lib/active_merchant/billing/gateways/sage_pay.rb +145 -109
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
- data/lib/active_merchant/billing/gateways/secure_net.rb +62 -54
- data/lib/active_merchant/billing/gateways/secure_pay.rb +32 -42
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +36 -27
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
- data/lib/active_merchant/billing/gateways/securion_pay.rb +265 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +362 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -54
- data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +108 -43
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -120
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +516 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +19 -25
- data/lib/active_merchant/billing/gateways/telr.rb +273 -0
- data/lib/active_merchant/billing/gateways/tns.rb +16 -217
- data/lib/active_merchant/billing/gateways/trans_first.rb +148 -34
- 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 +6 -8
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +221 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +162 -89
- data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +332 -236
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +185 -72
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
- data/lib/active_merchant/billing/gateways/viaklix.rb +19 -31
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +250 -0
- data/lib/active_merchant/billing/gateways/vpos.rb +220 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +108 -62
- data/lib/active_merchant/billing/gateways/wirecard.rb +52 -43
- data/lib/active_merchant/billing/gateways/wompi.rb +193 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +345 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +725 -121
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +208 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +79 -39
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +1 -1
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/billing/response.rb +19 -13
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +3 -0
- data/lib/active_merchant/connection.rb +196 -0
- data/lib/active_merchant/country.rb +13 -8
- data/lib/active_merchant/errors.rb +6 -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 +1 -1
- data/lib/active_merchant.rb +14 -59
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3214 -0
- data/lib/support/gateway_support.rb +8 -10
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +9 -14
- data/lib/support/ssl_version.rb +86 -0
- metadata +136 -94
- checksums.yaml.gz.sig +0 -1
- data/lib/active_merchant/billing/gateways/app55.rb +0 -176
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -278
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -291
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -87
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_vault.rb +0 -149
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -385
- data/lib/active_merchant/offsite_payments_shim.rb +0 -19
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -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
|
@@ -35,10 +35,10 @@ module ActiveMerchant #:nodoc:
|
|
35
35
|
# :email => 'jack@yahoo.com'
|
36
36
|
# )
|
37
37
|
class PsigateGateway < Gateway
|
38
|
-
self.test_url = 'https://
|
39
|
-
self.live_url = 'https://
|
38
|
+
self.test_url = 'https://realtimestaging.psigate.com/xml'
|
39
|
+
self.live_url = 'https://realtime.psigate.com/xml'
|
40
40
|
|
41
|
-
self.supported_cardtypes = [
|
41
|
+
self.supported_cardtypes = %i[visa master american_express]
|
42
42
|
self.supported_countries = ['CA']
|
43
43
|
self.homepage_url = 'http://www.psigate.com/'
|
44
44
|
self.display_name = 'Psigate'
|
@@ -53,18 +53,18 @@ module ActiveMerchant #:nodoc:
|
|
53
53
|
|
54
54
|
def authorize(money, creditcard, options = {})
|
55
55
|
requires!(options, :order_id)
|
56
|
-
options[:CardAction] =
|
56
|
+
options[:CardAction] = '1'
|
57
57
|
commit(money, creditcard, options)
|
58
58
|
end
|
59
59
|
|
60
60
|
def purchase(money, creditcard, options = {})
|
61
61
|
requires!(options, :order_id)
|
62
|
-
options[:CardAction] =
|
62
|
+
options[:CardAction] = '0'
|
63
63
|
commit(money, creditcard, options)
|
64
64
|
end
|
65
65
|
|
66
66
|
def capture(money, authorization, options = {})
|
67
|
-
options[:CardAction] =
|
67
|
+
options[:CardAction] = '2'
|
68
68
|
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
69
69
|
commit(money, nil, options)
|
70
70
|
end
|
@@ -75,28 +75,38 @@ module ActiveMerchant #:nodoc:
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def refund(money, authorization, options = {})
|
78
|
-
options[:CardAction] =
|
78
|
+
options[:CardAction] = '3'
|
79
79
|
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
80
80
|
commit(money, nil, options)
|
81
81
|
end
|
82
82
|
|
83
83
|
def void(authorization, options = {})
|
84
|
-
options[:CardAction] =
|
84
|
+
options[:CardAction] = '9'
|
85
85
|
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
86
86
|
commit(nil, nil, options)
|
87
87
|
end
|
88
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
|
+
|
89
100
|
private
|
90
101
|
|
91
102
|
def commit(money, creditcard, options = {})
|
92
103
|
response = parse(ssl_post(url, post_data(money, creditcard, options)))
|
93
104
|
|
94
105
|
Response.new(successful?(response), message_from(response), response,
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
98
|
-
:
|
99
|
-
)
|
106
|
+
test: test?,
|
107
|
+
authorization: build_authorization(response),
|
108
|
+
avs_result: { code: response[:avsresult] },
|
109
|
+
cvv_result: response[:cardidresult])
|
100
110
|
end
|
101
111
|
|
102
112
|
def url
|
@@ -104,11 +114,11 @@ module ActiveMerchant #:nodoc:
|
|
104
114
|
end
|
105
115
|
|
106
116
|
def successful?(response)
|
107
|
-
response[:approved] ==
|
117
|
+
response[:approved] == 'APPROVED'
|
108
118
|
end
|
109
119
|
|
110
120
|
def parse(xml)
|
111
|
-
response = {:
|
121
|
+
response = { message: 'Global Error Receipt', complete: false }
|
112
122
|
|
113
123
|
xml = REXML::Document.new(xml)
|
114
124
|
xml.elements.each('//Result/*') do |node|
|
@@ -121,7 +131,7 @@ module ActiveMerchant #:nodoc:
|
|
121
131
|
def post_data(money, creditcard, options)
|
122
132
|
xml = REXML::Document.new
|
123
133
|
xml << REXML::XMLDecl.new
|
124
|
-
root = xml.add_element(
|
134
|
+
root = xml.add_element('Order')
|
125
135
|
|
126
136
|
parameters(money, creditcard, options).each do |key, value|
|
127
137
|
root.add_element(key.to_s).text = value if value
|
@@ -133,43 +143,43 @@ module ActiveMerchant #:nodoc:
|
|
133
143
|
def parameters(money, creditcard, options = {})
|
134
144
|
params = {
|
135
145
|
# General order parameters
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
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],
|
145
155
|
|
146
156
|
# Credit Card parameters
|
147
|
-
:
|
148
|
-
:
|
157
|
+
PaymentType: 'CC',
|
158
|
+
CardAction: options[:CardAction],
|
149
159
|
|
150
160
|
# Financial parameters
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
161
|
+
CustomerIP: options[:ip],
|
162
|
+
SubTotal: amount(money),
|
163
|
+
Tax1: options[:tax1],
|
164
|
+
Tax2: options[:tax2],
|
165
|
+
ShippingTotal: options[:shipping_total]
|
156
166
|
}
|
157
167
|
|
158
168
|
if creditcard
|
159
|
-
exp_month = sprintf(
|
160
|
-
exp_year = creditcard.year.to_s[2,2] unless creditcard.year.blank?
|
161
|
-
card_id_code = (creditcard.verification_value.blank? ? nil :
|
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')
|
162
172
|
|
163
173
|
params.update(
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
174
|
+
CardNumber: creditcard.number,
|
175
|
+
CardExpMonth: exp_month,
|
176
|
+
CardExpYear: exp_year,
|
177
|
+
CardIDCode: card_id_code,
|
178
|
+
CardIDNumber: creditcard.verification_value
|
169
179
|
)
|
170
180
|
end
|
171
181
|
|
172
|
-
if(address = (options[:billing_address] || options[:address]))
|
182
|
+
if (address = (options[:billing_address] || options[:address]))
|
173
183
|
params[:Bname] = address[:name] || creditcard.name
|
174
184
|
params[:Baddress1] = address[:address1] unless address[:address1].blank?
|
175
185
|
params[:Baddress2] = address[:address2] unless address[:address2].blank?
|
@@ -195,11 +205,12 @@ module ActiveMerchant #:nodoc:
|
|
195
205
|
end
|
196
206
|
|
197
207
|
def message_from(response)
|
198
|
-
if response[:approved] ==
|
208
|
+
if response[:approved] == 'APPROVED'
|
199
209
|
return SUCCESS_MESSAGE
|
200
210
|
else
|
201
211
|
return FAILURE_MESSAGE if response[:errmsg].blank?
|
202
|
-
|
212
|
+
|
213
|
+
return response[:errmsg].gsub(/[^\w]/, ' ').split.join(' ').capitalize
|
203
214
|
end
|
204
215
|
end
|
205
216
|
|
@@ -209,7 +220,7 @@ module ActiveMerchant #:nodoc:
|
|
209
220
|
end
|
210
221
|
|
211
222
|
def build_authorization(response)
|
212
|
-
[response[:orderid], response[:transrefnumber]].join(
|
223
|
+
[response[:orderid], response[:transrefnumber]].join(';')
|
213
224
|
end
|
214
225
|
end
|
215
226
|
end
|