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,395 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class JetpayGateway < Gateway
|
4
|
+
class_attribute :live_us_url, :live_ca_url
|
5
|
+
|
6
|
+
self.test_url = 'https://test1.jetpay.com/jetpay'
|
7
|
+
self.live_us_url = 'https://gateway17.jetpay.com/jetpay'
|
8
|
+
self.live_ca_url = 'https://gateway17.jetpay.com/canada-bb'
|
9
|
+
|
10
|
+
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
11
|
+
self.supported_countries = %w[US CA]
|
12
|
+
|
13
|
+
# The card types supported by the payment gateway
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
15
|
+
|
16
|
+
# The homepage URL of the gateway
|
17
|
+
self.homepage_url = 'http://www.jetpay.com/'
|
18
|
+
|
19
|
+
# The name of the gateway
|
20
|
+
self.display_name = 'JetPay'
|
21
|
+
|
22
|
+
# all transactions are in cents
|
23
|
+
self.money_format = :cents
|
24
|
+
|
25
|
+
ACTION_CODE_MESSAGES = {
|
26
|
+
'000' => 'Approved.',
|
27
|
+
'001' => 'Refer to card issuer.',
|
28
|
+
'002' => 'Refer to card issuer, special condition.',
|
29
|
+
'003' => 'Invalid merchant or service provider.',
|
30
|
+
'004' => 'Pick up card.',
|
31
|
+
'005' => 'Do not honor.',
|
32
|
+
'006' => 'Error.',
|
33
|
+
'007' => 'Pick up card, special condition.',
|
34
|
+
'008' => 'Honor with ID (Show ID).',
|
35
|
+
'010' => 'Partial approval.',
|
36
|
+
'011' => 'VIP approval.',
|
37
|
+
'012' => 'Invalid transaction.',
|
38
|
+
'013' => 'Invalid amount or exceeds maximum for card program.',
|
39
|
+
'014' => 'Invalid account number (no such number).',
|
40
|
+
'015' => 'No such issuer.',
|
41
|
+
'019' => 'Re-enter Transaction.',
|
42
|
+
'021' => 'No action taken (unable to back out prior transaction).',
|
43
|
+
'025' => 'Transaction Not Found.',
|
44
|
+
'027' => 'File update field edit error.',
|
45
|
+
'028' => 'File is temporarily unavailable.',
|
46
|
+
'030' => 'Format error.',
|
47
|
+
'039' => 'No credit account.',
|
48
|
+
'041' => 'Pick up card (lost card).',
|
49
|
+
'043' => 'Pick up card (stolen card).',
|
50
|
+
'051' => 'Insufficient funds.',
|
51
|
+
'052' => 'No checking account.',
|
52
|
+
'053' => 'No savings account.',
|
53
|
+
'054' => 'Expired Card.',
|
54
|
+
'055' => 'Incorrect PIN.',
|
55
|
+
'057' => 'Transaction not permitted to cardholder.',
|
56
|
+
'058' => 'Transaction not allowed at terminal.',
|
57
|
+
'061' => 'Exceeds withdrawal limit.',
|
58
|
+
'062' => 'Restricted card (eg, Country Exclusion).',
|
59
|
+
'063' => 'Security violation.',
|
60
|
+
'065' => 'Activity count limit exceeded.',
|
61
|
+
'068' => 'Response late.',
|
62
|
+
'070' => 'Contact card issuer.',
|
63
|
+
'071' => 'PIN not changed.',
|
64
|
+
'075' => 'Allowable number of PIN-entry tries exceeded.',
|
65
|
+
'076' => 'Unable to locate previous message (no matching retrieval reference number).',
|
66
|
+
'077' => 'Repeat or reversal data are inconsistent with original message.',
|
67
|
+
'078' => 'Blocked (first use), or non-existent account.',
|
68
|
+
'079' => 'Key exchange validation failed.',
|
69
|
+
'080' => 'Credit issuer unavailable or invalid date.',
|
70
|
+
'081' => 'PIN cryptographic error found.',
|
71
|
+
'082' => 'Negative online CVV results.',
|
72
|
+
'084' => 'Invalid auth life cycle.',
|
73
|
+
'085' => 'No reason to decline - CVV or AVS approved.',
|
74
|
+
'086' => 'Cannot verify PIN.',
|
75
|
+
'087' => 'Cashback not allowed.',
|
76
|
+
'089' => 'Issuer Down.',
|
77
|
+
'091' => 'Issuer Down.',
|
78
|
+
'092' => 'Unable to route transaction.',
|
79
|
+
'093' => 'Transaction cannot be completed - violation of law.',
|
80
|
+
'094' => 'Duplicate transmission.',
|
81
|
+
'096' => 'System error.',
|
82
|
+
'100' => 'Deny.',
|
83
|
+
'101' => 'Expired Card.',
|
84
|
+
'103' => 'Deny - Invalid manual Entry 4DBC.',
|
85
|
+
'104' => 'Deny - New card issued.',
|
86
|
+
'105' => 'Deny - Account Cancelled.',
|
87
|
+
'106' => 'Exceeded PIN Attempts.',
|
88
|
+
'107' => 'Please Call Issuer.',
|
89
|
+
'109' => 'Invalid merchant.',
|
90
|
+
'110' => 'Invalid amount.',
|
91
|
+
'111' => 'Invalid account.',
|
92
|
+
'115' => 'Service not permitted.',
|
93
|
+
'122' => 'Invalid card (CID) security code.',
|
94
|
+
'125' => 'Invalid effective date.',
|
95
|
+
'181' => 'Format error.',
|
96
|
+
'182' => 'Please wait.',
|
97
|
+
'183' => 'Invalid currency code.',
|
98
|
+
'187' => 'Deny - new card issued.',
|
99
|
+
'188' => 'Deny - Expiration date required.',
|
100
|
+
'189' => 'Deny - Cancelled or Closed Merchant/SE.',
|
101
|
+
'200' => 'Deny - Pick up card.',
|
102
|
+
'400' => 'Reversal accepted.',
|
103
|
+
'601' => 'Reject - EMV Chip Declined Transaction.',
|
104
|
+
'602' => 'Reject - Suspected Fraud.',
|
105
|
+
'603' => 'Reject - Communications Error.',
|
106
|
+
'604' => 'Reject - Insufficient Approval.',
|
107
|
+
'750' => 'Velocity Check Fail.',
|
108
|
+
'899' => 'Misc Decline.',
|
109
|
+
'900' => 'Invalid Message Type.',
|
110
|
+
'901' => 'Invalid Merchant ID.',
|
111
|
+
'903' => 'Debit not supported.',
|
112
|
+
'904' => 'Private label not supported.',
|
113
|
+
'905' => 'Invalid card type.',
|
114
|
+
'906' => 'Unit not active.',
|
115
|
+
'908' => 'Manual card entry invalid.',
|
116
|
+
'909' => 'Invalid track information.',
|
117
|
+
'911' => 'Master merchant not found.',
|
118
|
+
'912' => 'Invalid card format.',
|
119
|
+
'913' => 'Invalid card type.',
|
120
|
+
'914' => 'Invalid card length.',
|
121
|
+
'917' => 'Expired card.',
|
122
|
+
'919' => 'Invalid entry type.',
|
123
|
+
'920' => 'Invalid amount.',
|
124
|
+
'921' => 'Invalid messge format.',
|
125
|
+
'923' => 'Invalid ABA.',
|
126
|
+
'924' => 'Invalid DDA.',
|
127
|
+
'925' => 'Invalid TID.',
|
128
|
+
'926' => 'Invalid Password.',
|
129
|
+
'930' => 'Invalid zipcode.',
|
130
|
+
'931' => 'Invalid Address.',
|
131
|
+
'932' => 'Invalid ZIP and Address.',
|
132
|
+
'933' => 'Invalid CVV2.',
|
133
|
+
'934' => 'Program Not Allowed.',
|
134
|
+
'940' => 'Record Not Found.',
|
135
|
+
'941' => 'Merchant ID error.',
|
136
|
+
'942' => 'Refund Not Allowed.',
|
137
|
+
'943' => 'Refund denied.',
|
138
|
+
'955' => 'Invalid PIN block.',
|
139
|
+
'956' => 'Invalid KSN.',
|
140
|
+
'958' => 'Bad Status.',
|
141
|
+
'959' => 'Seek Record limit exceeded.',
|
142
|
+
'962' => 'Invalid PIN key (Unknown KSN).',
|
143
|
+
'981' => 'Invalid AVS.',
|
144
|
+
'987' => 'Issuer Unavailable.',
|
145
|
+
'988' => 'System error SD.',
|
146
|
+
'989' => 'Database Error.',
|
147
|
+
'992' => 'Transaction Timeout.',
|
148
|
+
'996' => 'Bad Terminal ID.',
|
149
|
+
'997' => 'Message rejected by association.',
|
150
|
+
'999' => 'Communication failure',
|
151
|
+
nil => 'No response returned (missing credentials?).'
|
152
|
+
}
|
153
|
+
|
154
|
+
def initialize(options = {})
|
155
|
+
requires!(options, :login)
|
156
|
+
super
|
157
|
+
end
|
158
|
+
|
159
|
+
def purchase(money, credit_card, options = {})
|
160
|
+
commit(money, build_sale_request(money, credit_card, options))
|
161
|
+
end
|
162
|
+
|
163
|
+
def authorize(money, credit_card, options = {})
|
164
|
+
commit(money, build_authonly_request(money, credit_card, options))
|
165
|
+
end
|
166
|
+
|
167
|
+
def capture(money, reference, options = {})
|
168
|
+
split_authorization = reference.split(';')
|
169
|
+
transaction_id = split_authorization[0]
|
170
|
+
token = split_authorization[3]
|
171
|
+
commit(money, build_capture_request(transaction_id, money, options), token)
|
172
|
+
end
|
173
|
+
|
174
|
+
def void(reference, options = {})
|
175
|
+
transaction_id, approval, amount, token = reference.split(';')
|
176
|
+
commit(amount.to_i, build_void_request(amount.to_i, transaction_id, approval, token, options), token)
|
177
|
+
end
|
178
|
+
|
179
|
+
def credit(money, transaction_id_or_card, options = {})
|
180
|
+
if transaction_id_or_card.is_a?(String)
|
181
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
182
|
+
refund(money, transaction_id_or_card, options)
|
183
|
+
else
|
184
|
+
commit(money, build_credit_request('CREDIT', money, nil, transaction_id_or_card, nil, options))
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def refund(money, reference, options = {})
|
189
|
+
split_authorization = reference.split(';')
|
190
|
+
transaction_id = split_authorization[0]
|
191
|
+
token = split_authorization[3]
|
192
|
+
credit_card = options[:credit_card]
|
193
|
+
commit(money, build_credit_request('CREDIT', money, transaction_id, credit_card, token, options))
|
194
|
+
end
|
195
|
+
|
196
|
+
def supports_scrubbing
|
197
|
+
true
|
198
|
+
end
|
199
|
+
|
200
|
+
def scrub(transcript)
|
201
|
+
transcript.
|
202
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
203
|
+
gsub(%r((>)\d+(</CardNum>)), '\1[FILTERED]\2').
|
204
|
+
gsub(%r((<CVV2>)\d+(</CVV2>)), '\1[FILTERED]\2')
|
205
|
+
end
|
206
|
+
|
207
|
+
private
|
208
|
+
|
209
|
+
def build_xml_request(transaction_type, options = {}, transaction_id = nil, &block)
|
210
|
+
xml = Builder::XmlMarkup.new
|
211
|
+
xml.tag! 'JetPay' do
|
212
|
+
# The basic values needed for any request
|
213
|
+
xml.tag! 'TerminalID', @options[:login]
|
214
|
+
xml.tag! 'TransactionType', transaction_type
|
215
|
+
xml.tag! 'TransactionID', transaction_id.nil? ? generate_unique_id.slice(0, 18) : transaction_id
|
216
|
+
xml.tag! 'Origin', options[:origin] if options && options[:origin]
|
217
|
+
|
218
|
+
if block_given?
|
219
|
+
yield xml
|
220
|
+
else
|
221
|
+
xml.target!
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
def build_sale_request(money, credit_card, options)
|
227
|
+
build_xml_request('SALE', options) do |xml|
|
228
|
+
add_credit_card(xml, credit_card)
|
229
|
+
add_addresses(xml, options)
|
230
|
+
add_customer_data(xml, options)
|
231
|
+
add_invoice_data(xml, options)
|
232
|
+
add_user_defined_fields(xml, options)
|
233
|
+
xml.tag! 'TotalAmount', amount(money)
|
234
|
+
|
235
|
+
xml.target!
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
def build_authonly_request(money, credit_card, options)
|
240
|
+
build_xml_request('AUTHONLY') do |xml|
|
241
|
+
add_credit_card(xml, credit_card)
|
242
|
+
add_addresses(xml, options)
|
243
|
+
add_customer_data(xml, options)
|
244
|
+
add_invoice_data(xml, options)
|
245
|
+
add_user_defined_fields(xml, options)
|
246
|
+
xml.tag! 'TotalAmount', amount(money)
|
247
|
+
|
248
|
+
xml.target!
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
def build_capture_request(transaction_id, money, options)
|
253
|
+
build_xml_request('CAPT', options, transaction_id) do |xml|
|
254
|
+
xml.tag! 'TotalAmount', amount(money)
|
255
|
+
add_user_defined_fields(xml, options)
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
def build_void_request(money, transaction_id, approval, token, options)
|
260
|
+
build_xml_request('VOID', options, transaction_id) do |xml|
|
261
|
+
xml.tag! 'Approval', approval
|
262
|
+
xml.tag! 'TotalAmount', amount(money)
|
263
|
+
xml.tag! 'Token', token if token
|
264
|
+
xml.target!
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
# `transaction_id` may be nil for unlinked credit transactions.
|
269
|
+
def build_credit_request(transaction_type, money, transaction_id, card, token, options)
|
270
|
+
build_xml_request(transaction_type, options, transaction_id) do |xml|
|
271
|
+
add_credit_card(xml, card) if card
|
272
|
+
add_invoice_data(xml, options)
|
273
|
+
add_addresses(xml, options)
|
274
|
+
add_customer_data(xml, options)
|
275
|
+
add_user_defined_fields(xml, options)
|
276
|
+
xml.tag! 'TotalAmount', amount(money)
|
277
|
+
xml.tag! 'Token', token if token
|
278
|
+
|
279
|
+
xml.target!
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
def commit(money, request, token = nil)
|
284
|
+
response = parse(ssl_post(url, request))
|
285
|
+
|
286
|
+
success = success?(response)
|
287
|
+
Response.new(success,
|
288
|
+
success ? 'APPROVED' : message_from(response),
|
289
|
+
response,
|
290
|
+
test: test?,
|
291
|
+
authorization: authorization_from(response, money, token),
|
292
|
+
avs_result: { code: response[:avs] },
|
293
|
+
cvv_result: response[:cvv2])
|
294
|
+
end
|
295
|
+
|
296
|
+
def url
|
297
|
+
live_url = @options[:region] == 'CA' ? live_ca_url : live_us_url
|
298
|
+
test? ? test_url : live_url
|
299
|
+
end
|
300
|
+
|
301
|
+
def parse(body)
|
302
|
+
return {} if body.blank?
|
303
|
+
|
304
|
+
xml = REXML::Document.new(body)
|
305
|
+
|
306
|
+
response = {}
|
307
|
+
xml.root.elements.to_a.each do |node|
|
308
|
+
parse_element(response, node)
|
309
|
+
end
|
310
|
+
response
|
311
|
+
end
|
312
|
+
|
313
|
+
def parse_element(response, node)
|
314
|
+
if node.has_elements?
|
315
|
+
node.elements.each { |element| parse_element(response, element) }
|
316
|
+
else
|
317
|
+
response[node.name.underscore.to_sym] = node.text
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
def format_exp(value)
|
322
|
+
format(value, :two_digits)
|
323
|
+
end
|
324
|
+
|
325
|
+
def success?(response)
|
326
|
+
response[:action_code] == '000'
|
327
|
+
end
|
328
|
+
|
329
|
+
def message_from(response)
|
330
|
+
ACTION_CODE_MESSAGES[response[:action_code]]
|
331
|
+
end
|
332
|
+
|
333
|
+
def authorization_from(response, money, previous_token)
|
334
|
+
original_amount = amount(money) if money
|
335
|
+
[response[:transaction_id], response[:approval], original_amount, (response[:token] || previous_token)].join(';')
|
336
|
+
end
|
337
|
+
|
338
|
+
def add_credit_card(xml, credit_card)
|
339
|
+
xml.tag! 'CardNum', credit_card.number, 'Tokenize' => true
|
340
|
+
xml.tag! 'CardExpMonth', format_exp(credit_card.month)
|
341
|
+
xml.tag! 'CardExpYear', format_exp(credit_card.year)
|
342
|
+
|
343
|
+
xml.tag! 'CardName', [credit_card.first_name, credit_card.last_name].compact.join(' ') if credit_card.first_name || credit_card.last_name
|
344
|
+
|
345
|
+
xml.tag! 'CVV2', credit_card.verification_value unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
|
346
|
+
end
|
347
|
+
|
348
|
+
def add_addresses(xml, options)
|
349
|
+
if billing_address = options[:billing_address] || options[:address]
|
350
|
+
xml.tag! 'BillingAddress', [billing_address[:address1], billing_address[:address2]].compact.join(' ')
|
351
|
+
xml.tag! 'BillingCity', billing_address[:city]
|
352
|
+
xml.tag! 'BillingStateProv', billing_address[:state]
|
353
|
+
xml.tag! 'BillingPostalCode', billing_address[:zip]
|
354
|
+
xml.tag! 'BillingCountry', lookup_country_code(billing_address[:country])
|
355
|
+
xml.tag! 'BillingPhone', billing_address[:phone]
|
356
|
+
end
|
357
|
+
|
358
|
+
if shipping_address = options[:shipping_address]
|
359
|
+
xml.tag! 'ShippingInfo' do
|
360
|
+
xml.tag! 'ShippingName', shipping_address[:name]
|
361
|
+
|
362
|
+
xml.tag! 'ShippingAddr' do
|
363
|
+
xml.tag! 'Address', [shipping_address[:address1], shipping_address[:address2]].compact.join(' ')
|
364
|
+
xml.tag! 'City', shipping_address[:city]
|
365
|
+
xml.tag! 'StateProv', shipping_address[:state]
|
366
|
+
xml.tag! 'PostalCode', shipping_address[:zip]
|
367
|
+
xml.tag! 'Country', lookup_country_code(shipping_address[:country])
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
def add_customer_data(xml, options)
|
374
|
+
xml.tag! 'Email', options[:email] if options[:email]
|
375
|
+
xml.tag! 'UserIPAddress', options[:ip] if options[:ip]
|
376
|
+
end
|
377
|
+
|
378
|
+
def add_invoice_data(xml, options)
|
379
|
+
xml.tag! 'OrderNumber', options[:order_id] if options[:order_id]
|
380
|
+
xml.tag! 'TaxAmount', amount(options[:tax]) if options[:tax]
|
381
|
+
end
|
382
|
+
|
383
|
+
def add_user_defined_fields(xml, options)
|
384
|
+
xml.tag! 'UDField1', options[:ud_field_1] if options[:ud_field_1]
|
385
|
+
xml.tag! 'UDField2', options[:ud_field_2] if options[:ud_field_2]
|
386
|
+
xml.tag! 'UDField3', options[:ud_field_3] if options[:ud_field_3]
|
387
|
+
end
|
388
|
+
|
389
|
+
def lookup_country_code(code)
|
390
|
+
country = Country.find(code) rescue nil
|
391
|
+
country&.code(:alpha3)
|
392
|
+
end
|
393
|
+
end
|
394
|
+
end
|
395
|
+
end
|