activemerchant 1.79.2 → 1.129.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +1391 -0
- data/README.md +29 -14
- data/lib/active_merchant/billing/avs_result.rb +25 -28
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +55 -22
- data/lib/active_merchant/billing/compatibility.rb +10 -12
- data/lib/active_merchant/billing/credit_card.rb +82 -62
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +328 -58
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +61 -56
- data/lib/active_merchant/billing/gateways/adyen.rb +562 -87
- 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 +35 -36
- data/lib/active_merchant/billing/gateways/authorize_net.rb +297 -196
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +94 -98
- data/lib/active_merchant/billing/gateways/axcessms.rb +64 -66
- 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 +12 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +140 -69
- 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 +115 -115
- data/lib/active_merchant/billing/gateways/beanstream.rb +39 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -2
- data/lib/active_merchant/billing/gateways/blue_pay.rb +87 -58
- data/lib/active_merchant/billing/gateways/blue_snap.rb +405 -104
- data/lib/active_merchant/billing/gateways/bogus.rb +34 -30
- data/lib/active_merchant/billing/gateways/borgun.rb +97 -47
- data/lib/active_merchant/billing/gateways/bpoint.rb +20 -20
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -3
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +561 -259
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +53 -54
- data/lib/active_merchant/billing/gateways/cams.rb +31 -31
- data/lib/active_merchant/billing/gateways/card_connect.rb +85 -33
- data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +187 -169
- data/lib/active_merchant/billing/gateways/cardknox.rb +24 -25
- data/lib/active_merchant/billing/gateways/cardprocess.rb +9 -7
- data/lib/active_merchant/billing/gateways/cashnet.rb +43 -27
- data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
- data/lib/active_merchant/billing/gateways/cecabank.rb +62 -52
- data/lib/active_merchant/billing/gateways/cenpos.rb +63 -62
- data/lib/active_merchant/billing/gateways/checkout.rb +21 -23
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +391 -113
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -3
- data/lib/active_merchant/billing/gateways/clearhaus.rb +40 -41
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +361 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
- data/lib/active_merchant/billing/gateways/conekta.rb +35 -30
- data/lib/active_merchant/billing/gateways/creditcall.rb +59 -59
- data/lib/active_merchant/billing/gateways/credorax.rb +326 -145
- data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +53 -53
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +566 -208
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +456 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +342 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +40 -56
- 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 +34 -40
- data/lib/active_merchant/billing/gateways/digitzs.rb +48 -45
- data/lib/active_merchant/billing/gateways/ebanx.rb +110 -60
- data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
- data/lib/active_merchant/billing/gateways/elavon.rb +351 -189
- data/lib/active_merchant/billing/gateways/element.rb +106 -56
- data/lib/active_merchant/billing/gateways/epay.rb +74 -64
- data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
- data/lib/active_merchant/billing/gateways/eway.rb +74 -73
- data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +105 -60
- data/lib/active_merchant/billing/gateways/exact.rb +29 -37
- data/lib/active_merchant/billing/gateways/ezic.rb +21 -22
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +70 -48
- data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -4
- data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
- data/lib/active_merchant/billing/gateways/first_pay.rb +33 -13
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +106 -105
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +36 -36
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
- data/lib/active_merchant/billing/gateways/forte.rb +70 -40
- data/lib/active_merchant/billing/gateways/garanti.rb +24 -31
- data/lib/active_merchant/billing/gateways/global_collect.rb +378 -154
- data/lib/active_merchant/billing/gateways/global_transport.rb +12 -13
- data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
- data/lib/active_merchant/billing/gateways/hps.rb +236 -69
- data/lib/active_merchant/billing/gateways/iats_payments.rb +61 -39
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +41 -47
- data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +25 -24
- data/lib/active_merchant/billing/gateways/iridium.rb +243 -244
- data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
- data/lib/active_merchant/billing/gateways/iveri.rb +73 -34
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +145 -152
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +154 -159
- data/lib/active_merchant/billing/gateways/komoju.rb +16 -16
- data/lib/active_merchant/billing/gateways/kushki.rb +127 -57
- data/lib/active_merchant/billing/gateways/latitude19.rb +111 -115
- data/lib/active_merchant/billing/gateways/linkpoint.rb +82 -85
- data/lib/active_merchant/billing/gateways/litle.rb +247 -53
- data/lib/active_merchant/billing/gateways/mastercard.rb +41 -23
- data/lib/active_merchant/billing/gateways/maxipago.rb +5 -5
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +135 -49
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +62 -29
- data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +40 -40
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +42 -44
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +52 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +47 -51
- data/lib/active_merchant/billing/gateways/metrics_global.rb +32 -42
- data/lib/active_merchant/billing/gateways/micropayment.rb +42 -45
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +45 -40
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +29 -31
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +255 -138
- data/lib/active_merchant/billing/gateways/moneris.rb +226 -88
- data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
- data/lib/active_merchant/billing/gateways/mundipagg.rb +117 -43
- data/lib/active_merchant/billing/gateways/nab_transact.rb +28 -31
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +13 -15
- 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 +167 -80
- data/lib/active_merchant/billing/gateways/netbilling.rb +27 -30
- 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 +134 -48
- data/lib/active_merchant/billing/gateways/ogone.rb +88 -58
- data/lib/active_merchant/billing/gateways/omise.rb +30 -31
- data/lib/active_merchant/billing/gateways/openpay.rb +45 -26
- data/lib/active_merchant/billing/gateways/opp.rb +166 -144
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +67 -64
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
- data/lib/active_merchant/billing/gateways/orbital.rb +726 -382
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +26 -27
- data/lib/active_merchant/billing/gateways/pagarme.rb +47 -56
- 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 +39 -40
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +65 -65
- data/lib/active_merchant/billing/gateways/pay_hub.rb +39 -39
- data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +70 -54
- data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +71 -47
- data/lib/active_merchant/billing/gateways/payeezy.rb +159 -32
- data/lib/active_merchant/billing/gateways/payex.rb +39 -42
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +41 -36
- 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 +178 -54
- data/lib/active_merchant/billing/gateways/payflow_express.rb +61 -65
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +0 -1
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +66 -58
- data/lib/active_merchant/billing/gateways/paymentez.rb +114 -25
- data/lib/active_merchant/billing/gateways/paymill.rb +134 -133
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +27 -14
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +5 -2
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +79 -82
- data/lib/active_merchant/billing/gateways/payu_in.rb +59 -58
- data/lib/active_merchant/billing/gateways/payu_latam.rb +139 -97
- 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 +87 -34
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +139 -140
- data/lib/active_merchant/billing/gateways/psigate.rb +44 -44
- data/lib/active_merchant/billing/gateways/psl_card.rb +29 -37
- data/lib/active_merchant/billing/gateways/qbms.rb +75 -76
- data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
- data/lib/active_merchant/billing/gateways/quickbooks.rb +142 -55
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +103 -107
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +156 -158
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +7 -8
- data/lib/active_merchant/billing/gateways/quickpay.rb +1 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +137 -68
- 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 +132 -50
- data/lib/active_merchant/billing/gateways/redsys.rb +382 -186
- data/lib/active_merchant/billing/gateways/s5.rb +16 -16
- data/lib/active_merchant/billing/gateways/safe_charge.rb +83 -47
- data/lib/active_merchant/billing/gateways/sage.rb +49 -48
- data/lib/active_merchant/billing/gateways/sage_pay.rb +76 -83
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
- data/lib/active_merchant/billing/gateways/secure_net.rb +32 -40
- data/lib/active_merchant/billing/gateways/secure_pay.rb +30 -40
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +23 -26
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
- data/lib/active_merchant/billing/gateways/securion_pay.rb +69 -31
- data/lib/active_merchant/billing/gateways/shift4.rb +342 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -53
- 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 +66 -47
- data/lib/active_merchant/billing/gateways/stripe.rb +309 -148
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +556 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +18 -23
- data/lib/active_merchant/billing/gateways/telr.rb +46 -48
- data/lib/active_merchant/billing/gateways/tns.rb +8 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +37 -37
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +249 -245
- data/lib/active_merchant/billing/gateways/transact_pro.rb +25 -27
- 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 +22 -18
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +161 -88
- data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +231 -238
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +129 -55
- data/lib/active_merchant/billing/gateways/vanco.rb +42 -33
- data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
- data/lib/active_merchant/billing/gateways/viaklix.rb +18 -22
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +115 -74
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +38 -41
- data/lib/active_merchant/billing/gateways/wirecard.rb +36 -37
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +39 -38
- data/lib/active_merchant/billing/gateways/worldpay.rb +756 -142
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +73 -83
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +31 -31
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +3 -3
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/billing/response.rb +32 -13
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +24 -38
- data/lib/active_merchant/country.rb +9 -5
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +2 -0
- data/lib/active_merchant/network_connection_retries.rb +28 -31
- data/lib/active_merchant/post_data.rb +5 -3
- data/lib/active_merchant/posts_data.rb +5 -7
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +3 -3
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +1592 -2329
- data/lib/support/gateway_support.rb +8 -10
- data/lib/support/ssl_verify.rb +9 -14
- data/lib/support/ssl_version.rb +9 -10
- metadata +98 -37
- 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 -309
@@ -3,9 +3,9 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
class CardknoxGateway < Gateway
|
4
4
|
self.live_url = 'https://x1.cardknox.com/gateway'
|
5
5
|
|
6
|
-
self.supported_countries = [
|
6
|
+
self.supported_countries = %w[US CA GB]
|
7
7
|
self.default_currency = 'USD'
|
8
|
-
self.supported_cardtypes = [
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
9
9
|
|
10
10
|
self.homepage_url = 'https://www.cardknox.com/'
|
11
11
|
self.display_name = 'Cardknox'
|
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
|
30
|
-
def initialize(options={})
|
30
|
+
def initialize(options = {})
|
31
31
|
requires!(options, :api_key)
|
32
32
|
super
|
33
33
|
end
|
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
|
|
37
37
|
# - check
|
38
38
|
# - cardknox token, which is returned in the the authorization string "ref_num;token;command"
|
39
39
|
|
40
|
-
def purchase(amount, source, options={})
|
40
|
+
def purchase(amount, source, options = {})
|
41
41
|
post = {}
|
42
42
|
add_amount(post, amount, options)
|
43
43
|
add_invoice(post, options)
|
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
commit(:purchase, source_type(source), post)
|
49
49
|
end
|
50
50
|
|
51
|
-
def authorize(amount, source, options={})
|
51
|
+
def authorize(amount, source, options = {})
|
52
52
|
post = {}
|
53
53
|
add_amount(post, amount)
|
54
54
|
add_invoice(post, options)
|
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
|
|
66
66
|
commit(:capture, source_type(authorization), post)
|
67
67
|
end
|
68
68
|
|
69
|
-
def refund(amount, authorization, options={})
|
69
|
+
def refund(amount, authorization, options = {})
|
70
70
|
post = {}
|
71
71
|
add_reference(post, authorization)
|
72
72
|
add_amount(post, amount)
|
@@ -79,10 +79,10 @@ module ActiveMerchant #:nodoc:
|
|
79
79
|
commit(:void, source_type(authorization), post)
|
80
80
|
end
|
81
81
|
|
82
|
-
def verify(credit_card, options={})
|
82
|
+
def verify(credit_card, options = {})
|
83
83
|
MultiResponse.run(:use_first_response) do |r|
|
84
|
-
|
85
|
-
|
84
|
+
r.process { authorize(100, credit_card, options) }
|
85
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -112,11 +112,11 @@ module ActiveMerchant #:nodoc:
|
|
112
112
|
private
|
113
113
|
|
114
114
|
def split_authorization(authorization)
|
115
|
-
authorization.split(
|
115
|
+
authorization.split(';')
|
116
116
|
end
|
117
117
|
|
118
118
|
def add_reference(post, reference)
|
119
|
-
reference,
|
119
|
+
reference, = split_authorization(reference)
|
120
120
|
post[:Refnum] = reference
|
121
121
|
end
|
122
122
|
|
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
|
|
134
134
|
|
135
135
|
def source_type_from(authorization)
|
136
136
|
_, _, source_type = split_authorization(authorization)
|
137
|
-
(source_type ||
|
137
|
+
(source_type || 'credit_card').to_sym
|
138
138
|
end
|
139
139
|
|
140
140
|
def add_source(post, source)
|
@@ -186,7 +186,7 @@ module ActiveMerchant #:nodoc:
|
|
186
186
|
post[address_key(prefix, 'FirstName')] = address[:first_name]
|
187
187
|
post[address_key(prefix, 'LastName')] = address[:last_name]
|
188
188
|
end
|
189
|
-
post[address_key(prefix, 'MiddleName')]
|
189
|
+
post[address_key(prefix, 'MiddleName')] = address[:middle_name]
|
190
190
|
|
191
191
|
post[address_key(prefix, 'Company')] = address[:company]
|
192
192
|
post[address_key(prefix, 'Street')] = address[:address1]
|
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
|
|
247
247
|
end
|
248
248
|
|
249
249
|
def add_cardknox_token(post, authorization)
|
250
|
-
_, token,
|
250
|
+
_, token, = split_authorization(authorization)
|
251
251
|
|
252
252
|
post[:Token] = token
|
253
253
|
end
|
@@ -255,7 +255,7 @@ module ActiveMerchant #:nodoc:
|
|
255
255
|
def parse(body)
|
256
256
|
fields = {}
|
257
257
|
for line in body.split('&')
|
258
|
-
key, value = *line.scan(
|
258
|
+
key, value = *line.scan(%r{^(\w+)\=(.*)$}).flatten
|
259
259
|
fields[key] = CGI.unescape(value.to_s)
|
260
260
|
end
|
261
261
|
|
@@ -276,14 +276,13 @@ module ActiveMerchant #:nodoc:
|
|
276
276
|
amount: fields['xAuthAmount'],
|
277
277
|
masked_card_num: fields['xMaskedCardNumber'],
|
278
278
|
masked_account_number: fields['MaskedAccountNumber']
|
279
|
-
}.delete_if{|
|
279
|
+
}.delete_if { |_k, v| v.nil? }
|
280
280
|
end
|
281
281
|
|
282
|
-
|
283
282
|
def commit(action, source_type, parameters)
|
284
283
|
response = parse(ssl_post(live_url, post_data(COMMANDS[source_type][action], parameters)))
|
285
284
|
|
286
|
-
|
285
|
+
Response.new(
|
287
286
|
(response[:status] == 'Approved'),
|
288
287
|
message_from(response),
|
289
288
|
response,
|
@@ -294,10 +293,10 @@ module ActiveMerchant #:nodoc:
|
|
294
293
|
end
|
295
294
|
|
296
295
|
def message_from(response)
|
297
|
-
if response[:status] ==
|
298
|
-
|
296
|
+
if response[:status] == 'Approved'
|
297
|
+
'Success'
|
299
298
|
elsif response[:error].blank?
|
300
|
-
|
299
|
+
'Unspecified error'
|
301
300
|
else
|
302
301
|
response[:error]
|
303
302
|
end
|
@@ -310,10 +309,10 @@ module ActiveMerchant #:nodoc:
|
|
310
309
|
def post_data(command, parameters = {})
|
311
310
|
initial_parameters = {
|
312
311
|
Key: @options[:api_key],
|
313
|
-
Version:
|
312
|
+
Version: '4.5.4',
|
314
313
|
SoftwareName: 'Active Merchant',
|
315
|
-
SoftwareVersion:
|
316
|
-
Command: command
|
314
|
+
SoftwareVersion: ActiveMerchant::VERSION.to_s,
|
315
|
+
Command: command
|
317
316
|
}
|
318
317
|
|
319
318
|
seed = SecureRandom.hex(32).upcase
|
@@ -321,7 +320,7 @@ module ActiveMerchant #:nodoc:
|
|
321
320
|
initial_parameters[:Hash] = "s/#{seed}/#{hash}/n" unless @options[:pin].blank?
|
322
321
|
parameters = initial_parameters.merge(parameters)
|
323
322
|
|
324
|
-
parameters.reject{|
|
323
|
+
parameters.reject { |_k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
325
324
|
end
|
326
325
|
end
|
327
326
|
end
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
MT HU NL AT PL PT RO SI SK FI SE GB IS LI NO
|
9
9
|
CH ME MK AL RS TR BA ]
|
10
10
|
self.default_currency = 'EUR'
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express diners_club jcb]
|
12
12
|
|
13
13
|
self.homepage_url = 'https://vr-pay-ecommerce.docs.oppwa.com/'
|
14
14
|
self.display_name = 'CardProcess VR-Pay'
|
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
|
|
26
26
|
# * <tt>:user_id</tt> -- The CardProcess user ID
|
27
27
|
# * <tt>:password</tt> -- The CardProcess password
|
28
28
|
# * <tt>:entity_id</tt> -- The CardProcess channel or entity ID for any transactions
|
29
|
-
def initialize(options={})
|
29
|
+
def initialize(options = {})
|
30
30
|
requires!(options, :user_id, :password, :entity_id)
|
31
31
|
super
|
32
32
|
# This variable exists purely to allow remote tests to force error codes;
|
@@ -99,10 +99,10 @@ module ActiveMerchant #:nodoc:
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def scrub(transcript)
|
102
|
-
transcript
|
103
|
-
|
104
|
-
|
105
|
-
|
102
|
+
transcript.
|
103
|
+
gsub(%r{(authentication\.[^=]+=)[^&]+}, '\1[FILTERED]').
|
104
|
+
gsub(%r{(card\.number=)\d+}, '\1[FILTERED]').
|
105
|
+
gsub(%r{(cvv=)\d{3,4}}, '\1[FILTERED]\2')
|
106
106
|
end
|
107
107
|
|
108
108
|
private
|
@@ -123,6 +123,7 @@ module ActiveMerchant #:nodoc:
|
|
123
123
|
|
124
124
|
def add_invoice(post, money, options)
|
125
125
|
return if money.nil?
|
126
|
+
|
126
127
|
post[:amount] = amount(money)
|
127
128
|
post[:currency] = (options[:currency] || currency(money))
|
128
129
|
post[:merchantInvoiceId] = options[:merchant_invoice_id] if options[:merchant_invoice_id]
|
@@ -132,6 +133,7 @@ module ActiveMerchant #:nodoc:
|
|
132
133
|
|
133
134
|
def add_payment(post, payment)
|
134
135
|
return if payment.is_a?(String)
|
136
|
+
|
135
137
|
post[:paymentBrand] = payment.brand.upcase if payment.brand
|
136
138
|
post[:card] ||= {}
|
137
139
|
post[:card][:number] = payment.number
|
@@ -189,7 +191,7 @@ module ActiveMerchant #:nodoc:
|
|
189
191
|
post[:authentication][:password] = @options[:password]
|
190
192
|
post[:authentication][:entityId] = @options[:entity_id]
|
191
193
|
post[:paymentType] = action
|
192
|
-
dot_flatten_hash(post).map {|key, value| "#{key}=#{CGI.escape(value.to_s)}"}.join(
|
194
|
+
dot_flatten_hash(post).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
193
195
|
end
|
194
196
|
|
195
197
|
def error_code_from(response)
|
@@ -3,13 +3,13 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
class CashnetGateway < Gateway
|
4
4
|
include Empty
|
5
5
|
|
6
|
-
self.live_url =
|
7
|
-
self.test_url =
|
6
|
+
self.live_url = 'https://commerce.cashnet.com/'
|
7
|
+
self.test_url = 'https://train.cashnet.com/'
|
8
8
|
|
9
|
-
self.supported_countries = [
|
10
|
-
self.supported_cardtypes = [
|
11
|
-
self.homepage_url =
|
12
|
-
self.display_name =
|
9
|
+
self.supported_countries = ['US']
|
10
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
11
|
+
self.homepage_url = 'https://transactcampus.com'
|
12
|
+
self.display_name = 'Cashnet'
|
13
13
|
self.money_format = :dollars
|
14
14
|
self.max_retries = 0
|
15
15
|
|
@@ -34,14 +34,14 @@ module ActiveMerchant #:nodoc:
|
|
34
34
|
:password,
|
35
35
|
:merchant_gateway_name
|
36
36
|
)
|
37
|
-
options[:default_item_code] ||=
|
37
|
+
options[:default_item_code] ||= 'FEE'
|
38
38
|
super
|
39
39
|
end
|
40
40
|
|
41
41
|
def purchase(money, payment_object, options = {})
|
42
42
|
post = {}
|
43
43
|
add_creditcard(post, payment_object)
|
44
|
-
add_invoice(post, options)
|
44
|
+
add_invoice(post, money, options)
|
45
45
|
add_address(post, options)
|
46
46
|
add_customer_data(post, options)
|
47
47
|
commit('SALE', money, post)
|
@@ -49,8 +49,8 @@ module ActiveMerchant #:nodoc:
|
|
49
49
|
|
50
50
|
def refund(money, identification, options = {})
|
51
51
|
post = {}
|
52
|
-
post[:origtx]
|
53
|
-
add_invoice(post, options)
|
52
|
+
post[:origtx] = identification
|
53
|
+
add_invoice(post, money, options)
|
54
54
|
add_customer_data(post, options)
|
55
55
|
commit('REFUND', money, post)
|
56
56
|
end
|
@@ -60,23 +60,22 @@ module ActiveMerchant #:nodoc:
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def scrub(transcript)
|
63
|
-
transcript
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
transcript.
|
64
|
+
gsub(%r{(password=)[^&]+}, '\1[FILTERED]').
|
65
|
+
gsub(%r{(cardno=)[^&]+}, '\1[FILTERED]').
|
66
|
+
gsub(%r{(cid=)[^&]+}, '\1[FILTERED]')
|
67
67
|
end
|
68
68
|
|
69
69
|
private
|
70
70
|
|
71
71
|
def commit(action, money, fields)
|
72
|
-
fields[:amount] = amount(money)
|
73
72
|
url = (test? ? test_url : live_url) + CGI.escape(@options[:merchant_gateway_name])
|
74
73
|
raw_response = ssl_post(url, post_data(action, fields))
|
75
74
|
parsed_response = parse(raw_response)
|
76
75
|
|
77
76
|
return unparsable_response(raw_response) unless parsed_response
|
78
77
|
|
79
|
-
success = (parsed_response
|
78
|
+
success = success?(parsed_response)
|
80
79
|
Response.new(
|
81
80
|
success,
|
82
81
|
CASHNET_CODES[parsed_response[:result]],
|
@@ -86,15 +85,20 @@ module ActiveMerchant #:nodoc:
|
|
86
85
|
)
|
87
86
|
end
|
88
87
|
|
88
|
+
def success?(response)
|
89
|
+
response[:result] == '0'
|
90
|
+
end
|
91
|
+
|
89
92
|
def post_data(action, parameters = {})
|
90
93
|
post = {}
|
94
|
+
|
91
95
|
post[:command] = action
|
92
96
|
post[:merchant] = @options[:merchant]
|
93
97
|
post[:operator] = @options[:operator]
|
94
98
|
post[:password] = @options[:password]
|
95
|
-
post[:station] = (@options[:station] ||
|
99
|
+
post[:station] = (@options[:station] || 'WEB')
|
96
100
|
post[:custcode] = (@options[:custcode] || "ActiveMerchant/#{ActiveMerchant::VERSION}")
|
97
|
-
post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join(
|
101
|
+
post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
98
102
|
end
|
99
103
|
|
100
104
|
def add_creditcard(post, creditcard)
|
@@ -106,9 +110,19 @@ module ActiveMerchant #:nodoc:
|
|
106
110
|
post[:lname] = creditcard.last_name
|
107
111
|
end
|
108
112
|
|
109
|
-
def add_invoice(post, options)
|
110
|
-
post[:order_number]
|
111
|
-
|
113
|
+
def add_invoice(post, money, options)
|
114
|
+
post[:order_number] = options[:order_id] if options[:order_id].present?
|
115
|
+
|
116
|
+
if options[:item_codes].present?
|
117
|
+
codes_and_amounts = options[:item_codes].transform_keys { |key| key.to_s.delete('_') }
|
118
|
+
codes_and_amounts.each do |key, value|
|
119
|
+
post[key] = value if key.start_with?('itemcode')
|
120
|
+
post[key] = amount(value.to_i) if key.start_with?('amount')
|
121
|
+
end
|
122
|
+
else
|
123
|
+
post[:itemcode] = (options[:item_code] || @options[:default_item_code])
|
124
|
+
post[:amount] = amount(money.to_i)
|
125
|
+
end
|
112
126
|
end
|
113
127
|
|
114
128
|
def add_address(post, options)
|
@@ -121,8 +135,8 @@ module ActiveMerchant #:nodoc:
|
|
121
135
|
end
|
122
136
|
|
123
137
|
def add_customer_data(post, options)
|
124
|
-
post[:email_g]
|
125
|
-
post[:custcode]
|
138
|
+
post[:email_g] = options[:email]
|
139
|
+
post[:custcode] = options[:custcode] unless empty?(options[:custcode])
|
126
140
|
end
|
127
141
|
|
128
142
|
def expdate(creditcard)
|
@@ -136,20 +150,21 @@ module ActiveMerchant #:nodoc:
|
|
136
150
|
match = body.match(/<cngateway>(.*)<\/cngateway>/)
|
137
151
|
return nil unless match
|
138
152
|
|
139
|
-
Hash[CGI::parse(match[1]).map{|k,v| [k.to_sym,v.first]}]
|
153
|
+
Hash[CGI::parse(match[1]).map { |k, v| [k.to_sym, v.first] }]
|
140
154
|
end
|
141
155
|
|
142
156
|
def handle_response(response)
|
143
|
-
if (200...300).
|
157
|
+
if (200...300).cover?(response.code.to_i)
|
144
158
|
return response.body
|
145
|
-
elsif
|
159
|
+
elsif response.code.to_i == 302
|
146
160
|
return ssl_get(URI.parse(response['location']))
|
147
161
|
end
|
162
|
+
|
148
163
|
raise ResponseError.new(response)
|
149
164
|
end
|
150
165
|
|
151
166
|
def unparsable_response(raw_response)
|
152
|
-
message =
|
167
|
+
message = 'Unparsable response received from Cashnet. Please contact Cashnet if you continue to receive this message.'
|
153
168
|
message += " (The raw response returned by the API was #{raw_response.inspect})"
|
154
169
|
return Response.new(false, message)
|
155
170
|
end
|
@@ -190,6 +205,7 @@ module ActiveMerchant #:nodoc:
|
|
190
205
|
'215' => 'Old PIN does not validate ',
|
191
206
|
'221' => 'Invalid credit card processor type specified in location or payment code',
|
192
207
|
'222' => 'Credit card processor error',
|
208
|
+
'230' => 'Host Error (USE VOID OR REVERSAL TO REFUND UNSETTLED TRANSACTIONS)',
|
193
209
|
'280' => 'SmartPay transaction not posted',
|
194
210
|
'301' => 'Original transaction not found for this customer',
|
195
211
|
'302' => 'Amount to refund exceeds original payment amount or is missing',
|
@@ -48,9 +48,9 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
protected
|
49
49
|
|
50
50
|
def build_sale_request(type, money, creditcard, options = {})
|
51
|
-
requires!(options,
|
51
|
+
requires!(options, :order_id)
|
52
52
|
|
53
|
-
xml = Builder::XmlMarkup.new :
|
53
|
+
xml = Builder::XmlMarkup.new indent: 2
|
54
54
|
|
55
55
|
xml.tag! 'CC5Request' do
|
56
56
|
add_login_tags(xml)
|
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
|
|
62
62
|
add_amount_tags(money, options, xml)
|
63
63
|
xml.tag! 'Email', options[:email] if options[:email]
|
64
64
|
|
65
|
-
if(address = (options[:billing_address] || options[:address]))
|
65
|
+
if (address = (options[:billing_address] || options[:address]))
|
66
66
|
xml.tag! 'BillTo' do
|
67
67
|
add_address(xml, address)
|
68
68
|
end
|
@@ -70,14 +70,13 @@ module ActiveMerchant #:nodoc:
|
|
70
70
|
add_address(xml, address)
|
71
71
|
end
|
72
72
|
end
|
73
|
-
|
74
73
|
end
|
75
74
|
|
76
75
|
xml.target!
|
77
76
|
end
|
78
77
|
|
79
78
|
def build_capture_request(money, authorization, options = {})
|
80
|
-
xml = Builder::XmlMarkup.new :
|
79
|
+
xml = Builder::XmlMarkup.new indent: 2
|
81
80
|
|
82
81
|
xml.tag! 'CC5Request' do
|
83
82
|
add_login_tags(xml)
|
@@ -88,7 +87,7 @@ module ActiveMerchant #:nodoc:
|
|
88
87
|
end
|
89
88
|
|
90
89
|
def build_void_request(authorization, options = {})
|
91
|
-
xml = Builder::XmlMarkup.new :
|
90
|
+
xml = Builder::XmlMarkup.new indent: 2
|
92
91
|
|
93
92
|
xml.tag! 'CC5Request' do
|
94
93
|
add_login_tags(xml)
|
@@ -98,7 +97,7 @@ module ActiveMerchant #:nodoc:
|
|
98
97
|
end
|
99
98
|
|
100
99
|
def build_authorization_credit_request(money, authorization, options = {})
|
101
|
-
xml = Builder::XmlMarkup.new :
|
100
|
+
xml = Builder::XmlMarkup.new indent: 2
|
102
101
|
|
103
102
|
xml.tag! 'CC5Request' do
|
104
103
|
add_login_tags(xml)
|
@@ -109,7 +108,7 @@ module ActiveMerchant #:nodoc:
|
|
109
108
|
end
|
110
109
|
|
111
110
|
def build_creditcard_credit_request(money, creditcard, options = {})
|
112
|
-
xml = Builder::XmlMarkup.new :
|
111
|
+
xml = Builder::XmlMarkup.new indent: 2
|
113
112
|
|
114
113
|
xml.tag! 'CC5Request' do
|
115
114
|
add_login_tags(xml)
|
@@ -148,7 +147,7 @@ module ActiveMerchant #:nodoc:
|
|
148
147
|
end
|
149
148
|
|
150
149
|
def commit(request)
|
151
|
-
raw_response = ssl_post((test? ? self.test_url : self.live_url),
|
150
|
+
raw_response = ssl_post((test? ? self.test_url : self.live_url), 'DATA=' + request)
|
152
151
|
|
153
152
|
response = parse(raw_response)
|
154
153
|
|
@@ -158,8 +157,8 @@ module ActiveMerchant #:nodoc:
|
|
158
157
|
success,
|
159
158
|
(success ? 'Approved' : "Declined (Reason: #{response[:proc_return_code]} - #{response[:err_msg]})"),
|
160
159
|
response,
|
161
|
-
:
|
162
|
-
:
|
160
|
+
test: test?,
|
161
|
+
authorization: response[:order_id]
|
163
162
|
)
|
164
163
|
end
|
165
164
|
|
@@ -175,25 +174,23 @@ module ActiveMerchant #:nodoc:
|
|
175
174
|
|
176
175
|
def parse_element(response, node)
|
177
176
|
if node.has_elements?
|
178
|
-
node.elements.each{|element| parse_element(response, element) }
|
177
|
+
node.elements.each { |element| parse_element(response, element) }
|
179
178
|
else
|
180
179
|
response[node.name.underscore.to_sym] = node.text
|
181
180
|
end
|
182
181
|
end
|
183
182
|
|
184
183
|
def success?(response)
|
185
|
-
(response[:response] ==
|
184
|
+
(response[:response] == 'Approved')
|
186
185
|
end
|
187
186
|
|
188
187
|
def normalize(text)
|
189
188
|
return unless text
|
190
189
|
|
191
190
|
if ActiveSupport::Inflector.method(:transliterate).arity == -2
|
192
|
-
ActiveSupport::Inflector.transliterate(text,'')
|
193
|
-
elsif RUBY_VERSION >= '1.9'
|
194
|
-
text.gsub(/[^\x00-\x7F]+/, '')
|
191
|
+
ActiveSupport::Inflector.transliterate(text, '')
|
195
192
|
else
|
196
|
-
|
193
|
+
text.gsub(/[^\x00-\x7F]+/, '')
|
197
194
|
end
|
198
195
|
end
|
199
196
|
end
|