activemerchant 1.108.0 → 1.109.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +28 -0
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +1 -1
- data/lib/active_merchant/billing/credit_card.rb +2 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
- data/lib/active_merchant/billing/gateways/adyen.rb +8 -8
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
- data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
- data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
- data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +78 -28
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/cams.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
- data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
- data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
- data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +3 -3
- data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
- data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
- data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
- data/lib/active_merchant/billing/gateways/credorax.rb +6 -2
- data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
- data/lib/active_merchant/billing/gateways/cyber_source.rb +13 -4
- data/lib/active_merchant/billing/gateways/d_local.rb +7 -3
- data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
- data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
- data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +4 -4
- data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
- data/lib/active_merchant/billing/gateways/elavon.rb +1 -1
- data/lib/active_merchant/billing/gateways/element.rb +3 -3
- data/lib/active_merchant/billing/gateways/epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
- data/lib/active_merchant/billing/gateways/exact.rb +3 -3
- data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +4 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +3 -3
- data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
- data/lib/active_merchant/billing/gateways/forte.rb +2 -2
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/global_collect.rb +5 -5
- data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
- data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
- data/lib/active_merchant/billing/gateways/hps.rb +1 -1
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
- data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
- data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
- data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
- data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
- data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
- data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/litle.rb +4 -4
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +11 -6
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
- data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
- data/lib/active_merchant/billing/gateways/monei.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +2 -2
- data/lib/active_merchant/billing/gateways/netbanx.rb +46 -22
- data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
- data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
- data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
- data/lib/active_merchant/billing/gateways/omise.rb +1 -1
- data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/opp.rb +1 -1
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
- data/lib/active_merchant/billing/gateways/orbital.rb +6 -6
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
- data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
- data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
- data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
- data/lib/active_merchant/billing/gateways/payex.rb +13 -13
- data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +6 -7
- data/lib/active_merchant/billing/gateways/payway.rb +1 -1
- data/lib/active_merchant/billing/gateways/pin.rb +1 -1
- data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
- data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
- data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
- data/lib/active_merchant/billing/gateways/realex.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +4 -4
- data/lib/active_merchant/billing/gateways/s5.rb +1 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
- data/lib/active_merchant/billing/gateways/sage.rb +3 -3
- data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +6 -6
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +20 -1
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/telr.rb +4 -4
- data/lib/active_merchant/billing/gateways/tns.rb +1 -1
- data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -1
- data/lib/active_merchant/billing/gateways/transax.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +1 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
- data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
- data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
- data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
- data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +6 -6
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/gateway_support.rb +1 -1
- metadata +35 -35
@@ -3,8 +3,8 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
class MercadoPagoGateway < Gateway
|
4
4
|
self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
|
5
5
|
|
6
|
-
self.supported_countries = [
|
7
|
-
self.supported_cardtypes = [
|
6
|
+
self.supported_countries = %w[AR BR CL CO MX PE UY]
|
7
|
+
self.supported_cardtypes = %i[visa master american_express elo cabal naranja]
|
8
8
|
|
9
9
|
self.homepage_url = 'https://www.mercadopago.com/'
|
10
10
|
self.display_name = 'Mercado Pago'
|
@@ -33,7 +33,7 @@ module ActiveMerchant #:nodoc:
|
|
33
33
|
|
34
34
|
def capture(money, authorization, options={})
|
35
35
|
post = {}
|
36
|
-
authorization,
|
36
|
+
authorization, = authorization.split('|')
|
37
37
|
post[:capture] = true
|
38
38
|
post[:transaction_amount] = amount(money).to_f
|
39
39
|
commit('capture', "payments/#{authorization}", post)
|
@@ -47,7 +47,7 @@ module ActiveMerchant #:nodoc:
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def void(authorization, options={})
|
50
|
-
authorization,
|
50
|
+
authorization, = authorization.split('|')
|
51
51
|
post = { status: 'cancelled' }
|
52
52
|
commit('void', "payments/#{authorization}", post)
|
53
53
|
end
|
@@ -98,6 +98,7 @@ module ActiveMerchant #:nodoc:
|
|
98
98
|
add_processing_mode(post, options)
|
99
99
|
add_net_amount(post, options)
|
100
100
|
add_taxes(post, options)
|
101
|
+
add_notification_url(post, options)
|
101
102
|
post[:binary_mode] = (options[:binary_mode].nil? ? true : options[:binary_mode])
|
102
103
|
post
|
103
104
|
end
|
@@ -203,6 +204,10 @@ module ActiveMerchant #:nodoc:
|
|
203
204
|
post[:net_amount] = Float(options[:net_amount]) if options[:net_amount]
|
204
205
|
end
|
205
206
|
|
207
|
+
def add_notification_url(post, options)
|
208
|
+
post[:notification_url] = options[:notification_url] if options[:notification_url]
|
209
|
+
end
|
210
|
+
|
206
211
|
def add_taxes(post, options)
|
207
212
|
return unless (tax_object = options[:taxes])
|
208
213
|
|
@@ -251,7 +256,7 @@ module ActiveMerchant #:nodoc:
|
|
251
256
|
end
|
252
257
|
|
253
258
|
def commit(action, path, parameters)
|
254
|
-
if [
|
259
|
+
if %w[capture void].include?(action)
|
255
260
|
response = parse(ssl_request(:put, url(path), post_data(parameters), headers))
|
256
261
|
else
|
257
262
|
response = parse(ssl_post(url(path), post_data(parameters), headers(parameters)))
|
@@ -271,7 +276,7 @@ module ActiveMerchant #:nodoc:
|
|
271
276
|
if action == 'refund'
|
272
277
|
response['status'] != 404 && response['error'].nil?
|
273
278
|
else
|
274
|
-
[
|
279
|
+
%w[active approved authorized cancelled in_process].include?(response['status'])
|
275
280
|
end
|
276
281
|
end
|
277
282
|
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
10
10
|
self.supported_countries = ['US']
|
11
11
|
|
12
12
|
# The card types supported by the payment gateway
|
13
|
-
self.supported_cardtypes = [
|
13
|
+
self.supported_cardtypes = %i[visa master american_express discover jcb]
|
14
14
|
|
15
15
|
# The homepage URL of the gateway
|
16
16
|
self.homepage_url = 'http://www.merchante-solutions.com/'
|
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
BASE_URL = 'https://secure.merchantonegateway.com/api/transact.php'
|
14
14
|
|
15
15
|
self.supported_countries = ['US']
|
16
|
-
self.supported_cardtypes = [
|
16
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
17
17
|
self.homepage_url = 'http://merchantone.com/'
|
18
18
|
self.display_name = 'Merchant One Gateway'
|
19
19
|
self.money_format = :dollars
|
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
|
|
76
76
|
def add_creditcard(post, creditcard)
|
77
77
|
post['cvv'] = creditcard.verification_value
|
78
78
|
post['ccnumber'] = creditcard.number
|
79
|
-
post['ccexp'] = "#{sprintf(
|
79
|
+
post['ccexp'] = "#{sprintf('%02d', creditcard.month)}#{creditcard.year.to_s[-2, 2]}"
|
80
80
|
end
|
81
81
|
|
82
82
|
def commit(action, money, parameters={})
|
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
|
|
11
11
|
self.supported_countries = ['US']
|
12
12
|
self.default_currency = 'USD'
|
13
13
|
self.money_format = :dollars
|
14
|
-
self.supported_cardtypes = [
|
14
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
15
15
|
|
16
16
|
def initialize(options={})
|
17
17
|
requires!(options, :account_id, :merchant_pin)
|
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.v4_live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
8
8
|
|
9
9
|
self.supported_countries = ['US']
|
10
|
-
self.supported_cardtypes = [
|
10
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
11
11
|
self.homepage_url = 'http://merchantwarehouse.com/merchantware'
|
12
12
|
self.display_name = 'MerchantWARE'
|
13
13
|
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
self.test_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
6
6
|
|
7
7
|
self.supported_countries = ['US']
|
8
|
-
self.supported_cardtypes = [
|
8
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
9
9
|
self.homepage_url = 'http://merchantwarehouse.com/merchantware'
|
10
10
|
self.display_name = 'MerchantWARE'
|
11
11
|
|
@@ -11,8 +11,8 @@ module ActiveMerchant #:nodoc:
|
|
11
11
|
POST_LIVE_URL = 'https://api.merchantwarrior.com/post/'
|
12
12
|
|
13
13
|
self.supported_countries = ['AU']
|
14
|
-
self.supported_cardtypes = [
|
15
|
-
|
14
|
+
self.supported_cardtypes = %i[visa master american_express
|
15
|
+
diners_club discover jcb]
|
16
16
|
self.homepage_url = 'https://www.merchantwarrior.com/'
|
17
17
|
self.display_name = 'Merchant Warrior'
|
18
18
|
|
@@ -18,8 +18,8 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
|
19
19
|
self.homepage_url = 'http://www.mercurypay.com'
|
20
20
|
self.display_name = 'Mercury'
|
21
|
-
self.supported_countries = [
|
22
|
-
self.supported_cardtypes = [
|
21
|
+
self.supported_countries = %w[US CA]
|
22
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
23
23
|
self.default_currency = 'USD'
|
24
24
|
|
25
25
|
STANDARD_ERROR_CODE_MAPPING = {
|
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
|
|
103
103
|
xml.tag! 'Transaction' do
|
104
104
|
xml.tag! 'TranType', 'Credit'
|
105
105
|
xml.tag! 'TranCode', action
|
106
|
-
xml.tag! 'PartialAuth', 'Allow' if options[:allow_partial_auth] && [
|
106
|
+
xml.tag! 'PartialAuth', 'Allow' if options[:allow_partial_auth] && %w[PreAuth Sale].include?(action)
|
107
107
|
add_invoice(xml, options[:order_id], nil, options)
|
108
108
|
add_reference(xml, 'RecordNumberRequested')
|
109
109
|
add_customer_data(xml, options)
|
@@ -294,7 +294,7 @@ module ActiveMerchant #:nodoc:
|
|
294
294
|
}
|
295
295
|
end
|
296
296
|
|
297
|
-
SUCCESS_CODES = [
|
297
|
+
SUCCESS_CODES = %w[Approved Success]
|
298
298
|
|
299
299
|
def commit(action, request)
|
300
300
|
response = parse(action, ssl_post(endpoint_url, build_soap_request(request), build_header))
|
@@ -31,7 +31,7 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
AVS_RESULT_CODE, TRANSACTION_ID, CARD_CODE_RESPONSE_CODE = 5, 6, 38
|
32
32
|
|
33
33
|
self.supported_countries = ['US']
|
34
|
-
self.supported_cardtypes = [
|
34
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
35
35
|
self.homepage_url = 'http://www.metricsglobal.com'
|
36
36
|
self.display_name = 'Metrics Global'
|
37
37
|
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
self.supported_countries = %w(DE)
|
10
10
|
self.default_currency = 'EUR'
|
11
11
|
self.money_format = :cents
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express]
|
13
13
|
|
14
14
|
def initialize(options={})
|
15
15
|
requires!(options, :access_key)
|
@@ -175,7 +175,7 @@ module ActiveMerchant #:nodoc:
|
|
175
175
|
|
176
176
|
def authorization_from(response, request_params)
|
177
177
|
session_id = response['sessionId'] || request_params[:sessionId]
|
178
|
-
"#{session_id}|#{response[
|
178
|
+
"#{session_id}|#{response['transactionId']}"
|
179
179
|
end
|
180
180
|
end
|
181
181
|
end
|
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
|
|
20
20
|
self.supported_countries = %w(AU AE BD BN EG HK ID JO KW LB LK MU MV MY NZ OM PH QA SA SG TT VN)
|
21
21
|
|
22
22
|
# The card types supported by the payment gateway
|
23
|
-
self.supported_cardtypes = [
|
23
|
+
self.supported_cardtypes = %i[visa master american_express diners_club jcb]
|
24
24
|
|
25
25
|
self.money_format = :cents
|
26
26
|
self.currencies_without_fractions = %w(IDR)
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
TEST_XMLNS = 'https://secure.modpay.com/netservices/test/'
|
9
9
|
|
10
10
|
self.supported_countries = ['US']
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
12
12
|
self.homepage_url = 'http://www.modpay.com'
|
13
13
|
self.display_name = 'Modern Payments'
|
14
14
|
|
@@ -14,9 +14,9 @@ module ActiveMerchant #:nodoc:
|
|
14
14
|
self.test_url = 'https://test.monei-api.net/payment/ctpe'
|
15
15
|
self.live_url = 'https://monei-api.net/payment/ctpe'
|
16
16
|
|
17
|
-
self.supported_countries = [
|
17
|
+
self.supported_countries = %w[AD AT BE BG CA CH CY CZ DE DK EE ES FI FO FR GB GI GR HU IE IL IS IT LI LT LU LV MT NL NO PL PT RO SE SI SK TR US VA]
|
18
18
|
self.default_currency = 'EUR'
|
19
|
-
self.supported_cardtypes = [
|
19
|
+
self.supported_cardtypes = %i[visa master maestro jcb american_express]
|
20
20
|
|
21
21
|
self.homepage_url = 'http://www.monei.net/'
|
22
22
|
self.display_name = 'Monei'
|
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
self.live_url = 'https://www3.moneris.com/gateway2/servlet/MpgRequest'
|
14
14
|
|
15
15
|
self.supported_countries = ['CA']
|
16
|
-
self.supported_cardtypes = [
|
16
|
+
self.supported_cardtypes = %i[visa master american_express diners_club discover]
|
17
17
|
self.homepage_url = 'http://www.moneris.com/'
|
18
18
|
self.display_name = 'Moneris'
|
19
19
|
|
@@ -417,27 +417,27 @@ module ActiveMerchant #:nodoc:
|
|
417
417
|
|
418
418
|
def actions
|
419
419
|
{
|
420
|
-
'purchase' => [
|
421
|
-
'preauth' => [
|
420
|
+
'purchase' => %i[order_id cust_id amount pan expdate crypt_type avs_info cvd_info track2 pos_code cof_info],
|
421
|
+
'preauth' => %i[order_id cust_id amount pan expdate crypt_type avs_info cvd_info track2 pos_code cof_info],
|
422
422
|
'command' => [:order_id],
|
423
|
-
'refund' => [
|
424
|
-
'indrefund' => [
|
425
|
-
'completion' => [
|
426
|
-
'purchasecorrection' => [
|
427
|
-
'cavv_preauth' => [
|
428
|
-
'cavv_purchase' => [
|
429
|
-
'card_verification' => [
|
430
|
-
'transact' => [
|
423
|
+
'refund' => %i[order_id amount txn_number crypt_type],
|
424
|
+
'indrefund' => %i[order_id cust_id amount pan expdate crypt_type],
|
425
|
+
'completion' => %i[order_id comp_amount txn_number crypt_type],
|
426
|
+
'purchasecorrection' => %i[order_id txn_number crypt_type],
|
427
|
+
'cavv_preauth' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator],
|
428
|
+
'cavv_purchase' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator],
|
429
|
+
'card_verification' => %i[order_id cust_id pan expdate crypt_type avs_info cvd_info cof_info],
|
430
|
+
'transact' => %i[order_id cust_id amount pan expdate crypt_type],
|
431
431
|
'Batchcloseall' => [],
|
432
432
|
'opentotals' => [:ecr_number],
|
433
433
|
'batchclose' => [:ecr_number],
|
434
|
-
'res_add_cc' => [
|
435
|
-
'res_temp_add' => [
|
434
|
+
'res_add_cc' => %i[pan expdate crypt_type avs_info cof_info],
|
435
|
+
'res_temp_add' => %i[pan expdate crypt_type duration],
|
436
436
|
'res_delete' => [:data_key],
|
437
|
-
'res_update_cc' => [
|
438
|
-
'res_purchase_cc' => [
|
439
|
-
'res_preauth_cc' => [
|
440
|
-
'res_card_verification_cc' => [
|
437
|
+
'res_update_cc' => %i[data_key pan expdate crypt_type avs_info cof_info],
|
438
|
+
'res_purchase_cc' => %i[data_key order_id cust_id amount crypt_type cof_info],
|
439
|
+
'res_preauth_cc' => %i[data_key order_id cust_id amount crypt_type cof_info],
|
440
|
+
'res_card_verification_cc' => %i[order_id data_key expdate crypt_type cof_info]
|
441
441
|
}
|
442
442
|
end
|
443
443
|
end
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
self.homepage_url = 'http://mmoa.us/'
|
9
9
|
self.display_name = 'MoneyMovers'
|
10
10
|
self.supported_countries = ['US']
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
12
12
|
|
13
13
|
def initialize(options = {})
|
14
14
|
requires!(options, :login, :password)
|
@@ -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 alelo]
|
9
9
|
|
10
10
|
self.homepage_url = 'https://www.mundipagg.com/'
|
11
11
|
self.display_name = 'Mundipagg'
|
@@ -16,7 +16,7 @@ module ActiveMerchant #:nodoc:
|
|
16
16
|
self.live_periodic_url = 'https://transact.nab.com.au/xmlapi/periodic'
|
17
17
|
|
18
18
|
self.supported_countries = ['AU']
|
19
|
-
self.supported_cardtypes = [
|
19
|
+
self.supported_cardtypes = %i[visa master american_express diners_club jcb]
|
20
20
|
|
21
21
|
self.homepage_url = 'http://transact.nab.com.au'
|
22
22
|
self.display_name = 'NAB Transact'
|
@@ -39,7 +39,7 @@ module ActiveMerchant #:nodoc:
|
|
39
39
|
trigger: 8
|
40
40
|
}
|
41
41
|
|
42
|
-
SUCCESS_CODES = [
|
42
|
+
SUCCESS_CODES = %w[00 08 11 16 77]
|
43
43
|
|
44
44
|
def initialize(options = {})
|
45
45
|
requires!(options, :login, :password)
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
self.supported_countries = ['US']
|
10
10
|
self.default_currency = 'USD'
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
12
12
|
|
13
13
|
self.homepage_url = 'http://www.ncrretailonline.com'
|
14
14
|
self.display_name = 'NCR Secure Pay'
|
@@ -24,7 +24,7 @@ module ActiveMerchant
|
|
24
24
|
class NetRegistryGateway < Gateway
|
25
25
|
self.live_url = self.test_url = 'https://paygate.ssllock.net/external2.pl'
|
26
26
|
|
27
|
-
FILTERED_PARAMS = [
|
27
|
+
FILTERED_PARAMS = %w[card_no card_expiry receipt_array]
|
28
28
|
|
29
29
|
self.supported_countries = ['AU']
|
30
30
|
|
@@ -32,7 +32,7 @@ module ActiveMerchant
|
|
32
32
|
# steps in setting up your account, as detailed in
|
33
33
|
# "Programming for NetRegistry's E-commerce Gateway."
|
34
34
|
# [http://rubyurl.com/hNG]
|
35
|
-
self.supported_cardtypes = [
|
35
|
+
self.supported_cardtypes = %i[visa master diners_club american_express jcb]
|
36
36
|
self.display_name = 'NetRegistry'
|
37
37
|
self.homepage_url = 'http://www.netregistry.com.au'
|
38
38
|
|
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.live_url = 'https://epayment.bbs.no/'
|
8
8
|
|
9
9
|
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
10
|
-
self.supported_countries = [
|
10
|
+
self.supported_countries = %w[NO DK SE FI]
|
11
11
|
|
12
12
|
# The card types supported by the payment gateway
|
13
|
-
self.supported_cardtypes = [
|
13
|
+
self.supported_cardtypes = %i[visa master american_express]
|
14
14
|
|
15
15
|
# The homepage URL of the gateway
|
16
16
|
self.homepage_url = 'http://www.betalingsterminal.no/Netthandel-forside/'
|
@@ -7,14 +7,14 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
|
8
8
|
self.supported_countries = %w(AF AX AL DZ AS AD AO AI AQ AG AR AM AW AU AT AZ BS BH BD BB BY BE BZ BJ BM BT BO BQ BA BW BV BR IO BN BG BF BI KH CM CA CV KY CF TD CL CN CX CC CO KM CG CD CK CR CI HR CU CW CY CZ DK DJ DM DO EC EG SV GQ ER EE ET FK FO FJ FI FR GF PF TF GA GM GE DE GH GI GR GL GD GP GU GT GG GN GW GY HT HM HN HK HU IS IN ID IR IQ IE IM IL IT JM JP JE JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT LU MO MK MG MW MY MV ML MT MH MQ MR MU YT MX FM MD MC MN ME MS MA MZ MM NA NR NP NC NZ NI NE NG NU NF MP NO OM PK PW PS PA PG PY PE PH PN PL PT PR QA RE RO RU RW BL SH KN LC MF VC WS SM ST SA SN RS SC SL SG SX SK SI SB SO ZA GS SS ES LK PM SD SR SJ SZ SE CH SY TW TJ TZ TH NL TL TG TK TO TT TN TR TM TC TV UG UA AE GB US UM UY UZ VU VA VE VN VG VI WF EH YE ZM ZW)
|
9
9
|
self.default_currency = 'CAD'
|
10
|
-
self.supported_cardtypes = [
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
self.supported_cardtypes = %i[
|
11
|
+
american_express
|
12
|
+
diners_club
|
13
|
+
discover
|
14
|
+
jcb
|
15
|
+
master
|
16
|
+
maestro
|
17
|
+
visa
|
18
18
|
]
|
19
19
|
|
20
20
|
self.money_format = :cents
|
@@ -37,6 +37,10 @@ module ActiveMerchant #:nodoc:
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def authorize(money, payment, options={})
|
40
|
+
# Do a Verification with AVS prior to Auth + Settle
|
41
|
+
verification_response = verify(payment, options)
|
42
|
+
return verification_response if verification_response.message != 'OK'
|
43
|
+
|
40
44
|
post = {}
|
41
45
|
add_invoice(post, money, options)
|
42
46
|
add_payment(post, payment, options)
|
@@ -52,14 +56,28 @@ module ActiveMerchant #:nodoc:
|
|
52
56
|
end
|
53
57
|
|
54
58
|
def refund(money, authorization, options={})
|
59
|
+
# If the transactions that are pending, API call needs to be Cancellation
|
60
|
+
settlement_data = get_settlement(authorization)
|
61
|
+
return settlement_data if settlement_data.message != 'OK'
|
62
|
+
|
55
63
|
post = {}
|
56
|
-
|
64
|
+
if settlement_data.params['status'] == 'PENDING'
|
65
|
+
post[:status] = 'CANCELLED'
|
66
|
+
commit(:put, "settlements/#{authorization}", post)
|
67
|
+
else
|
68
|
+
add_invoice(post, money, options)
|
57
69
|
|
58
|
-
|
59
|
-
|
60
|
-
|
70
|
+
# Setting merchantRefNumber to a unique id for each refund
|
71
|
+
# This is to support multiple partial refunds for the same order
|
72
|
+
post[:merchantRefNum] = SecureRandom.uuid
|
61
73
|
|
62
|
-
|
74
|
+
commit(:post, "settlements/#{authorization}/refunds", post)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def get_settlement(authorization)
|
79
|
+
post = {}
|
80
|
+
commit(:get, "settlements/#{authorization}", post)
|
63
81
|
end
|
64
82
|
|
65
83
|
def void(authorization, options={})
|
@@ -71,7 +89,7 @@ module ActiveMerchant #:nodoc:
|
|
71
89
|
|
72
90
|
def verify(credit_card, options={})
|
73
91
|
post = {}
|
74
|
-
add_payment(post, credit_card)
|
92
|
+
add_payment(post, credit_card, options)
|
75
93
|
add_order_id(post, options)
|
76
94
|
|
77
95
|
commit(:post, 'verifications', post)
|
@@ -139,14 +157,14 @@ module ActiveMerchant #:nodoc:
|
|
139
157
|
add_order_id(post, options)
|
140
158
|
end
|
141
159
|
|
142
|
-
def add_payment(post,
|
160
|
+
def add_payment(post, credit_card_reference, options = {})
|
143
161
|
post[:card] ||= {}
|
144
|
-
if
|
145
|
-
post[:card][:paymentToken] =
|
162
|
+
if credit_card_reference.is_a?(String)
|
163
|
+
post[:card][:paymentToken] = credit_card_reference
|
146
164
|
else
|
147
|
-
post[:card][:cardNum] =
|
148
|
-
post[:card][:cvv] =
|
149
|
-
post[:card][:cardExpiry] = expdate(
|
165
|
+
post[:card][:cardNum] = credit_card_reference.number
|
166
|
+
post[:card][:cvv] = credit_card_reference.verification_value
|
167
|
+
post[:card][:cardExpiry] = expdate(credit_card_reference)
|
150
168
|
end
|
151
169
|
|
152
170
|
post[:currencyCode] = options[:currency] if options[:currency]
|
@@ -202,7 +220,11 @@ module ActiveMerchant #:nodoc:
|
|
202
220
|
params = parameters.to_json unless parameters.nil?
|
203
221
|
response =
|
204
222
|
begin
|
205
|
-
|
223
|
+
if method == :get
|
224
|
+
parse(ssl_request(method, get_url(uri), nil, headers))
|
225
|
+
else
|
226
|
+
parse(ssl_request(method, get_url(uri), params, headers))
|
227
|
+
end
|
206
228
|
rescue ResponseError => e
|
207
229
|
return Response.new(false, 'Invalid Login') if e.response.code == '401'
|
208
230
|
|
@@ -216,7 +238,9 @@ module ActiveMerchant #:nodoc:
|
|
216
238
|
response,
|
217
239
|
test: test?,
|
218
240
|
error_code: error_code_from(response),
|
219
|
-
authorization: authorization_from(success, get_url(uri), method, response)
|
241
|
+
authorization: authorization_from(success, get_url(uri), method, response),
|
242
|
+
avs_result: AVSResult.new(code: response['avsResponse']),
|
243
|
+
cvv_result: CVVResult.new(response['cvvVerification'])
|
220
244
|
)
|
221
245
|
end
|
222
246
|
|