activemerchant 1.100.0 → 1.133.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +1057 -0
- data/README.md +11 -9
- data/lib/active_merchant/billing/avs_result.rb +9 -9
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +49 -17
- data/lib/active_merchant/billing/compatibility.rb +5 -4
- data/lib/active_merchant/billing/credit_card.rb +55 -8
- data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +209 -36
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +38 -36
- data/lib/active_merchant/billing/gateways/adyen.rb +399 -78
- 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 +14 -14
- data/lib/active_merchant/billing/gateways/authorize_net.rb +200 -130
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +27 -20
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +48 -51
- data/lib/active_merchant/billing/gateways/axcessms.rb +13 -15
- data/lib/active_merchant/billing/gateways/balanced.rb +43 -36
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +16 -20
- data/lib/active_merchant/billing/gateways/bank_frick.rb +13 -13
- data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -30
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +5 -5
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +37 -36
- data/lib/active_merchant/billing/gateways/beanstream.rb +21 -3
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +53 -28
- data/lib/active_merchant/billing/gateways/blue_snap.rb +176 -54
- data/lib/active_merchant/billing/gateways/bogus.rb +24 -20
- data/lib/active_merchant/billing/gateways/borgun.rb +92 -38
- data/lib/active_merchant/billing/gateways/bpoint.rb +15 -15
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +8 -2
- 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 +387 -175
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +13 -13
- data/lib/active_merchant/billing/gateways/cams.rb +10 -10
- data/lib/active_merchant/billing/gateways/card_connect.rb +33 -14
- data/lib/active_merchant/billing/gateways/card_save.rb +3 -4
- data/lib/active_merchant/billing/gateways/card_stream.rb +67 -40
- data/lib/active_merchant/billing/gateways/cardknox.rb +13 -13
- data/lib/active_merchant/billing/gateways/cardprocess.rb +4 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +28 -12
- data/lib/active_merchant/billing/gateways/cc5.rb +9 -9
- data/lib/active_merchant/billing/gateways/cecabank.rb +38 -38
- data/lib/active_merchant/billing/gateways/cenpos.rb +29 -28
- data/lib/active_merchant/billing/gateways/checkout.rb +7 -9
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +316 -68
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -2
- data/lib/active_merchant/billing/gateways/clearhaus.rb +32 -33
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +370 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +8 -6
- data/lib/active_merchant/billing/gateways/creditcall.rb +18 -17
- data/lib/active_merchant/billing/gateways/credorax.rb +152 -63
- data/lib/active_merchant/billing/gateways/ct_payment.rb +15 -14
- data/lib/active_merchant/billing/gateways/culqi.rb +30 -28
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +496 -187
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +148 -31
- data/lib/active_merchant/billing/gateways/data_cash.rb +34 -37
- data/lib/active_merchant/billing/gateways/decidir.rb +134 -21
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +10 -10
- data/lib/active_merchant/billing/gateways/digitzs.rb +11 -8
- data/lib/active_merchant/billing/gateways/ebanx.rb +90 -40
- data/lib/active_merchant/billing/gateways/efsnet.rb +36 -36
- data/lib/active_merchant/billing/gateways/elavon.rb +349 -194
- data/lib/active_merchant/billing/gateways/element.rb +71 -21
- data/lib/active_merchant/billing/gateways/epay.rb +43 -43
- data/lib/active_merchant/billing/gateways/evo_ca.rb +12 -13
- data/lib/active_merchant/billing/gateways/eway.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway_managed.rb +55 -56
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +37 -22
- data/lib/active_merchant/billing/gateways/exact.rb +19 -20
- data/lib/active_merchant/billing/gateways/ezic.rb +9 -9
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -19
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -7
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +5 -4
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +39 -38
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +51 -31
- data/lib/active_merchant/billing/gateways/flo2cash.rb +24 -24
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +38 -22
- data/lib/active_merchant/billing/gateways/garanti.rb +12 -15
- data/lib/active_merchant/billing/gateways/global_collect.rb +333 -89
- data/lib/active_merchant/billing/gateways/global_transport.rb +8 -9
- data/lib/active_merchant/billing/gateways/hdfc.rb +22 -23
- data/lib/active_merchant/billing/gateways/hps.rb +171 -50
- data/lib/active_merchant/billing/gateways/iats_payments.rb +47 -25
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +22 -27
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -8
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +9 -9
- data/lib/active_merchant/billing/gateways/iridium.rb +30 -31
- data/lib/active_merchant/billing/gateways/itransact.rb +11 -10
- data/lib/active_merchant/billing/gateways/iveri.rb +62 -23
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +10 -17
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +13 -18
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +100 -22
- data/lib/active_merchant/billing/gateways/latitude19.rb +20 -19
- data/lib/active_merchant/billing/gateways/linkpoint.rb +71 -72
- data/lib/active_merchant/billing/gateways/litle.rb +181 -45
- data/lib/active_merchant/billing/gateways/mastercard.rb +16 -22
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +89 -18
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +58 -24
- data/lib/active_merchant/billing/gateways/merchant_one.rb +7 -10
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +19 -19
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +18 -22
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +15 -17
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +46 -8
- data/lib/active_merchant/billing/gateways/mercury.rb +19 -23
- data/lib/active_merchant/billing/gateways/metrics_global.rb +24 -33
- data/lib/active_merchant/billing/gateways/micropayment.rb +11 -12
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +18 -21
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +10 -12
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +236 -150
- data/lib/active_merchant/billing/gateways/moneris.rb +122 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -7
- data/lib/active_merchant/billing/gateways/mundipagg.rb +69 -23
- data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -20
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +10 -12
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -9
- data/lib/active_merchant/billing/gateways/netaxept.rb +12 -12
- data/lib/active_merchant/billing/gateways/netbanx.rb +128 -46
- data/lib/active_merchant/billing/gateways/netbilling.rb +18 -21
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -4
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -10
- data/lib/active_merchant/billing/gateways/nmi.rb +69 -27
- data/lib/active_merchant/billing/gateways/ogone.rb +62 -31
- data/lib/active_merchant/billing/gateways/omise.rb +15 -16
- data/lib/active_merchant/billing/gateways/openpay.rb +33 -15
- data/lib/active_merchant/billing/gateways/opp.rb +39 -33
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -42
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +623 -362
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +20 -20
- data/lib/active_merchant/billing/gateways/pagarme.rb +16 -23
- data/lib/active_merchant/billing/gateways/pago_facil.rb +4 -6
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +17 -17
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -33
- data/lib/active_merchant/billing/gateways/pay_hub.rb +10 -10
- data/lib/active_merchant/billing/gateways/pay_junction.rb +31 -31
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +36 -18
- data/lib/active_merchant/billing/gateways/pay_secure.rb +10 -11
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +64 -40
- data/lib/active_merchant/billing/gateways/payeezy.rb +130 -27
- data/lib/active_merchant/billing/gateways/payex.rb +24 -25
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +17 -17
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +103 -25
- data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +22 -18
- data/lib/active_merchant/billing/gateways/paymentez.rb +89 -24
- data/lib/active_merchant/billing/gateways/paymill.rb +14 -16
- 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 +13 -5
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -1
- 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 +8 -9
- data/lib/active_merchant/billing/gateways/paystation.rb +6 -9
- data/lib/active_merchant/billing/gateways/payu_in.rb +20 -19
- data/lib/active_merchant/billing/gateways/payu_latam.rb +70 -37
- data/lib/active_merchant/billing/gateways/payway.rb +22 -22
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +60 -21
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +20 -21
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +13 -14
- data/lib/active_merchant/billing/gateways/psigate.rb +29 -29
- data/lib/active_merchant/billing/gateways/psl_card.rb +7 -8
- data/lib/active_merchant/billing/gateways/qbms.rb +25 -26
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -11
- data/lib/active_merchant/billing/gateways/quickbooks.rb +126 -39
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +98 -98
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +19 -23
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay.rb +0 -1
- data/lib/active_merchant/billing/gateways/qvalent.rb +36 -20
- 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 +42 -16
- data/lib/active_merchant/billing/gateways/redsys.rb +191 -86
- data/lib/active_merchant/billing/gateways/s5.rb +10 -9
- data/lib/active_merchant/billing/gateways/safe_charge.rb +70 -33
- data/lib/active_merchant/billing/gateways/sage.rb +19 -21
- data/lib/active_merchant/billing/gateways/sage_pay.rb +57 -57
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +3 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -26
- data/lib/active_merchant/billing/gateways/secure_pay.rb +24 -33
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +18 -20
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +4 -5
- data/lib/active_merchant/billing/gateways/securion_pay.rb +48 -7
- 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 +19 -19
- data/lib/active_merchant/billing/gateways/smart_ps.rb +26 -32
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +24 -25
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +27 -21
- data/lib/active_merchant/billing/gateways/stripe.rb +126 -53
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +441 -113
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +7 -8
- data/lib/active_merchant/billing/gateways/telr.rb +17 -18
- data/lib/active_merchant/billing/gateways/tns.rb +3 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +10 -9
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +28 -24
- data/lib/active_merchant/billing/gateways/transact_pro.rb +13 -15
- data/lib/active_merchant/billing/gateways/transax.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +57 -47
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +176 -184
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +60 -48
- data/lib/active_merchant/billing/gateways/vanco.rb +17 -8
- data/lib/active_merchant/billing/gateways/verifi.rb +13 -14
- data/lib/active_merchant/billing/gateways/viaklix.rb +9 -14
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +26 -21
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +4 -4
- data/lib/active_merchant/billing/gateways/wepay.rb +14 -16
- data/lib/active_merchant/billing/gateways/wirecard.rb +14 -16
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +36 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +556 -190
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +47 -54
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +16 -16
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +2 -2
- data/lib/active_merchant/billing/response.rb +25 -6
- 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 +14 -15
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +15 -17
- data/lib/active_merchant/post_data.rb +3 -2
- data/lib/active_merchant/posts_data.rb +2 -2
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +2 -2
- data/lib/certs/cacert.pem +1587 -2361
- data/lib/support/gateway_support.rb +1 -1
- data/lib/support/ssl_verify.rb +3 -7
- data/lib/support/ssl_version.rb +2 -3
- metadata +86 -34
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -9,16 +9,16 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
|
10
10
|
self.live_url = 'https://gateway.itstgate.com/SmartPayments/transact3.asmx'
|
11
11
|
|
12
|
-
self.supported_countries = [
|
12
|
+
self.supported_countries = %w[CA US]
|
13
13
|
self.default_currency = 'USD'
|
14
|
-
self.supported_cardtypes = [
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
15
15
|
|
16
|
-
def initialize(options={})
|
16
|
+
def initialize(options = {})
|
17
17
|
requires!(options, :user_name, :password)
|
18
18
|
super
|
19
19
|
end
|
20
20
|
|
21
|
-
def purchase(amount, payment_method, options={})
|
21
|
+
def purchase(amount, payment_method, options = {})
|
22
22
|
post = initialize_required_fields('Sale')
|
23
23
|
|
24
24
|
# Allow the same amount in multiple transactions.
|
@@ -30,7 +30,7 @@ module ActiveMerchant #:nodoc:
|
|
30
30
|
commit(post)
|
31
31
|
end
|
32
32
|
|
33
|
-
def authorize(amount, payment_method, options={})
|
33
|
+
def authorize(amount, payment_method, options = {})
|
34
34
|
post = initialize_required_fields('Auth')
|
35
35
|
|
36
36
|
add_invoice(post, amount, options)
|
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
|
|
40
40
|
commit(post)
|
41
41
|
end
|
42
42
|
|
43
|
-
def capture(amount, authorization, options={})
|
43
|
+
def capture(amount, authorization, options = {})
|
44
44
|
post = initialize_required_fields('Force')
|
45
45
|
|
46
46
|
add_invoice(post, amount, options)
|
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
|
|
50
50
|
commit(post)
|
51
51
|
end
|
52
52
|
|
53
|
-
def refund(amount, authorization, options={})
|
53
|
+
def refund(amount, authorization, options = {})
|
54
54
|
post = initialize_required_fields('Return')
|
55
55
|
|
56
56
|
add_invoice(post, amount, options)
|
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
|
|
59
59
|
commit(post)
|
60
60
|
end
|
61
61
|
|
62
|
-
def void(authorization, options={})
|
62
|
+
def void(authorization, options = {})
|
63
63
|
post = initialize_required_fields('Void')
|
64
64
|
|
65
65
|
add_reference(post, authorization)
|
@@ -74,10 +74,10 @@ module ActiveMerchant #:nodoc:
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
def store(creditcard, options={})
|
77
|
+
def store(creditcard, options = {})
|
78
78
|
post = initialize_required_fields('')
|
79
79
|
post[:transaction] = 'Create'
|
80
|
-
post[:CardNumber]
|
80
|
+
post[:CardNumber] = creditcard.number
|
81
81
|
post[:CustomerPaymentInfoKey] = ''
|
82
82
|
post[:token] = ''
|
83
83
|
add_payment_method(post, creditcard)
|
@@ -147,7 +147,7 @@ module ActiveMerchant #:nodoc:
|
|
147
147
|
end
|
148
148
|
|
149
149
|
def add_customer_data(post, options)
|
150
|
-
if(billing_address = (options[:billing_address] || options[:address]))
|
150
|
+
if (billing_address = (options[:billing_address] || options[:address]))
|
151
151
|
post[:Street] = billing_address[:address1]
|
152
152
|
post[:Zip] = billing_address[:zip]
|
153
153
|
end
|
@@ -235,8 +235,8 @@ module ActiveMerchant #:nodoc:
|
|
235
235
|
|
236
236
|
def post_data(post)
|
237
237
|
{
|
238
|
-
:
|
239
|
-
:
|
238
|
+
UserName: @options[:user_name],
|
239
|
+
Password: @options[:password]
|
240
240
|
}.merge(post).collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
|
241
241
|
end
|
242
242
|
end
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
|
6
6
|
self.supported_countries = ['US']
|
7
7
|
self.default_currency = 'USD'
|
8
|
-
self.supported_cardtypes = [
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
9
9
|
|
10
10
|
self.homepage_url = 'https://www.centralams.com/'
|
11
11
|
self.display_name = 'CAMS: Central Account Management System'
|
@@ -67,12 +67,12 @@ module ActiveMerchant #:nodoc:
|
|
67
67
|
'894' => STANDARD_ERROR_CODE[:processing_error]
|
68
68
|
}
|
69
69
|
|
70
|
-
def initialize(options={})
|
70
|
+
def initialize(options = {})
|
71
71
|
requires!(options, :username, :password)
|
72
72
|
super
|
73
73
|
end
|
74
74
|
|
75
|
-
def purchase(money, payment, options={})
|
75
|
+
def purchase(money, payment, options = {})
|
76
76
|
post = {}
|
77
77
|
add_invoice(post, money, options)
|
78
78
|
|
@@ -86,7 +86,7 @@ module ActiveMerchant #:nodoc:
|
|
86
86
|
commit('sale', post)
|
87
87
|
end
|
88
88
|
|
89
|
-
def authorize(money, payment, options={})
|
89
|
+
def authorize(money, payment, options = {})
|
90
90
|
post = {}
|
91
91
|
add_invoice(post, money, options)
|
92
92
|
add_payment(post, payment)
|
@@ -95,7 +95,7 @@ module ActiveMerchant #:nodoc:
|
|
95
95
|
commit('auth', post)
|
96
96
|
end
|
97
97
|
|
98
|
-
def capture(money, authorization, options={})
|
98
|
+
def capture(money, authorization, options = {})
|
99
99
|
post = {}
|
100
100
|
add_reference(post, authorization)
|
101
101
|
add_invoice(post, money, options)
|
@@ -103,20 +103,20 @@ module ActiveMerchant #:nodoc:
|
|
103
103
|
commit('capture', post)
|
104
104
|
end
|
105
105
|
|
106
|
-
def refund(money, authorization, options={})
|
106
|
+
def refund(money, authorization, options = {})
|
107
107
|
post = {}
|
108
108
|
add_reference(post, authorization)
|
109
109
|
add_invoice(post, money, options)
|
110
110
|
commit('refund', post)
|
111
111
|
end
|
112
112
|
|
113
|
-
def void(authorization, options={})
|
113
|
+
def void(authorization, options = {})
|
114
114
|
post = {}
|
115
115
|
add_reference(post, authorization)
|
116
116
|
commit('void', post)
|
117
117
|
end
|
118
118
|
|
119
|
-
def verify(credit_card, options={})
|
119
|
+
def verify(credit_card, options = {})
|
120
120
|
post = {}
|
121
121
|
add_invoice(post, 0, options)
|
122
122
|
add_payment(post, credit_card)
|
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
|
|
138
138
|
|
139
139
|
private
|
140
140
|
|
141
|
-
def add_address(post, creditcard, options={})
|
141
|
+
def add_address(post, creditcard, options = {})
|
142
142
|
post[:firstname] = creditcard.first_name
|
143
143
|
post[:lastname] = creditcard.last_name
|
144
144
|
|
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
|
|
167
167
|
|
168
168
|
def add_payment(post, payment)
|
169
169
|
post[:ccnumber] = payment.number
|
170
|
-
post[:ccexp] = "#{payment.month.to_s.rjust(2,
|
170
|
+
post[:ccexp] = "#{payment.month.to_s.rjust(2, '0')}#{payment.year.to_s[-2..-1]}"
|
171
171
|
post[:cvv] = payment.verification_value
|
172
172
|
end
|
173
173
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class CardConnectGateway < Gateway
|
4
|
-
self.test_url = 'https://fts.cardconnect.com
|
5
|
-
self.live_url = 'https://fts.cardconnect.com
|
4
|
+
self.test_url = 'https://fts-uat.cardconnect.com/cardconnect/rest/'
|
5
|
+
self.live_url = 'https://fts.cardconnect.com/cardconnect/rest/'
|
6
6
|
|
7
7
|
self.supported_countries = ['US']
|
8
8
|
self.default_currency = 'USD'
|
9
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
10
10
|
|
11
11
|
self.homepage_url = 'https://cardconnect.com/'
|
12
12
|
self.display_name = 'Card Connect'
|
@@ -61,6 +61,8 @@ module ActiveMerchant #:nodoc:
|
|
61
61
|
'60' => STANDARD_ERROR_CODE[:pickup_card]
|
62
62
|
}
|
63
63
|
|
64
|
+
SCHEDULED_PAYMENT_TYPES = %w(recurring installment)
|
65
|
+
|
64
66
|
def initialize(options = {})
|
65
67
|
requires!(options, :merchant_id, :username, :password)
|
66
68
|
require_valid_domain!(options, :domain)
|
@@ -69,7 +71,7 @@ module ActiveMerchant #:nodoc:
|
|
69
71
|
|
70
72
|
def require_valid_domain!(options, param)
|
71
73
|
if options[param]
|
72
|
-
raise ArgumentError.new('not a valid cardconnect domain') unless
|
74
|
+
raise ArgumentError.new('not a valid cardconnect domain') unless /https:\/\/\D*cardconnect.com/ =~ options[param]
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
@@ -87,8 +89,9 @@ module ActiveMerchant #:nodoc:
|
|
87
89
|
add_currency(post, money, options)
|
88
90
|
add_address(post, options)
|
89
91
|
add_customer_data(post, options)
|
90
|
-
|
92
|
+
add_three_ds_mpi_data(post, options)
|
91
93
|
add_additional_data(post, options)
|
94
|
+
add_stored_credential(post, options)
|
92
95
|
post[:capture] = 'Y'
|
93
96
|
commit('auth', post)
|
94
97
|
end
|
@@ -102,8 +105,9 @@ module ActiveMerchant #:nodoc:
|
|
102
105
|
add_payment(post, payment)
|
103
106
|
add_address(post, options)
|
104
107
|
add_customer_data(post, options)
|
105
|
-
|
108
|
+
add_three_ds_mpi_data(post, options)
|
106
109
|
add_additional_data(post, options)
|
110
|
+
add_stored_credential(post, options)
|
107
111
|
commit('auth', post)
|
108
112
|
end
|
109
113
|
|
@@ -169,7 +173,7 @@ module ActiveMerchant #:nodoc:
|
|
169
173
|
def add_address(post, options)
|
170
174
|
if address = options[:billing_address] || options[:address]
|
171
175
|
post[:address] = address[:address1] if address[:address1]
|
172
|
-
post[:
|
176
|
+
post[:address2] = address[:address2] if address[:address2]
|
173
177
|
post[:city] = address[:city] if address[:city]
|
174
178
|
post[:region] = address[:state] if address[:state]
|
175
179
|
post[:country] = address[:country] if address[:country]
|
@@ -188,7 +192,11 @@ module ActiveMerchant #:nodoc:
|
|
188
192
|
|
189
193
|
def add_invoice(post, options)
|
190
194
|
post[:orderid] = options[:order_id]
|
191
|
-
post[:ecomind] =
|
195
|
+
post[:ecomind] = if options[:ecomind]
|
196
|
+
options[:ecomind].capitalize
|
197
|
+
else
|
198
|
+
(options[:recurring] ? 'R' : 'E')
|
199
|
+
end
|
192
200
|
end
|
193
201
|
|
194
202
|
def add_payment(post, payment)
|
@@ -233,7 +241,7 @@ module ActiveMerchant #:nodoc:
|
|
233
241
|
post[:items] = options[:items].map do |item|
|
234
242
|
updated = {}
|
235
243
|
item.each_pair do |k, v|
|
236
|
-
updated.merge!(k.to_s.
|
244
|
+
updated.merge!(k.to_s.delete('_') => v)
|
237
245
|
end
|
238
246
|
updated
|
239
247
|
end
|
@@ -241,10 +249,20 @@ module ActiveMerchant #:nodoc:
|
|
241
249
|
post[:userfields] = options[:user_fields] if options[:user_fields]
|
242
250
|
end
|
243
251
|
|
244
|
-
def
|
245
|
-
|
246
|
-
|
247
|
-
post[:
|
252
|
+
def add_three_ds_mpi_data(post, options)
|
253
|
+
return unless three_d_secure = options[:three_d_secure]
|
254
|
+
|
255
|
+
post[:secureflag] = three_d_secure[:eci]
|
256
|
+
post[:securevalue] = three_d_secure[:cavv]
|
257
|
+
post[:securedstid] = three_d_secure[:ds_transaction_id]
|
258
|
+
end
|
259
|
+
|
260
|
+
def add_stored_credential(post, options)
|
261
|
+
return unless stored_credential = options[:stored_credential]
|
262
|
+
|
263
|
+
post[:cof] = stored_credential[:initiator] == 'merchant' ? 'M' : 'C'
|
264
|
+
post[:cofscheduled] = SCHEDULED_PAYMENT_TYPES.include?(stored_credential[:reason_type]) ? 'Y' : 'N'
|
265
|
+
post[:cofpermission] = stored_credential[:initial_transaction] ? 'Y' : 'N'
|
248
266
|
end
|
249
267
|
|
250
268
|
def headers
|
@@ -287,7 +305,8 @@ module ActiveMerchant #:nodoc:
|
|
287
305
|
error_code: error_code_from(response)
|
288
306
|
)
|
289
307
|
rescue ResponseError => e
|
290
|
-
return Response.new(false, 'Unable to authenticate. Please check your credentials.', {}, :
|
308
|
+
return Response.new(false, 'Unable to authenticate. Please check your credentials.', {}, test: test?) if e.response.code == '401'
|
309
|
+
|
291
310
|
raise
|
292
311
|
end
|
293
312
|
|
@@ -6,17 +6,16 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
|
7
7
|
self.money_format = :cents
|
8
8
|
self.default_currency = 'GBP'
|
9
|
-
self.supported_cardtypes = [
|
10
|
-
self.supported_countries = [
|
9
|
+
self.supported_cardtypes = %i[visa maestro master american_express jcb]
|
10
|
+
self.supported_countries = ['GB']
|
11
11
|
self.homepage_url = 'http://www.cardsave.net/'
|
12
12
|
self.display_name = 'CardSave'
|
13
13
|
|
14
|
-
def initialize(options={})
|
14
|
+
def initialize(options = {})
|
15
15
|
super
|
16
16
|
@test_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
|
17
17
|
@live_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
|
18
18
|
end
|
19
|
-
|
20
19
|
end
|
21
20
|
end
|
22
21
|
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class CardStreamGateway < Gateway
|
4
|
-
|
5
4
|
THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE = 'Specifying the :threeDSRequired initialization option is deprecated. Please use the `:threeds_required => true` *transaction* option instead.'
|
6
5
|
|
7
6
|
self.test_url = self.live_url = 'https://gateway.cardstream.com/direct/'
|
8
7
|
self.money_format = :cents
|
9
8
|
self.default_currency = 'GBP'
|
10
|
-
self.
|
11
|
-
self.
|
9
|
+
self.currencies_without_fractions = %w(CVE ISK JPY UGX)
|
10
|
+
self.supported_countries = %w[GB US CH SE SG NO JP IS HK NL CZ CA AU]
|
11
|
+
self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
|
12
12
|
self.homepage_url = 'http://www.cardstream.com/'
|
13
13
|
self.display_name = 'CardStream'
|
14
14
|
|
@@ -150,30 +150,20 @@ module ActiveMerchant #:nodoc:
|
|
150
150
|
|
151
151
|
def authorize(money, credit_card_or_reference, options = {})
|
152
152
|
post = {}
|
153
|
-
|
154
|
-
add_amount(post, money, options)
|
155
|
-
add_invoice(post, credit_card_or_reference, money, options)
|
156
|
-
add_credit_card_or_reference(post, credit_card_or_reference)
|
157
|
-
add_customer_data(post, options)
|
158
|
-
add_remote_address(post, options)
|
153
|
+
add_auth_purchase(post, -1, money, credit_card_or_reference, options)
|
159
154
|
commit('SALE', post)
|
160
155
|
end
|
161
156
|
|
162
157
|
def purchase(money, credit_card_or_reference, options = {})
|
163
158
|
post = {}
|
164
|
-
|
165
|
-
add_amount(post, money, options)
|
166
|
-
add_invoice(post, credit_card_or_reference, money, options)
|
167
|
-
add_credit_card_or_reference(post, credit_card_or_reference)
|
168
|
-
add_customer_data(post, options)
|
169
|
-
add_remote_address(post, options)
|
159
|
+
add_auth_purchase(post, 0, money, credit_card_or_reference, options)
|
170
160
|
commit('SALE', post)
|
171
161
|
end
|
172
162
|
|
173
163
|
def capture(money, authorization, options = {})
|
174
164
|
post = {}
|
175
165
|
add_pair(post, :xref, authorization)
|
176
|
-
add_pair(post, :amount,
|
166
|
+
add_pair(post, :amount, localized_amount(money, options[:currency] || currency(money)), required: true)
|
177
167
|
add_remote_address(post, options)
|
178
168
|
|
179
169
|
commit('CAPTURE', post)
|
@@ -184,6 +174,7 @@ module ActiveMerchant #:nodoc:
|
|
184
174
|
add_pair(post, :xref, authorization)
|
185
175
|
add_amount(post, money, options)
|
186
176
|
add_remote_address(post, options)
|
177
|
+
add_country_code(post, options)
|
187
178
|
response = commit('REFUND_SALE', post)
|
188
179
|
|
189
180
|
return response if response.success?
|
@@ -203,7 +194,7 @@ module ActiveMerchant #:nodoc:
|
|
203
194
|
commit('CANCEL', post)
|
204
195
|
end
|
205
196
|
|
206
|
-
def verify(creditcard, options={})
|
197
|
+
def verify(creditcard, options = {})
|
207
198
|
MultiResponse.run(:use_first_response) do |r|
|
208
199
|
r.process { authorize(100, creditcard, options) }
|
209
200
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -223,9 +214,21 @@ module ActiveMerchant #:nodoc:
|
|
223
214
|
|
224
215
|
private
|
225
216
|
|
217
|
+
def add_auth_purchase(post, pair_value, money, credit_card_or_reference, options)
|
218
|
+
add_pair(post, :captureDelay, pair_value)
|
219
|
+
add_amount(post, money, options)
|
220
|
+
add_invoice(post, credit_card_or_reference, money, options)
|
221
|
+
add_credit_card_or_reference(post, credit_card_or_reference)
|
222
|
+
add_customer_data(post, options)
|
223
|
+
add_remote_address(post, options)
|
224
|
+
add_country_code(post, options)
|
225
|
+
add_threeds_fields(post, options)
|
226
|
+
end
|
227
|
+
|
226
228
|
def add_amount(post, money, options)
|
227
|
-
|
228
|
-
add_pair(post, :
|
229
|
+
currency = options[:currency] || currency(money)
|
230
|
+
add_pair(post, :amount, localized_amount(money, currency), required: true)
|
231
|
+
add_pair(post, :currencyCode, currency_code(currency))
|
229
232
|
end
|
230
233
|
|
231
234
|
def add_customer_data(post, options)
|
@@ -241,15 +244,15 @@ module ActiveMerchant #:nodoc:
|
|
241
244
|
end
|
242
245
|
|
243
246
|
def add_invoice(post, credit_card_or_reference, money, options)
|
244
|
-
add_pair(post, :transactionUnique, options[:order_id], :
|
245
|
-
add_pair(post, :orderRef, options[:description] || options[:order_id], :
|
247
|
+
add_pair(post, :transactionUnique, options[:order_id], required: true)
|
248
|
+
add_pair(post, :orderRef, options[:description] || options[:order_id], required: true)
|
246
249
|
add_pair(post, :statementNarrative1, options[:merchant_name]) if options[:merchant_name]
|
247
250
|
add_pair(post, :statementNarrative2, options[:dynamic_descriptor]) if options[:dynamic_descriptor]
|
248
251
|
if credit_card_or_reference.respond_to?(:number)
|
249
|
-
if [
|
252
|
+
if %w[american_express diners_club].include?(card_brand(credit_card_or_reference).to_s)
|
250
253
|
add_pair(post, :item1Quantity, 1)
|
251
254
|
add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15))
|
252
|
-
add_pair(post, :item1GrossValue,
|
255
|
+
add_pair(post, :item1GrossValue, localized_amount(money, options[:currency] || currency(money)))
|
253
256
|
end
|
254
257
|
end
|
255
258
|
|
@@ -266,14 +269,14 @@ module ActiveMerchant #:nodoc:
|
|
266
269
|
end
|
267
270
|
|
268
271
|
def add_reference(post, reference)
|
269
|
-
add_pair(post, :xref, reference, :
|
272
|
+
add_pair(post, :xref, reference, required: true)
|
270
273
|
end
|
271
274
|
|
272
275
|
def add_credit_card(post, credit_card)
|
273
|
-
add_pair(post, :customerName, credit_card.name, :
|
274
|
-
add_pair(post, :cardNumber, credit_card.number, :
|
275
|
-
add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), :
|
276
|
-
add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), :
|
276
|
+
add_pair(post, :customerName, credit_card.name, required: true)
|
277
|
+
add_pair(post, :cardNumber, credit_card.number, required: true)
|
278
|
+
add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), required: true)
|
279
|
+
add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), required: true)
|
277
280
|
add_pair(post, :cardCVV, credit_card.verification_value)
|
278
281
|
end
|
279
282
|
|
@@ -281,10 +284,28 @@ module ActiveMerchant #:nodoc:
|
|
281
284
|
add_pair(post, :threeDSRequired, options[:threeds_required] || @threeds_required ? 'Y' : 'N')
|
282
285
|
end
|
283
286
|
|
284
|
-
def
|
287
|
+
def add_threeds_fields(post, options)
|
288
|
+
return unless three_d_secure = options[:three_d_secure]
|
289
|
+
|
290
|
+
add_pair(post, :threeDSEnrolled, formatted_enrollment(three_d_secure[:enrolled]))
|
291
|
+
if three_d_secure[:enrolled] == 'true'
|
292
|
+
add_pair(post, :threeDSAuthenticated, three_d_secure[:authentication_response_status])
|
293
|
+
if three_d_secure[:authentication_response_status] == 'Y'
|
294
|
+
post[:threeDSECI] = three_d_secure[:eci]
|
295
|
+
post[:threeDSCAVV] = three_d_secure[:cavv]
|
296
|
+
post[:threeDSXID] = three_d_secure[:xid] || three_d_secure[:ds_transaction_id]
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def add_remote_address(post, options = {})
|
285
302
|
add_pair(post, :remoteAddress, options[:ip] || '1.1.1.1')
|
286
303
|
end
|
287
304
|
|
305
|
+
def add_country_code(post, options)
|
306
|
+
post[:countryCode] = options[:country_code] || self.supported_countries[0]
|
307
|
+
end
|
308
|
+
|
288
309
|
def normalize_line_endings(str)
|
289
310
|
str.gsub(/%0D%0A|%0A%0D|%0D/, '%0A')
|
290
311
|
end
|
@@ -308,10 +329,9 @@ module ActiveMerchant #:nodoc:
|
|
308
329
|
end
|
309
330
|
|
310
331
|
def commit(action, parameters)
|
311
|
-
parameters.update(:countryCode => self.supported_countries[0]) unless ['CAPTURE', 'CANCEL'].include?(action)
|
312
332
|
parameters.update(
|
313
|
-
:
|
314
|
-
:
|
333
|
+
merchantID: @options[:login],
|
334
|
+
action: action
|
315
335
|
)
|
316
336
|
# adds a signature to the post hash/array
|
317
337
|
add_hmac(parameters)
|
@@ -322,10 +342,10 @@ module ActiveMerchant #:nodoc:
|
|
322
342
|
response[:responseCode] == '0',
|
323
343
|
response[:responseCode] == '0' ? 'APPROVED' : response[:responseMessage],
|
324
344
|
response,
|
325
|
-
:
|
326
|
-
:
|
327
|
-
:
|
328
|
-
:
|
345
|
+
test: test?,
|
346
|
+
authorization: response[:xref],
|
347
|
+
cvv_result: CVV_CODE[response[:avscv2ResponseCode].to_s[0, 1]],
|
348
|
+
avs_result: avs_from(response)
|
329
349
|
)
|
330
350
|
end
|
331
351
|
|
@@ -341,12 +361,12 @@ module ActiveMerchant #:nodoc:
|
|
341
361
|
'A'
|
342
362
|
else
|
343
363
|
'I'
|
344
|
-
|
364
|
+
end
|
345
365
|
|
346
366
|
AVSResult.new({
|
347
|
-
:
|
348
|
-
:
|
349
|
-
:
|
367
|
+
code: code,
|
368
|
+
postal_match: postal_match,
|
369
|
+
street_match: street_match
|
350
370
|
})
|
351
371
|
end
|
352
372
|
|
@@ -362,6 +382,13 @@ module ActiveMerchant #:nodoc:
|
|
362
382
|
post[key] = value if !value.blank? || options[:required]
|
363
383
|
end
|
364
384
|
|
385
|
+
def formatted_enrollment(val)
|
386
|
+
case val
|
387
|
+
when 'Y', 'N', 'U' then val
|
388
|
+
when true, 'true' then 'Y'
|
389
|
+
when false, 'false' then 'N'
|
390
|
+
end
|
391
|
+
end
|
365
392
|
end
|
366
393
|
end
|
367
394
|
end
|
@@ -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,7 +79,7 @@ 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
84
|
r.process { authorize(100, credit_card, options) }
|
85
85
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
|
|
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
|
|
@@ -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
|
@@ -276,7 +276,7 @@ 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
282
|
def commit(action, source_type, parameters)
|
@@ -312,7 +312,7 @@ module ActiveMerchant #:nodoc:
|
|
312
312
|
Version: '4.5.4',
|
313
313
|
SoftwareName: 'Active Merchant',
|
314
314
|
SoftwareVersion: ActiveMerchant::VERSION.to_s,
|
315
|
-
Command: command
|
315
|
+
Command: command
|
316
316
|
}
|
317
317
|
|
318
318
|
seed = SecureRandom.hex(32).upcase
|
@@ -320,7 +320,7 @@ module ActiveMerchant #:nodoc:
|
|
320
320
|
initial_parameters[:Hash] = "s/#{seed}/#{hash}/n" unless @options[:pin].blank?
|
321
321
|
parameters = initial_parameters.merge(parameters)
|
322
322
|
|
323
|
-
parameters.reject { |
|
323
|
+
parameters.reject { |_k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
324
324
|
end
|
325
325
|
end
|
326
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;
|
@@ -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
|