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
@@ -17,11 +17,11 @@ module ActiveMerchant
|
|
17
17
|
self.default_currency = 'GBP'
|
18
18
|
|
19
19
|
self.supported_countries = ['GB']
|
20
|
-
# Visa Credit, Visa Debit, Mastercard, Maestro,
|
20
|
+
# Visa Credit, Visa Debit, Mastercard, Maestro, Electron,
|
21
21
|
# American Express, Diners Club, JCB, International Maestro,
|
22
22
|
# Style, Clydesdale Financial Services, Other
|
23
23
|
|
24
|
-
self.supported_cardtypes = [
|
24
|
+
self.supported_cardtypes = %i[visa master american_express diners_club jcb maestro]
|
25
25
|
self.homepage_url = 'http://www.paymentsolutionsltd.com/'
|
26
26
|
self.display_name = 'PSL Payment Solutions'
|
27
27
|
|
@@ -46,38 +46,38 @@ module ActiveMerchant
|
|
46
46
|
'USD' => 840
|
47
47
|
}
|
48
48
|
|
49
|
-
#The terminal used - only for swipe transactions, so hard coded to 32 for online
|
49
|
+
# The terminal used - only for swipe transactions, so hard coded to 32 for online
|
50
50
|
EMV_TERMINAL_TYPE = 32
|
51
51
|
|
52
|
-
#Different Dispatch types
|
52
|
+
# Different Dispatch types
|
53
53
|
DISPATCH_LATER = 'LATER'
|
54
54
|
DISPATCH_NOW = 'NOW'
|
55
55
|
|
56
56
|
# Return codes
|
57
57
|
APPROVED = '00'
|
58
58
|
|
59
|
-
#Nominal amount to authorize for a 'dispatch later' type
|
60
|
-
#The nominal amount is held straight away, when the goods are ready
|
61
|
-
#to be dispatched, PSL is informed and the full amount is the
|
62
|
-
#taken.
|
59
|
+
# Nominal amount to authorize for a 'dispatch later' type
|
60
|
+
# The nominal amount is held straight away, when the goods are ready
|
61
|
+
# to be dispatched, PSL is informed and the full amount is the
|
62
|
+
# taken.
|
63
63
|
NOMINAL_AMOUNT = 101
|
64
64
|
|
65
65
|
AVS_CODE = {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
'ALL MATCH' => 'Y',
|
67
|
+
'SECURITY CODE MATCH ONLY' => 'N',
|
68
|
+
'ADDRESS MATCH ONLY' => 'Y',
|
69
|
+
'NO DATA MATCHES' => 'N',
|
70
|
+
'DATA NOT CHECKED' => 'R',
|
71
|
+
'SECURITY CHECKS NOT SUPPORTED' => 'X'
|
72
72
|
}
|
73
73
|
|
74
74
|
CVV_CODE = {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
'ALL MATCH' => 'M',
|
76
|
+
'SECURITY CODE MATCH ONLY' => 'M',
|
77
|
+
'ADDRESS MATCH ONLY' => 'N',
|
78
|
+
'NO DATA MATCHES' => 'N',
|
79
|
+
'DATA NOT CHECKED' => 'P',
|
80
|
+
'SECURITY CHECKS NOT SUPPORTED' => 'X'
|
81
81
|
}
|
82
82
|
|
83
83
|
# Create a new PslCardGateway
|
@@ -101,7 +101,7 @@ module ActiveMerchant
|
|
101
101
|
# -options:
|
102
102
|
#
|
103
103
|
# Returns:
|
104
|
-
# -
|
104
|
+
# -ActiveMerchant::Billing::Response object
|
105
105
|
#
|
106
106
|
def purchase(money, credit_card, options = {})
|
107
107
|
post = {}
|
@@ -129,7 +129,7 @@ module ActiveMerchant
|
|
129
129
|
# -options:
|
130
130
|
#
|
131
131
|
# Returns:
|
132
|
-
# -
|
132
|
+
# -ActiveMerchant::Billing::Response object
|
133
133
|
#
|
134
134
|
def authorize(money, credit_card, options = {})
|
135
135
|
post = {}
|
@@ -153,7 +153,7 @@ module ActiveMerchant
|
|
153
153
|
# -options:
|
154
154
|
#
|
155
155
|
# Returns:
|
156
|
-
# -
|
156
|
+
# -ActiveMerchant::Billing::Response object
|
157
157
|
#
|
158
158
|
def capture(money, authorization, options = {})
|
159
159
|
post = {}
|
@@ -174,12 +174,6 @@ module ActiveMerchant
|
|
174
174
|
post[:ExpMonth] = credit_card.month
|
175
175
|
post[:ExpYear] = credit_card.year
|
176
176
|
|
177
|
-
if requires_start_date_or_issue_number?(credit_card)
|
178
|
-
post[:IssueNumber] = credit_card.issue_number unless credit_card.issue_number.blank?
|
179
|
-
post[:StartMonth] = credit_card.start_month unless credit_card.start_month.blank?
|
180
|
-
post[:StartYear] = credit_card.start_year unless credit_card.start_year.blank?
|
181
|
-
end
|
182
|
-
|
183
177
|
# CV2 check
|
184
178
|
post[:AVSCV2Check] = credit_card.verification_value? ? 'YES' : 'NO'
|
185
179
|
post[:CV2] = credit_card.verification_value if credit_card.verification_value?
|
@@ -189,7 +183,7 @@ module ActiveMerchant
|
|
189
183
|
address = options[:billing_address] || options[:address]
|
190
184
|
return if address.nil?
|
191
185
|
|
192
|
-
post[:QAAddress] = [
|
186
|
+
post[:QAAddress] = %i[address1 address2 city state].collect { |a| address[a] }.reject(&:blank?).join(' ')
|
193
187
|
post[:QAPostcode] = address[:zip]
|
194
188
|
end
|
195
189
|
|
@@ -217,7 +211,7 @@ module ActiveMerchant
|
|
217
211
|
|
218
212
|
def add_purchase_details(post)
|
219
213
|
post[:EchoAmount] = 'YES'
|
220
|
-
post[:SCBI] = 'YES'
|
214
|
+
post[:SCBI] = 'YES' # Return information about the transaction
|
221
215
|
post[:MessageType] = MESSAGE_TYPE
|
222
216
|
end
|
223
217
|
|
@@ -246,10 +240,9 @@ module ActiveMerchant
|
|
246
240
|
# -a hash with all of the values returned in the PSL response
|
247
241
|
#
|
248
242
|
def parse(body)
|
249
|
-
|
250
243
|
fields = {}
|
251
244
|
for line in body.split('&')
|
252
|
-
key, value = *line.scan(
|
245
|
+
key, value = *line.scan(%r{^(\w+)\=(.*)$}).flatten
|
253
246
|
fields[key] = CGI.unescape(value)
|
254
247
|
end
|
255
248
|
fields.symbolize_keys
|
@@ -264,14 +257,13 @@ module ActiveMerchant
|
|
264
257
|
# - ActiveMerchant::Billing::Response object
|
265
258
|
#
|
266
259
|
def commit(request)
|
267
|
-
response = parse(
|
260
|
+
response = parse(ssl_post(self.live_url, post_data(request)))
|
268
261
|
|
269
262
|
Response.new(response[:ResponseCode] == APPROVED, response[:Message], response,
|
270
|
-
:
|
271
|
-
:
|
272
|
-
:
|
273
|
-
:
|
274
|
-
)
|
263
|
+
test: test?,
|
264
|
+
authorization: response[:CrossReference],
|
265
|
+
cvv_result: CVV_CODE[response[:AVSCV2Check]],
|
266
|
+
avs_result: { code: AVS_CODE[response[:AVSCV2Check]] })
|
275
267
|
end
|
276
268
|
|
277
269
|
# Put the passed data into a format that can be submitted to PSL
|
@@ -296,7 +288,7 @@ module ActiveMerchant
|
|
296
288
|
|
297
289
|
post.collect { |key, value|
|
298
290
|
"#{key}=#{CGI.escape(value.to_s.tr('&=', ' '))}"
|
299
|
-
}.join(
|
291
|
+
}.join('&')
|
300
292
|
end
|
301
293
|
end
|
302
294
|
end
|
@@ -5,22 +5,22 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
|
6
6
|
class_attribute :test_url, :live_url
|
7
7
|
|
8
|
-
self.test_url =
|
9
|
-
self.live_url =
|
8
|
+
self.test_url = 'https://webmerchantaccount.ptc.quickbooks.com/j/AppGateway'
|
9
|
+
self.live_url = 'https://webmerchantaccount.quickbooks.com/j/AppGateway'
|
10
10
|
|
11
11
|
self.homepage_url = 'http://payments.intuit.com/'
|
12
12
|
self.display_name = 'QuickBooks Merchant Services'
|
13
13
|
self.default_currency = 'USD'
|
14
|
-
self.supported_cardtypes = [
|
15
|
-
self.supported_countries = [
|
14
|
+
self.supported_cardtypes = %i[visa master discover american_express diners_club jcb]
|
15
|
+
self.supported_countries = ['US']
|
16
16
|
|
17
17
|
TYPES = {
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
18
|
+
authorize: 'CustomerCreditCardAuth',
|
19
|
+
capture: 'CustomerCreditCardCapture',
|
20
|
+
purchase: 'CustomerCreditCardCharge',
|
21
|
+
refund: 'CustomerCreditCardTxnVoidOrRefund',
|
22
|
+
void: 'CustomerCreditCardTxnVoid',
|
23
|
+
query: 'MerchantAccountQuery'
|
24
24
|
}
|
25
25
|
|
26
26
|
# Creates a new QbmsGateway
|
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
# * <tt>options</tt> -- A hash of optional parameters.
|
52
52
|
#
|
53
53
|
def authorize(money, creditcard, options = {})
|
54
|
-
commit(:authorize, money, options.merge(:
|
54
|
+
commit(:authorize, money, options.merge(credit_card: creditcard))
|
55
55
|
end
|
56
56
|
|
57
57
|
# Perform a purchase, which is essentially an authorization and capture in a single operation.
|
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
|
|
63
63
|
# * <tt>options</tt> -- A hash of optional parameters.
|
64
64
|
#
|
65
65
|
def purchase(money, creditcard, options = {})
|
66
|
-
commit(:purchase, money, options.merge(:
|
66
|
+
commit(:purchase, money, options.merge(credit_card: creditcard))
|
67
67
|
end
|
68
68
|
|
69
69
|
# Captures the funds from an authorized transaction.
|
@@ -74,7 +74,7 @@ module ActiveMerchant #:nodoc:
|
|
74
74
|
# * <tt>authorization</tt> -- The authorization returned from the previous authorize request.
|
75
75
|
#
|
76
76
|
def capture(money, authorization, options = {})
|
77
|
-
commit(:capture, money, options.merge(:
|
77
|
+
commit(:capture, money, options.merge(transaction_id: authorization))
|
78
78
|
end
|
79
79
|
|
80
80
|
# Void a previous transaction
|
@@ -84,7 +84,7 @@ module ActiveMerchant #:nodoc:
|
|
84
84
|
# * <tt>authorization</tt> - The authorization returned from the previous authorize request.
|
85
85
|
#
|
86
86
|
def void(authorization, options = {})
|
87
|
-
commit(:void, nil, options.merge(:
|
87
|
+
commit(:void, nil, options.merge(transaction_id: authorization))
|
88
88
|
end
|
89
89
|
|
90
90
|
# Credit an account.
|
@@ -101,11 +101,11 @@ module ActiveMerchant #:nodoc:
|
|
101
101
|
#
|
102
102
|
def credit(money, identification, options = {})
|
103
103
|
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
104
|
-
refund(money, identification,
|
104
|
+
refund(money, identification, {})
|
105
105
|
end
|
106
106
|
|
107
107
|
def refund(money, identification, options = {})
|
108
|
-
commit(:refund, money, options.merge(:
|
108
|
+
commit(:refund, money, options.merge(transaction_id: identification))
|
109
109
|
end
|
110
110
|
|
111
111
|
# Query the merchant account status
|
@@ -113,6 +113,17 @@ module ActiveMerchant #:nodoc:
|
|
113
113
|
commit(:query, nil, {})
|
114
114
|
end
|
115
115
|
|
116
|
+
def supports_scrubbing?
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
120
|
+
def scrub(transcript)
|
121
|
+
transcript.
|
122
|
+
gsub(%r((<ConnectionTicket>)[^<]*(</ConnectionTicket>))i, '\1[FILTERED]\2').
|
123
|
+
gsub(%r((<CreditCardNumber>)[^<]*(</CreditCardNumber>))i, '\1[FILTERED]\2').
|
124
|
+
gsub(%r((<CardSecurityCode>)[^<]*(</CardSecurityCode>))i, '\1[FILTERED]\2')
|
125
|
+
end
|
126
|
+
|
116
127
|
private
|
117
128
|
|
118
129
|
def hosted?
|
@@ -127,17 +138,16 @@ module ActiveMerchant #:nodoc:
|
|
127
138
|
|
128
139
|
req = build_request(type, money, parameters)
|
129
140
|
|
130
|
-
data = ssl_post(url, req,
|
141
|
+
data = ssl_post(url, req, 'Content-Type' => 'application/x-qbmsxml')
|
131
142
|
response = parse(type, data)
|
132
143
|
message = (response[:status_message] || '').strip
|
133
144
|
|
134
145
|
Response.new(success?(response), message, response,
|
135
|
-
:
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
)
|
146
|
+
test: test?,
|
147
|
+
authorization: response[:credit_card_trans_id],
|
148
|
+
fraud_review: fraud_review?(response),
|
149
|
+
avs_result: { code: avs_result(response) },
|
150
|
+
cvv_result: cvv_result(response))
|
141
151
|
end
|
142
152
|
|
143
153
|
def success?(response)
|
@@ -152,20 +162,20 @@ module ActiveMerchant #:nodoc:
|
|
152
162
|
xml = REXML::Document.new(body)
|
153
163
|
|
154
164
|
signon = REXML::XPath.first(xml, "//SignonMsgsRs/#{hosted? ? 'SignonAppCertRs' : 'SignonDesktopRs'}")
|
155
|
-
status_code = signon.attributes[
|
165
|
+
status_code = signon.attributes['statusCode'].to_i
|
156
166
|
|
157
167
|
if status_code != 0
|
158
168
|
return {
|
159
|
-
:
|
160
|
-
:
|
169
|
+
status_code: status_code,
|
170
|
+
status_message: signon.attributes['statusMessage']
|
161
171
|
}
|
162
172
|
end
|
163
173
|
|
164
174
|
response = REXML::XPath.first(xml, "//QBMSXMLMsgsRs/#{type}Rs")
|
165
175
|
|
166
176
|
results = {
|
167
|
-
:
|
168
|
-
:
|
177
|
+
status_code: response.attributes['statusCode'].to_i,
|
178
|
+
status_message: response.attributes['statusMessage']
|
169
179
|
}
|
170
180
|
|
171
181
|
response.elements.each do |e|
|
@@ -184,21 +194,21 @@ module ActiveMerchant #:nodoc:
|
|
184
194
|
end
|
185
195
|
|
186
196
|
def build_request(type, money, parameters = {})
|
187
|
-
xml = Builder::XmlMarkup.new(:
|
197
|
+
xml = Builder::XmlMarkup.new(indent: 0)
|
188
198
|
|
189
|
-
xml.instruct!(:xml, :
|
190
|
-
xml.instruct!(:qbmsxml, :
|
199
|
+
xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
|
200
|
+
xml.instruct!(:qbmsxml, version: API_VERSION)
|
191
201
|
|
192
|
-
xml.tag!(
|
193
|
-
xml.tag!(
|
194
|
-
xml.tag!(hosted? ?
|
195
|
-
xml.tag!(
|
196
|
-
xml.tag!(
|
197
|
-
xml.tag!(
|
202
|
+
xml.tag!('QBMSXML') do
|
203
|
+
xml.tag!('SignonMsgsRq') do
|
204
|
+
xml.tag!(hosted? ? 'SignonAppCertRq' : 'SignonDesktopRq') do
|
205
|
+
xml.tag!('ClientDateTime', Time.now.xmlschema)
|
206
|
+
xml.tag!('ApplicationLogin', @options[:login])
|
207
|
+
xml.tag!('ConnectionTicket', @options[:ticket])
|
198
208
|
end
|
199
209
|
end
|
200
210
|
|
201
|
-
xml.tag!(
|
211
|
+
xml.tag!('QBMSXMLMsgsRq') do
|
202
212
|
xml.tag!("#{type}Rq") do
|
203
213
|
method("build_#{type}").call(xml, money, parameters)
|
204
214
|
end
|
@@ -212,47 +222,47 @@ module ActiveMerchant #:nodoc:
|
|
212
222
|
cc = parameters[:credit_card]
|
213
223
|
name = "#{cc.first_name} #{cc.last_name}"[0...30]
|
214
224
|
|
215
|
-
xml.tag!(
|
216
|
-
xml.tag!(
|
217
|
-
xml.tag!(
|
218
|
-
xml.tag!(
|
219
|
-
xml.tag!(
|
220
|
-
xml.tag!(
|
221
|
-
xml.tag!(
|
225
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
226
|
+
xml.tag!('CreditCardNumber', cc.number)
|
227
|
+
xml.tag!('ExpirationMonth', cc.month)
|
228
|
+
xml.tag!('ExpirationYear', cc.year)
|
229
|
+
xml.tag!('IsECommerce', 'true')
|
230
|
+
xml.tag!('Amount', amount(money))
|
231
|
+
xml.tag!('NameOnCard', name)
|
222
232
|
add_address(xml, parameters)
|
223
|
-
xml.tag!(
|
233
|
+
xml.tag!('CardSecurityCode', cc.verification_value) if cc.verification_value?
|
224
234
|
end
|
225
235
|
|
226
236
|
def build_CustomerCreditCardCapture(xml, money, parameters)
|
227
|
-
xml.tag!(
|
228
|
-
xml.tag!(
|
229
|
-
xml.tag!(
|
237
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
238
|
+
xml.tag!('CreditCardTransID', parameters[:transaction_id])
|
239
|
+
xml.tag!('Amount', amount(money))
|
230
240
|
end
|
231
241
|
|
232
242
|
def build_CustomerCreditCardCharge(xml, money, parameters)
|
233
243
|
cc = parameters[:credit_card]
|
234
244
|
name = "#{cc.first_name} #{cc.last_name}"[0...30]
|
235
245
|
|
236
|
-
xml.tag!(
|
237
|
-
xml.tag!(
|
238
|
-
xml.tag!(
|
239
|
-
xml.tag!(
|
240
|
-
xml.tag!(
|
241
|
-
xml.tag!(
|
242
|
-
xml.tag!(
|
246
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
247
|
+
xml.tag!('CreditCardNumber', cc.number)
|
248
|
+
xml.tag!('ExpirationMonth', cc.month)
|
249
|
+
xml.tag!('ExpirationYear', cc.year)
|
250
|
+
xml.tag!('IsECommerce', 'true')
|
251
|
+
xml.tag!('Amount', amount(money))
|
252
|
+
xml.tag!('NameOnCard', name)
|
243
253
|
add_address(xml, parameters)
|
244
|
-
xml.tag!(
|
254
|
+
xml.tag!('CardSecurityCode', cc.verification_value) if cc.verification_value?
|
245
255
|
end
|
246
256
|
|
247
257
|
def build_CustomerCreditCardTxnVoidOrRefund(xml, money, parameters)
|
248
|
-
xml.tag!(
|
249
|
-
xml.tag!(
|
250
|
-
xml.tag!(
|
258
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
259
|
+
xml.tag!('CreditCardTransID', parameters[:transaction_id])
|
260
|
+
xml.tag!('Amount', amount(money))
|
251
261
|
end
|
252
262
|
|
253
263
|
def build_CustomerCreditCardTxnVoid(xml, money, parameters)
|
254
|
-
xml.tag!(
|
255
|
-
xml.tag!(
|
264
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
265
|
+
xml.tag!('CreditCardTransID', parameters[:transaction_id])
|
256
266
|
end
|
257
267
|
|
258
268
|
# Called reflectively by build_request
|
@@ -261,30 +271,30 @@ module ActiveMerchant #:nodoc:
|
|
261
271
|
|
262
272
|
def add_address(xml, parameters)
|
263
273
|
if address = parameters[:billing_address] || parameters[:address]
|
264
|
-
xml.tag!(
|
265
|
-
xml.tag!(
|
274
|
+
xml.tag!('CreditCardAddress', (address[:address1] || '')[0...30])
|
275
|
+
xml.tag!('CreditCardPostalCode', (address[:zip] || '')[0...9])
|
266
276
|
end
|
267
277
|
end
|
268
278
|
|
269
279
|
def cvv_result(response)
|
270
280
|
case response[:card_security_code_match]
|
271
|
-
when
|
272
|
-
when
|
273
|
-
when
|
281
|
+
when 'Pass' then 'M'
|
282
|
+
when 'Fail' then 'N'
|
283
|
+
when 'NotAvailable' then 'P'
|
274
284
|
end
|
275
285
|
end
|
276
286
|
|
277
287
|
def avs_result(response)
|
278
288
|
case "#{response[:avs_street]}|#{response[:avs_zip]}"
|
279
|
-
when
|
280
|
-
when
|
281
|
-
when
|
282
|
-
when
|
283
|
-
when
|
284
|
-
when
|
285
|
-
when
|
286
|
-
when
|
287
|
-
when
|
289
|
+
when 'Pass|Pass' then 'D'
|
290
|
+
when 'Pass|Fail' then 'A'
|
291
|
+
when 'Pass|NotAvailable' then 'B'
|
292
|
+
when 'Fail|Pass' then 'Z'
|
293
|
+
when 'Fail|Fail' then 'C'
|
294
|
+
when 'Fail|NotAvailable' then 'N'
|
295
|
+
when 'NotAvailable|Pass' then 'P'
|
296
|
+
when 'NotAvailable|Fail' then 'N'
|
297
|
+
when 'NotAvailable|NotAvailable' then 'U'
|
288
298
|
end
|
289
299
|
end
|
290
300
|
end
|
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
self.live_url = self.test_url = 'https://secure.quantumgateway.com/cgi/xml_requester.php'
|
14
14
|
|
15
15
|
# visa, master, american_express, discover
|
16
|
-
self.supported_cardtypes = [
|
16
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
17
17
|
self.supported_countries = ['US']
|
18
18
|
self.default_currency = 'USD'
|
19
19
|
self.money_format = :dollars
|
@@ -44,7 +44,7 @@ module ActiveMerchant #:nodoc:
|
|
44
44
|
#
|
45
45
|
def authorize(money, creditcard, options = {})
|
46
46
|
setup_address_hash(options)
|
47
|
-
commit(build_auth_request(money, creditcard, options), options
|
47
|
+
commit(build_auth_request(money, creditcard, options), options)
|
48
48
|
end
|
49
49
|
|
50
50
|
# Capture an authorization that has previously been requested
|
@@ -81,7 +81,7 @@ module ActiveMerchant #:nodoc:
|
|
81
81
|
|
82
82
|
def build_auth_request(money, creditcard, options)
|
83
83
|
xml = Builder::XmlMarkup.new
|
84
|
-
add_common_credit_card_info(xml,'AUTH_ONLY')
|
84
|
+
add_common_credit_card_info(xml, 'AUTH_ONLY')
|
85
85
|
add_purchase_data(xml, money)
|
86
86
|
add_creditcard(xml, creditcard)
|
87
87
|
add_address(xml, creditcard, options[:billing_address], options)
|
@@ -94,15 +94,15 @@ module ActiveMerchant #:nodoc:
|
|
94
94
|
|
95
95
|
def build_capture_request(money, authorization, options)
|
96
96
|
xml = Builder::XmlMarkup.new
|
97
|
-
add_common_credit_card_info(xml,'PREVIOUS_SALE')
|
98
|
-
transaction_id,
|
97
|
+
add_common_credit_card_info(xml, 'PREVIOUS_SALE')
|
98
|
+
transaction_id, = authorization_parts_from(authorization)
|
99
99
|
add_transaction_id(xml, transaction_id)
|
100
100
|
xml.target!
|
101
101
|
end
|
102
102
|
|
103
103
|
def build_purchase_request(money, creditcard, options)
|
104
104
|
xml = Builder::XmlMarkup.new
|
105
|
-
add_common_credit_card_info(xml, @options[:ignore_avs] ||
|
105
|
+
add_common_credit_card_info(xml, @options[:ignore_avs] || @options[:ignore_cvv] ? 'SALES' : 'AUTH_CAPTURE')
|
106
106
|
add_address(xml, creditcard, options[:billing_address], options)
|
107
107
|
add_purchase_data(xml, money)
|
108
108
|
add_creditcard(xml, creditcard)
|
@@ -115,15 +115,15 @@ module ActiveMerchant #:nodoc:
|
|
115
115
|
|
116
116
|
def build_void_request(authorization, options)
|
117
117
|
xml = Builder::XmlMarkup.new
|
118
|
-
add_common_credit_card_info(xml,'VOID')
|
119
|
-
transaction_id,
|
118
|
+
add_common_credit_card_info(xml, 'VOID')
|
119
|
+
transaction_id, = authorization_parts_from(authorization)
|
120
120
|
add_transaction_id(xml, transaction_id)
|
121
121
|
xml.target!
|
122
122
|
end
|
123
123
|
|
124
124
|
def build_credit_request(money, authorization, options)
|
125
125
|
xml = Builder::XmlMarkup.new
|
126
|
-
add_common_credit_card_info(xml,'RETURN')
|
126
|
+
add_common_credit_card_info(xml, 'RETURN')
|
127
127
|
add_purchase_data(xml, money)
|
128
128
|
transaction_id, cc = authorization_parts_from(authorization)
|
129
129
|
add_transaction_id(xml, transaction_id)
|
@@ -182,7 +182,7 @@ module ActiveMerchant #:nodoc:
|
|
182
182
|
xml.tag! 'CreditCardNumber', creditcard.number
|
183
183
|
xml.tag! 'ExpireMonth', format(creditcard.month, :two_digits)
|
184
184
|
xml.tag! 'ExpireYear', format(creditcard.year, :four_digits)
|
185
|
-
xml.tag!('CVV2', creditcard.verification_value) unless
|
185
|
+
xml.tag!('CVV2', creditcard.verification_value) unless @options[:ignore_cvv] || creditcard.verification_value.blank?
|
186
186
|
end
|
187
187
|
|
188
188
|
# Where we actually build the full SOAP request using builder
|
@@ -206,7 +206,7 @@ module ActiveMerchant #:nodoc:
|
|
206
206
|
headers = { 'Content-Type' => 'text/xml' }
|
207
207
|
response = parse(ssl_post(self.live_url, build_request(request, options), headers))
|
208
208
|
|
209
|
-
success = response[:request_status] ==
|
209
|
+
success = response[:request_status] == 'Success'
|
210
210
|
message = response[:request_message]
|
211
211
|
|
212
212
|
if success # => checking for connectivity success first
|
@@ -216,11 +216,10 @@ module ActiveMerchant #:nodoc:
|
|
216
216
|
end
|
217
217
|
|
218
218
|
Response.new(success, message, response,
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
)
|
219
|
+
test: test?,
|
220
|
+
authorization: authorization,
|
221
|
+
avs_result: { code: response[:AVSResponseCode] },
|
222
|
+
cvv_result: response[:CVV2ResponseCode])
|
224
223
|
end
|
225
224
|
|
226
225
|
# Parse the SOAP response
|
@@ -231,19 +230,19 @@ module ActiveMerchant #:nodoc:
|
|
231
230
|
begin
|
232
231
|
xml = REXML::Document.new(xml)
|
233
232
|
|
234
|
-
root = REXML::XPath.first(xml,
|
233
|
+
root = REXML::XPath.first(xml, '//QGWRequest/ResponseSummary')
|
235
234
|
parse_element(reply, root)
|
236
235
|
reply[:request_status] = reply[:Status]
|
237
236
|
reply[:request_message] = "#{reply[:Status]}: #{reply[:StatusDescription]}"
|
238
237
|
|
239
|
-
if root = REXML::XPath.first(xml,
|
238
|
+
if root = REXML::XPath.first(xml, '//QGWRequest/Result')
|
240
239
|
root.elements.to_a.each do |node|
|
241
240
|
parse_element(reply, node)
|
242
241
|
end
|
243
242
|
end
|
244
243
|
rescue Exception
|
245
244
|
reply[:request_status] = 'Failure'
|
246
|
-
reply[:request_message] =
|
245
|
+
reply[:request_message] = 'Failure: There was a problem parsing the response XML'
|
247
246
|
end
|
248
247
|
|
249
248
|
return reply
|
@@ -251,10 +250,10 @@ module ActiveMerchant #:nodoc:
|
|
251
250
|
|
252
251
|
def parse_element(reply, node)
|
253
252
|
if node.has_elements?
|
254
|
-
node.elements.each{|e| parse_element(reply, e) }
|
253
|
+
node.elements.each { |e| parse_element(reply, e) }
|
255
254
|
else
|
256
|
-
if node.parent.name
|
257
|
-
parent = node.parent.name + (node.parent.attributes[
|
255
|
+
if /item/.match?(node.parent.name)
|
256
|
+
parent = node.parent.name + (node.parent.attributes['id'] ? '_' + node.parent.attributes['id'] : '')
|
258
257
|
reply[(parent + '_' + node.name).to_sym] = node.text
|
259
258
|
else
|
260
259
|
reply[node.name.to_sym] = node.text
|
@@ -270,7 +269,6 @@ module ActiveMerchant #:nodoc:
|
|
270
269
|
def authorization_parts_from(authorization)
|
271
270
|
authorization.split(/;/)
|
272
271
|
end
|
273
|
-
|
274
272
|
end
|
275
273
|
end
|
276
274
|
end
|