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
@@ -5,61 +5,61 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
class VerifiGateway < Gateway
|
6
6
|
class VerifiPostData < PostData
|
7
7
|
# Fields that will be sent even if they are blank
|
8
|
-
self.required_fields = [
|
9
|
-
|
8
|
+
self.required_fields = %i[amount type ccnumber ccexp firstname lastname
|
9
|
+
company address1 address2 city state zip country phone]
|
10
10
|
end
|
11
11
|
|
12
12
|
self.live_url = self.test_url = 'https://secure.verifi.com/gw/api/transact.php'
|
13
13
|
|
14
14
|
RESPONSE_CODE_MESSAGES = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
15
|
+
'100' => 'Transaction was Approved',
|
16
|
+
'200' => 'Transaction was Declined by Processor',
|
17
|
+
'201' => 'Do Not Honor',
|
18
|
+
'202' => 'Insufficient Funds',
|
19
|
+
'203' => 'Over Limit',
|
20
|
+
'204' => 'Transaction not allowed',
|
21
|
+
'220' => 'Incorrect payment Data',
|
22
|
+
'221' => 'No Such Card Issuer',
|
23
|
+
'222' => 'No Card Number on file with Issuer',
|
24
|
+
'223' => 'Expired Card',
|
25
|
+
'224' => 'Invalid Expiration Date',
|
26
|
+
'225' => 'Invalid Card Security Code',
|
27
|
+
'240' => 'Call Issuer for Further Information',
|
28
|
+
'250' => 'Pick Up Card',
|
29
|
+
'251' => 'Lost Card',
|
30
|
+
'252' => 'Stolen Card',
|
31
|
+
'253' => 'Fraudulent Card',
|
32
|
+
'260' => 'Declined With further Instructions Available (see response text)',
|
33
|
+
'261' => 'Declined - Stop All Recurring Payments',
|
34
|
+
'262' => 'Declined - Stop this Recurring Program',
|
35
|
+
'263' => 'Declined - Update Cardholder Data Available',
|
36
|
+
'264' => 'Declined - Retry in a few days',
|
37
|
+
'300' => 'Transaction was Rejected by Gateway',
|
38
|
+
'400' => 'Transaction Error Returned by Processor',
|
39
|
+
'410' => 'Invalid Merchant Configuration',
|
40
|
+
'411' => 'Merchant Account is Inactive',
|
41
|
+
'420' => 'Communication Error',
|
42
|
+
'421' => 'Communication Error with Issuer',
|
43
|
+
'430' => 'Duplicate Transaction at Processor',
|
44
|
+
'440' => 'Processor Format Error',
|
45
|
+
'441' => 'Invalid Transaction Information',
|
46
|
+
'460' => 'Processor Feature Not Available',
|
47
|
+
'461' => 'Unsupported Card Type'
|
48
48
|
}
|
49
49
|
|
50
50
|
SUCCESS = 1
|
51
51
|
|
52
52
|
TRANSACTIONS = {
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
53
|
+
authorization: 'auth',
|
54
|
+
purchase: 'sale',
|
55
|
+
capture: 'capture',
|
56
|
+
void: 'void',
|
57
|
+
credit: 'credit',
|
58
|
+
refund: 'refund'
|
59
59
|
}
|
60
60
|
|
61
61
|
self.supported_countries = ['US']
|
62
|
-
self.supported_cardtypes = [
|
62
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
63
63
|
self.homepage_url = 'http://www.verifi.com/'
|
64
64
|
self.display_name = 'Verifi'
|
65
65
|
|
@@ -180,10 +180,10 @@ module ActiveMerchant #:nodoc:
|
|
180
180
|
# MD5(username|password|orderid|amount|time)
|
181
181
|
now = Time.now.to_i.to_s
|
182
182
|
md5 = Digest::MD5.new
|
183
|
-
md5 << @options[:login].to_s +
|
184
|
-
md5 << @options[:password].to_s +
|
185
|
-
md5 << options[:order_id].to_s +
|
186
|
-
md5 << amount(money).to_s +
|
183
|
+
md5 << @options[:login].to_s + '|'
|
184
|
+
md5 << @options[:password].to_s + '|'
|
185
|
+
md5 << options[:order_id].to_s + '|'
|
186
|
+
md5 << amount(money).to_s + '|'
|
187
187
|
md5 << now
|
188
188
|
post[:key] = md5.hexdigest
|
189
189
|
post[:time] = now
|
@@ -192,18 +192,17 @@ module ActiveMerchant #:nodoc:
|
|
192
192
|
def commit(trx_type, money, post)
|
193
193
|
post[:amount] = amount(money)
|
194
194
|
|
195
|
-
response = parse(
|
195
|
+
response = parse(ssl_post(self.live_url, post_data(trx_type, post)))
|
196
196
|
|
197
197
|
Response.new(response[:response].to_i == SUCCESS, message_from(response), response,
|
198
|
-
:
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
202
|
-
)
|
198
|
+
test: test?,
|
199
|
+
authorization: response[:transactionid],
|
200
|
+
avs_result: { code: response[:avsresponse] },
|
201
|
+
cvv_result: response[:cvvresponse])
|
203
202
|
end
|
204
203
|
|
205
204
|
def message_from(response)
|
206
|
-
response[:response_code_message]
|
205
|
+
response[:response_code_message] || ''
|
207
206
|
end
|
208
207
|
|
209
208
|
def parse(body)
|
@@ -8,13 +8,13 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
self.delimiter = "\r\n"
|
9
9
|
|
10
10
|
self.actions = {
|
11
|
-
:
|
12
|
-
:
|
11
|
+
purchase: 'SALE',
|
12
|
+
credit: 'CREDIT'
|
13
13
|
}
|
14
14
|
|
15
15
|
APPROVED = '0'
|
16
16
|
|
17
|
-
self.supported_cardtypes = [
|
17
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
18
18
|
self.supported_countries = ['US']
|
19
19
|
self.display_name = 'ViaKLIX'
|
20
20
|
self.homepage_url = 'http://viaklix.com'
|
@@ -49,9 +49,7 @@ module ActiveMerchant #:nodoc:
|
|
49
49
|
# Make a credit to a card (Void can only be done from the virtual terminal)
|
50
50
|
# Viaklix does not support credits by reference. You must pass in the credit card
|
51
51
|
def credit(money, creditcard, options = {})
|
52
|
-
if creditcard.is_a?(String)
|
53
|
-
raise ArgumentError, "Reference credits are not supported. Please supply the original credit card"
|
54
|
-
end
|
52
|
+
raise ArgumentError, 'Reference credits are not supported. Please supply the original credit card' if creditcard.is_a?(String)
|
55
53
|
|
56
54
|
form = {}
|
57
55
|
add_invoice(form, options)
|
@@ -63,6 +61,7 @@ module ActiveMerchant #:nodoc:
|
|
63
61
|
end
|
64
62
|
|
65
63
|
private
|
64
|
+
|
66
65
|
def add_test_mode(form, options)
|
67
66
|
form[:test_mode] = 'TRUE' if options[:test_mode]
|
68
67
|
end
|
@@ -72,12 +71,12 @@ module ActiveMerchant #:nodoc:
|
|
72
71
|
form[:customer_code] = options[:customer].to_s.slice(0, 10) unless options[:customer].blank?
|
73
72
|
end
|
74
73
|
|
75
|
-
def add_invoice(form,options)
|
74
|
+
def add_invoice(form, options)
|
76
75
|
form[:invoice_number] = (options[:order_id] || options[:invoice]).to_s.slice(0, 10)
|
77
76
|
form[:description] = options[:description].to_s.slice(0, 255)
|
78
77
|
end
|
79
78
|
|
80
|
-
def add_address(form,options)
|
79
|
+
def add_address(form, options)
|
81
80
|
billing_address = options[:billing_address] || options[:address]
|
82
81
|
|
83
82
|
if billing_address
|
@@ -92,7 +91,7 @@ module ActiveMerchant #:nodoc:
|
|
92
91
|
end
|
93
92
|
|
94
93
|
if shipping_address = options[:shipping_address]
|
95
|
-
first_name, last_name =
|
94
|
+
first_name, last_name = split_names(shipping_address[:name])
|
96
95
|
form[:ship_to_first_name] = first_name.to_s.slice(0, 20)
|
97
96
|
form[:ship_to_last_name] = last_name.to_s.slice(0, 30)
|
98
97
|
form[:ship_to_address] = shipping_address[:address1].to_s.slice(0, 30)
|
@@ -104,21 +103,11 @@ module ActiveMerchant #:nodoc:
|
|
104
103
|
end
|
105
104
|
end
|
106
105
|
|
107
|
-
def parse_first_and_last_name(value)
|
108
|
-
name = value.to_s.split(' ')
|
109
|
-
|
110
|
-
last_name = name.pop || ''
|
111
|
-
first_name = name.join(' ')
|
112
|
-
[ first_name, last_name ]
|
113
|
-
end
|
114
|
-
|
115
106
|
def add_creditcard(form, creditcard)
|
116
107
|
form[:card_number] = creditcard.number
|
117
108
|
form[:exp_date] = expdate(creditcard)
|
118
109
|
|
119
|
-
if creditcard.verification_value?
|
120
|
-
add_verification_value(form, creditcard)
|
121
|
-
end
|
110
|
+
add_verification_value(form, creditcard) if creditcard.verification_value?
|
122
111
|
|
123
112
|
form[:first_name] = creditcard.first_name.to_s.slice(0, 20)
|
124
113
|
form[:last_name] = creditcard.last_name.to_s.slice(0, 30)
|
@@ -145,14 +134,13 @@ module ActiveMerchant #:nodoc:
|
|
145
134
|
parameters[:amount] = amount(money)
|
146
135
|
parameters[:transaction_type] = self.actions[action]
|
147
136
|
|
148
|
-
response = parse(
|
137
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(parameters)))
|
149
138
|
|
150
139
|
Response.new(response['result'] == APPROVED, message_from(response), response,
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
)
|
140
|
+
test: @options[:test] || test?,
|
141
|
+
authorization: authorization_from(response),
|
142
|
+
avs_result: { code: response['avs_response'] },
|
143
|
+
cvv_result: response['cvv2_response'])
|
156
144
|
end
|
157
145
|
|
158
146
|
def authorization_from(response)
|
@@ -166,16 +154,16 @@ module ActiveMerchant #:nodoc:
|
|
166
154
|
def post_data(parameters)
|
167
155
|
result = preamble
|
168
156
|
result.merge!(parameters)
|
169
|
-
result.collect { |key, value| "ssl_#{key}=#{CGI.escape(value.to_s)}" }.join(
|
157
|
+
result.collect { |key, value| "ssl_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
170
158
|
end
|
171
159
|
|
172
160
|
# Parse the response message
|
173
161
|
def parse(msg)
|
174
162
|
resp = {}
|
175
|
-
msg.split(self.delimiter).collect{|li|
|
176
|
-
|
177
|
-
|
178
|
-
|
163
|
+
msg.split(self.delimiter).collect { |li|
|
164
|
+
key, value = li.split('=')
|
165
|
+
resp[key.strip.gsub(/^ssl_/, '')] = value.to_s.strip
|
166
|
+
}
|
179
167
|
resp
|
180
168
|
end
|
181
169
|
end
|
@@ -0,0 +1,250 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class VisanetPeruGateway < Gateway
|
4
|
+
include Empty
|
5
|
+
self.display_name = 'VisaNet Peru Gateway'
|
6
|
+
self.homepage_url = 'http://www.visanet.com.pe'
|
7
|
+
|
8
|
+
self.test_url = 'https://devapi.vnforapps.com/api.tokenization/api/v2/merchant'
|
9
|
+
self.live_url = 'https://api.vnforapps.com/api.tokenization/api/v2/merchant'
|
10
|
+
|
11
|
+
self.supported_countries = %w[US PE]
|
12
|
+
self.default_currency = 'PEN'
|
13
|
+
self.money_format = :dollars
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
15
|
+
|
16
|
+
def initialize(options = {})
|
17
|
+
requires!(options, :access_key_id, :secret_access_key, :merchant_id)
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def purchase(amount, payment_method, options = {})
|
22
|
+
MultiResponse.run() do |r|
|
23
|
+
r.process { authorize(amount, payment_method, options) }
|
24
|
+
r.process { capture(amount, r.authorization, options) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def authorize(amount, payment_method, options = {})
|
29
|
+
params = {}
|
30
|
+
|
31
|
+
add_invoice(params, amount, options)
|
32
|
+
add_payment_method(params, payment_method)
|
33
|
+
add_antifraud_data(params, options)
|
34
|
+
params[:email] = options[:email] || 'unknown@email.com'
|
35
|
+
params[:createAlias] = false
|
36
|
+
|
37
|
+
commit('authorize', params, options)
|
38
|
+
end
|
39
|
+
|
40
|
+
def capture(amount, authorization, options = {})
|
41
|
+
params = {}
|
42
|
+
options[:id_unico] = split_authorization(authorization)[1]
|
43
|
+
add_auth_order_id(params, authorization, options)
|
44
|
+
commit('deposit', params, options)
|
45
|
+
end
|
46
|
+
|
47
|
+
def void(authorization, options = {})
|
48
|
+
params = {}
|
49
|
+
add_auth_order_id(params, authorization, options)
|
50
|
+
commit('void', params, options)
|
51
|
+
end
|
52
|
+
|
53
|
+
def refund(amount, authorization, options = {})
|
54
|
+
params = {}
|
55
|
+
params[:amount] = amount(amount) if amount
|
56
|
+
add_auth_order_id(params, authorization, options)
|
57
|
+
response = commit('cancelDeposit', params, options)
|
58
|
+
return response if response.success? || split_authorization(authorization).length == 1 || !options[:force_full_refund_if_unsettled]
|
59
|
+
|
60
|
+
# Attempt RefundSingleTransaction if unsettled (and stash the original
|
61
|
+
# response message so it will be included it in the follow-up response
|
62
|
+
# message)
|
63
|
+
options[:error_message] = response.message
|
64
|
+
prepare_refund_data(params, authorization, options)
|
65
|
+
commit('refund', params, options)
|
66
|
+
end
|
67
|
+
|
68
|
+
def verify(credit_card, options = {})
|
69
|
+
MultiResponse.run(:use_first_response) do |r|
|
70
|
+
r.process { authorize(100, credit_card, options) }
|
71
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def supports_scrubbing?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
def scrub(transcript)
|
80
|
+
transcript.
|
81
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
82
|
+
gsub(%r((\"cardNumber\\\":\\\")\d+), '\1[FILTERED]').
|
83
|
+
gsub(%r((\"cvv2Code\\\":\\\")\d+), '\1[FILTERED]')
|
84
|
+
end
|
85
|
+
|
86
|
+
private
|
87
|
+
|
88
|
+
CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
|
89
|
+
CURRENCY_CODES['USD'] = 840
|
90
|
+
CURRENCY_CODES['PEN'] = 604
|
91
|
+
|
92
|
+
def add_invoice(params, money, options)
|
93
|
+
# Visanet Peru expects a 12-digit alphanumeric purchaseNumber
|
94
|
+
params[:purchaseNumber] = generate_purchase_number_stamp
|
95
|
+
params[:externalTransactionId] = options[:order_id]
|
96
|
+
params[:amount] = amount(money)
|
97
|
+
params[:currencyId] = CURRENCY_CODES[options[:currency] || currency(money)]
|
98
|
+
end
|
99
|
+
|
100
|
+
def add_auth_order_id(params, authorization, options)
|
101
|
+
purchase_number, = split_authorization(authorization)
|
102
|
+
params[:purchaseNumber] = purchase_number
|
103
|
+
params[:externalTransactionId] = options[:order_id]
|
104
|
+
end
|
105
|
+
|
106
|
+
def add_payment_method(params, payment_method)
|
107
|
+
params[:firstName] = payment_method.first_name
|
108
|
+
params[:lastName] = payment_method.last_name
|
109
|
+
params[:cardNumber] = payment_method.number
|
110
|
+
params[:cvv2Code] = payment_method.verification_value
|
111
|
+
params[:expirationYear] = format(payment_method.year, :four_digits)
|
112
|
+
params[:expirationMonth] = format(payment_method.month, :two_digits)
|
113
|
+
end
|
114
|
+
|
115
|
+
def add_antifraud_data(params, options)
|
116
|
+
antifraud = {}
|
117
|
+
|
118
|
+
if billing_address = options[:billing_address] || options[:address]
|
119
|
+
antifraud[:billTo_street1] = billing_address[:address1]
|
120
|
+
antifraud[:billTo_city] = billing_address[:city]
|
121
|
+
antifraud[:billTo_state] = billing_address[:state]
|
122
|
+
antifraud[:billTo_country] = billing_address[:country]
|
123
|
+
antifraud[:billTo_postalCode] = billing_address[:zip]
|
124
|
+
end
|
125
|
+
|
126
|
+
antifraud[:deviceFingerprintId] = options[:device_fingerprint_id] || SecureRandom.hex(16)
|
127
|
+
antifraud[:merchantDefineData] = options[:merchant_define_data] if options[:merchant_define_data]
|
128
|
+
|
129
|
+
params[:antifraud] = antifraud
|
130
|
+
end
|
131
|
+
|
132
|
+
def prepare_refund_data(params, authorization, options)
|
133
|
+
params.delete(:purchaseNumber)
|
134
|
+
params[:externalReferenceId] = params.delete(:externalTransactionId)
|
135
|
+
_, transaction_id = split_authorization(authorization)
|
136
|
+
|
137
|
+
options.update(transaction_id: transaction_id)
|
138
|
+
params[:ruc] = options[:ruc]
|
139
|
+
end
|
140
|
+
|
141
|
+
def split_authorization(authorization)
|
142
|
+
authorization.split('|')
|
143
|
+
end
|
144
|
+
|
145
|
+
def generate_purchase_number_stamp
|
146
|
+
(Time.now.to_f.round(2) * 100).to_i.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
def commit(action, params, options = {})
|
150
|
+
raw_response = ssl_request(method(action), url(action, params, options), params.to_json, headers)
|
151
|
+
response = parse(raw_response)
|
152
|
+
rescue ResponseError => e
|
153
|
+
raw_response = e.response.body
|
154
|
+
response_error(raw_response, options, action)
|
155
|
+
rescue JSON::ParserError
|
156
|
+
unparsable_response(raw_response)
|
157
|
+
else
|
158
|
+
Response.new(
|
159
|
+
success_from(response),
|
160
|
+
message_from(response, options, action),
|
161
|
+
response,
|
162
|
+
test: test?,
|
163
|
+
authorization: authorization_from(params, response, options),
|
164
|
+
error_code: response['errorCode']
|
165
|
+
)
|
166
|
+
end
|
167
|
+
|
168
|
+
def headers
|
169
|
+
{
|
170
|
+
'Authorization' => 'Basic ' + Base64.strict_encode64("#{@options[:access_key_id]}:#{@options[:secret_access_key]}").strip,
|
171
|
+
'Content-Type' => 'application/json'
|
172
|
+
}
|
173
|
+
end
|
174
|
+
|
175
|
+
def url(action, params, options = {})
|
176
|
+
if action == 'authorize'
|
177
|
+
"#{base_url}/#{@options[:merchant_id]}"
|
178
|
+
elsif action == 'refund'
|
179
|
+
"#{base_url}/#{@options[:merchant_id]}/#{action}/#{options[:transaction_id]}"
|
180
|
+
else
|
181
|
+
"#{base_url}/#{@options[:merchant_id]}/#{action}/#{params[:purchaseNumber]}"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
def method(action)
|
186
|
+
%w(authorize refund).include?(action) ? :post : :put
|
187
|
+
end
|
188
|
+
|
189
|
+
def authorization_from(params, response, options)
|
190
|
+
id_unico = response['data']['ID_UNICO'] || options[:id_unico]
|
191
|
+
"#{params[:purchaseNumber]}|#{id_unico}"
|
192
|
+
end
|
193
|
+
|
194
|
+
def base_url
|
195
|
+
test? ? test_url : live_url
|
196
|
+
end
|
197
|
+
|
198
|
+
def parse(body)
|
199
|
+
JSON.parse(body)
|
200
|
+
end
|
201
|
+
|
202
|
+
def success_from(response)
|
203
|
+
response['errorCode'] == 0
|
204
|
+
end
|
205
|
+
|
206
|
+
def message_from(response, options, action)
|
207
|
+
message_from_messages(
|
208
|
+
response['errorMessage'],
|
209
|
+
action_code_description(response),
|
210
|
+
options[:error_message]
|
211
|
+
)
|
212
|
+
end
|
213
|
+
|
214
|
+
def message_from_messages(*args)
|
215
|
+
args.reject { |m| error_message_empty?(m) }.join(' | ')
|
216
|
+
end
|
217
|
+
|
218
|
+
def action_code_description(response)
|
219
|
+
return nil unless response['data']
|
220
|
+
|
221
|
+
response['data']['DSC_COD_ACCION']
|
222
|
+
end
|
223
|
+
|
224
|
+
def error_message_empty?(error_message)
|
225
|
+
empty?(error_message) || error_message == '[ ]'
|
226
|
+
end
|
227
|
+
|
228
|
+
def response_error(raw_response, options, action)
|
229
|
+
response = parse(raw_response)
|
230
|
+
rescue JSON::ParserError
|
231
|
+
unparsable_response(raw_response)
|
232
|
+
else
|
233
|
+
return Response.new(
|
234
|
+
false,
|
235
|
+
message_from(response, options, action),
|
236
|
+
response,
|
237
|
+
test: test?,
|
238
|
+
authorization: response['transactionUUID'],
|
239
|
+
error_code: response['errorCode']
|
240
|
+
)
|
241
|
+
end
|
242
|
+
|
243
|
+
def unparsable_response(raw_response)
|
244
|
+
message = 'Invalid JSON response received from VisanetPeruGateway. Please contact VisanetPeruGateway if you continue to receive this message.'
|
245
|
+
message += " (The raw response returned by the API was #{raw_response.inspect})"
|
246
|
+
return Response.new(false, message)
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|