activemerchant 1.108.0 → 1.109.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +28 -0
  3. data/lib/active_merchant/billing/base.rb +0 -13
  4. data/lib/active_merchant/billing/check.rb +1 -1
  5. data/lib/active_merchant/billing/credit_card.rb +2 -0
  6. data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
  7. data/lib/active_merchant/billing/gateways/adyen.rb +8 -8
  8. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  9. data/lib/active_merchant/billing/gateways/authorize_net.rb +7 -7
  10. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  11. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
  12. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  13. data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
  15. data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
  16. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
  18. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
  21. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -2
  22. data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
  23. data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree_blue.rb +78 -28
  27. data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
  28. data/lib/active_merchant/billing/gateways/cams.rb +2 -2
  29. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
  32. data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
  33. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
  37. data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
  38. data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/clearhaus.rb +3 -3
  41. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/credorax.rb +6 -2
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
  46. data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +13 -4
  48. data/lib/active_merchant/billing/gateways/d_local.rb +7 -3
  49. data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
  50. data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
  51. data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
  52. data/lib/active_merchant/billing/gateways/ebanx.rb +4 -4
  53. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
  54. data/lib/active_merchant/billing/gateways/elavon.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/element.rb +3 -3
  56. data/lib/active_merchant/billing/gateways/epay.rb +3 -3
  57. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  58. data/lib/active_merchant/billing/gateways/eway.rb +1 -1
  59. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
  61. data/lib/active_merchant/billing/gateways/exact.rb +3 -3
  62. data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  64. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  65. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
  66. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +4 -4
  69. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +3 -3
  70. data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
  71. data/lib/active_merchant/billing/gateways/forte.rb +2 -2
  72. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  73. data/lib/active_merchant/billing/gateways/global_collect.rb +5 -5
  74. data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
  75. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  76. data/lib/active_merchant/billing/gateways/hps.rb +1 -1
  77. data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
  78. data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
  79. data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
  80. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  81. data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
  82. data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
  83. data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
  84. data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
  85. data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
  86. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
  87. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  88. data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
  89. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  90. data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
  91. data/lib/active_merchant/billing/gateways/litle.rb +4 -4
  92. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  93. data/lib/active_merchant/billing/gateways/mercado_pago.rb +11 -6
  94. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
  95. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  96. data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
  97. data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
  98. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
  100. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  101. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
  102. data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/migs.rb +1 -1
  104. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
  105. data/lib/active_merchant/billing/gateways/monei.rb +2 -2
  106. data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
  107. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  108. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  109. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
  110. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  111. data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
  112. data/lib/active_merchant/billing/gateways/netaxept.rb +2 -2
  113. data/lib/active_merchant/billing/gateways/netbanx.rb +46 -22
  114. data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
  115. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
  117. data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
  118. data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
  119. data/lib/active_merchant/billing/gateways/omise.rb +1 -1
  120. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  121. data/lib/active_merchant/billing/gateways/opp.rb +1 -1
  122. data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
  123. data/lib/active_merchant/billing/gateways/orbital.rb +6 -6
  124. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
  125. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
  126. data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
  127. data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
  128. data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
  129. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
  130. data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
  132. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
  133. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  134. data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
  135. data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
  136. data/lib/active_merchant/billing/gateways/payex.rb +13 -13
  137. data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
  138. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  139. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  140. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
  141. data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
  143. data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
  144. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  146. data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/payu_latam.rb +6 -7
  149. data/lib/active_merchant/billing/gateways/payway.rb +1 -1
  150. data/lib/active_merchant/billing/gateways/pin.rb +1 -1
  151. data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
  152. data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
  153. data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
  154. data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
  155. data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/quantum.rb +3 -3
  157. data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
  158. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
  159. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
  160. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  161. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  162. data/lib/active_merchant/billing/gateways/redsys.rb +4 -4
  163. data/lib/active_merchant/billing/gateways/s5.rb +1 -1
  164. data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
  165. data/lib/active_merchant/billing/gateways/sage.rb +3 -3
  166. data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
  167. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
  168. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
  169. data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
  170. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
  171. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  172. data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
  173. data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
  174. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
  175. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  176. data/lib/active_merchant/billing/gateways/stripe.rb +6 -6
  177. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +20 -1
  178. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
  179. data/lib/active_merchant/billing/gateways/telr.rb +4 -4
  180. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  182. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
  183. data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/transax.rb +1 -1
  185. data/lib/active_merchant/billing/gateways/trexle.rb +1 -1
  186. data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
  187. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
  188. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
  189. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  190. data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
  191. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
  192. data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
  193. data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
  194. data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
  195. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
  196. data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
  197. data/lib/active_merchant/billing/gateways/worldpay.rb +6 -6
  198. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
  199. data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
  200. data/lib/active_merchant/version.rb +1 -1
  201. data/lib/support/gateway_support.rb +1 -1
  202. metadata +35 -35
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
 
9
9
  self.supported_countries = ['DK']
10
10
  self.default_currency = 'EUR'
11
- self.supported_cardtypes = [:visa, :master, :maestro]
11
+ self.supported_cardtypes = %i[visa master maestro]
12
12
 
13
13
  self.homepage_url = 'http://www.s5.dk/'
14
14
  self.display_name = 'S5'
@@ -6,9 +6,9 @@ module ActiveMerchant #:nodoc:
6
6
  self.test_url = 'https://process.sandbox.safecharge.com/service.asmx/Process'
7
7
  self.live_url = 'https://process.safecharge.com/service.asmx/Process'
8
8
 
9
- self.supported_countries = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'GR', 'ES', 'FI', 'FR', 'GI', 'HK', 'HR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SG', 'SI', 'SK', 'GB', 'US']
9
+ self.supported_countries = %w[AT BE BG CY CZ DE DK EE GR ES FI FR GI HK HR HU IE IS IT LI LT LU LV MT MX NL NO PL PT RO SE SG SI SK GB US]
10
10
  self.default_currency = 'USD'
11
- self.supported_cardtypes = [:visa, :master]
11
+ self.supported_cardtypes = %i[visa master]
12
12
 
13
13
  self.homepage_url = 'https://www.safecharge.com'
14
14
  self.display_name = 'SafeCharge'
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  self.homepage_url = 'Sage Payment Solutions'
8
8
  self.live_url = 'https://www.sagepayments.net/cgi-bin'
9
9
 
10
- self.supported_countries = ['US', 'CA']
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
10
+ self.supported_countries = %w[US CA]
11
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
12
12
 
13
13
  TRANSACTIONS = {
14
14
  purchase: '01',
@@ -215,7 +215,7 @@ module ActiveMerchant #:nodoc:
215
215
  end
216
216
 
217
217
  def add_reference(post, reference)
218
- ref, _ = reference.to_s.split(';')
218
+ ref, = reference.to_s.split(';')
219
219
  post[:T_reference] = ref
220
220
  end
221
221
 
@@ -69,8 +69,8 @@ module ActiveMerchant #:nodoc:
69
69
  recipient_dob: :FIRecipientDoB
70
70
  }
71
71
 
72
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :diners_club]
73
- self.supported_countries = ['GB', 'IE']
72
+ self.supported_countries = %w[GB IE]
73
+ self.supported_cardtypes = %i[visa master american_express discover jcb maestro diners_club]
74
74
  self.default_currency = 'GBP'
75
75
 
76
76
  self.homepage_url = 'http://www.sagepay.com'
@@ -390,7 +390,7 @@ module ActiveMerchant #:nodoc:
390
390
  end
391
391
 
392
392
  def build_simulator_url(action)
393
- endpoint = [:purchase, :authorization].include?(action) ? 'VSPDirectGateway.asp' : "VSPServerGateway.asp?Service=Vendor#{TRANSACTIONS[action].capitalize}Tx"
393
+ endpoint = %i[purchase authorization].include?(action) ? 'VSPDirectGateway.asp' : "VSPServerGateway.asp?Service=Vendor#{TRANSACTIONS[action].capitalize}Tx"
394
394
  "#{self.simulator_url}/#{endpoint}"
395
395
  end
396
396
 
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
  self.supported_countries = ['US']
8
8
 
9
9
  # The card types supported by the payment gateway
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
10
+ self.supported_cardtypes = %i[visa master american_express discover]
11
11
 
12
12
  # The homepage URL of the gateway
13
13
  self.homepage_url = 'http://www.salliemae.com/'
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
18
18
  NIL_ATTRIBUTE = { 'i:nil' => 'true' }
19
19
 
20
20
  self.supported_countries = ['US']
21
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
21
+ self.supported_cardtypes = %i[visa master american_express discover]
22
22
  self.homepage_url = 'http://www.securenet.com/'
23
23
  self.display_name = 'SecureNet'
24
24
 
@@ -17,7 +17,7 @@ module ActiveMerchant #:nodoc:
17
17
  self.default_currency = 'USD'
18
18
 
19
19
  self.supported_countries = %w(US CA GB AU)
20
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
20
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
21
21
  self.homepage_url = 'http://www.securepay.com/'
22
22
  self.display_name = 'SecurePay'
23
23
 
@@ -15,7 +15,7 @@ module ActiveMerchant #:nodoc:
15
15
  self.live_periodic_url = 'https://api.securepay.com.au/xmlapi/periodic'
16
16
 
17
17
  self.supported_countries = ['AU']
18
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
18
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb]
19
19
 
20
20
  # The homepage URL of the gateway
21
21
  self.homepage_url = 'http://securepay.com.au'
@@ -54,7 +54,7 @@ module ActiveMerchant #:nodoc:
54
54
  trigger: nil
55
55
  }
56
56
 
57
- SUCCESS_CODES = ['00', '08', '11', '16', '77']
57
+ SUCCESS_CODES = %w[00 08 11 16 77]
58
58
 
59
59
  def initialize(options = {})
60
60
  requires!(options, :login, :password)
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class SecurePayTechGateway < Gateway
4
4
  class SecurePayTechPostData < PostData
5
- self.required_fields = [:OrderReference, :CardNumber, :CardExpiry, :CardHolderName, :CardType, :MerchantID, :MerchantKey, :Amount, :Currency]
5
+ self.required_fields = %i[OrderReference CardNumber CardExpiry CardHolderName CardType MerchantID MerchantKey Amount Currency]
6
6
  end
7
7
 
8
8
  self.live_url = self.test_url = 'https://tx.securepaytech.com/web/HttpPostPurchase'
@@ -21,7 +21,7 @@ module ActiveMerchant #:nodoc:
21
21
 
22
22
  self.default_currency = 'NZD'
23
23
  self.supported_countries = ['NZ']
24
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
24
+ self.supported_cardtypes = %i[visa master american_express diners_club]
25
25
  self.homepage_url = 'http://www.securepaytech.com/'
26
26
  self.display_name = 'SecurePayTech'
27
27
 
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
 
10
10
  self.default_currency = 'USD'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
12
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
13
13
 
14
14
  self.homepage_url = 'https://securionpay.com/'
15
15
  self.display_name = 'SecurionPay'
@@ -160,8 +160,8 @@ module ActiveMerchant #:nodoc:
160
160
  '-117' => 'POS Check Invalid Cashier Number'
161
161
  }
162
162
 
163
- self.supported_countries = ['US', 'CA']
164
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :discover, :diners_club]
163
+ self.supported_countries = %w[US CA]
164
+ self.supported_cardtypes = %i[visa master american_express jcb discover diners_club]
165
165
  self.homepage_url = 'http://www.skipjack.com/'
166
166
  self.display_name = 'SkipJack'
167
167
 
@@ -300,9 +300,9 @@ module ActiveMerchant #:nodoc:
300
300
  when :authorization
301
301
  parse_authorization_response(body)
302
302
  when :get_status
303
- parse_status_response(body, [:SerialNumber, :TransactionAmount, :TransactionStatusCode, :TransactionStatusMessage, :OrderNumber, :TransactionDateTime, :TransactionID, :ApprovalCode, :BatchNumber])
303
+ parse_status_response(body, %i[SerialNumber TransactionAmount TransactionStatusCode TransactionStatusMessage OrderNumber TransactionDateTime TransactionID ApprovalCode BatchNumber])
304
304
  else
305
- parse_status_response(body, [:SerialNumber, :TransactionAmount, :DesiredStatus, :StatusResponse, :StatusResponseMessage, :OrderNumber, :AuditID])
305
+ parse_status_response(body, %i[SerialNumber TransactionAmount DesiredStatus StatusResponse StatusResponseMessage OrderNumber AuditID])
306
306
  end
307
307
  end
308
308
 
@@ -329,7 +329,7 @@ module ActiveMerchant #:nodoc:
329
329
  def parse_status_response(body, response_keys)
330
330
  lines = split_lines(body)
331
331
 
332
- keys = [:szSerialNumber, :szErrorCode, :szNumberRecords]
332
+ keys = %i[szSerialNumber szErrorCode szNumberRecords]
333
333
  values = split_line(lines[0])[0..2]
334
334
 
335
335
  result = Hash[*keys.zip(values).flatten]
@@ -4,13 +4,13 @@ module ActiveMerchant #:nodoc:
4
4
  self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
5
5
  self.money_format = :cents
6
6
 
7
- self.supported_countries = [
8
- 'US', 'CA', 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE',
9
- 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU',
10
- 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB',
11
- 'IS', 'NO', 'CH'
7
+ self.supported_countries = %w[
8
+ US CA AT BE BG HR CY CZ DK EE
9
+ FI FR DE GR HU IE IT LV LT LU
10
+ MT NL PL PT RO SK SI ES SE GB
11
+ IS NO CH
12
12
  ]
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :maestro, :jcb, :diners_club]
13
+ self.supported_cardtypes = %i[visa master american_express discover maestro jcb diners_club]
14
14
  self.homepage_url = 'http://www.soeasypay.com/'
15
15
  self.display_name = 'SoEasyPay'
16
16
 
@@ -14,7 +14,7 @@ module ActiveMerchant #:nodoc:
14
14
  MT MU MV MX MY NL NO NZ OM PH PL PT QA RO SA SE SG SI SK SM
15
15
  TR TT UM US VA VN ZA)
16
16
 
17
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
17
+ self.supported_cardtypes = %i[visa master american_express discover]
18
18
  self.homepage_url = 'https://spreedly.com'
19
19
  self.display_name = 'Spreedly'
20
20
  self.money_format = :cents
@@ -25,10 +25,10 @@ module ActiveMerchant #:nodoc:
25
25
 
26
26
  DEFAULT_API_VERSION = '2015-04-07'
27
27
 
28
- self.supported_countries = %w(AT AU BE BR CA CH DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MX NL NO NZ PL PT SE SG SI SK US)
28
+ self.supported_countries = %w(AT AU BE BG BR CA CH CY CZ DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MT MX NL NO NZ PL PT RO SE SG SI SK US)
29
29
  self.default_currency = 'USD'
30
30
  self.money_format = :cents
31
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro]
31
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro]
32
32
  self.currencies_without_fractions = %w(BIF CLP DJF GNF JPY KMF KRW MGA PYG RWF VND VUV XAF XOF XPF UGX)
33
33
 
34
34
  self.homepage_url = 'https://stripe.com/'
@@ -430,7 +430,7 @@ module ActiveMerchant #:nodoc:
430
430
  end
431
431
 
432
432
  def add_customer_data(post, options)
433
- metadata_options = [:description, :ip, :user_agent, :referrer]
433
+ metadata_options = %i[description ip user_agent referrer]
434
434
  post.update(options.slice(*metadata_options))
435
435
 
436
436
  post[:external_id] = options[:order_id]
@@ -452,7 +452,7 @@ module ActiveMerchant #:nodoc:
452
452
 
453
453
  def add_statement_address(post, options)
454
454
  return unless statement_address = options[:statement_address]
455
- return unless [:address1, :city, :zip, :state].all? { |key| statement_address[key].present? }
455
+ return unless %i[address1 city zip state].all? { |key| statement_address[key].present? }
456
456
 
457
457
  post[:statement_address] = {}
458
458
  post[:statement_address][:line1] = statement_address[:address1]
@@ -613,7 +613,7 @@ module ActiveMerchant #:nodoc:
613
613
  idempotency_key = options[:idempotency_key]
614
614
 
615
615
  headers = {
616
- 'Authorization' => 'Basic ' + Base64.encode64(key.to_s + ':').strip,
616
+ 'Authorization' => 'Basic ' + Base64.strict_encode64(key.to_s + ':').strip,
617
617
  'User-Agent' => "Stripe/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
618
618
  'Stripe-Version' => api_version(options),
619
619
  'X-Stripe-Client-User-Agent' => stripe_client_user_agent(options),
@@ -655,7 +655,7 @@ module ActiveMerchant #:nodoc:
655
655
  success = success_from(response, options)
656
656
 
657
657
  card = card_from_response(response)
658
- avs_code = AVS_CODE_TRANSLATOR["line1: #{card["address_line1_check"]}, zip: #{card["address_zip_check"]}"]
658
+ avs_code = AVS_CODE_TRANSLATOR["line1: #{card['address_line1_check']}, zip: #{card['address_zip_check']}"]
659
659
  cvc_code = CVC_CODE_TRANSLATOR[card['cvc_check']]
660
660
 
661
661
  Response.new(success,
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  # This gateway uses the current Stripe {Payment Intents API}[https://stripe.com/docs/api/payment_intents].
6
6
  # For the legacy API, see the Stripe gateway
7
7
  class StripePaymentIntentsGateway < StripeGateway
8
- self.supported_countries = %w(AT AU BE BR CA CH DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MX NL NO NZ PL PT SE SG SI SK US)
8
+ self.supported_countries = %w(AT AU BE BG BR CA CH CY CZ DE DK EE ES FI FR GB GR HK IE IT JP LT LU LV MT MX NL NO NZ PL PT RO SE SG SI SK US)
9
9
 
10
10
  ALLOWED_METHOD_STATES = %w[automatic manual].freeze
11
11
  ALLOWED_CANCELLATION_REASONS = %w[duplicate fraudulent requested_by_customer abandoned].freeze
@@ -84,6 +84,21 @@ module ActiveMerchant #:nodoc:
84
84
  commit(:post, "payment_intents/#{intent_id}", post, options)
85
85
  end
86
86
 
87
+ def create_setup_intent(payment_method, options = {})
88
+ post = {}
89
+ add_customer(post, options)
90
+ payment_method = add_payment_method_token(post, payment_method, options)
91
+ return payment_method if payment_method.is_a?(ActiveMerchant::Billing::Response)
92
+
93
+ add_metadata(post, options)
94
+ add_return_url(post, options)
95
+ post[:on_behalf_of] = options[:on_behalf_of] if options[:on_behalf_of]
96
+ post[:usage] = options[:usage] if %w(on_session off_session).include?(options[:usage])
97
+ post[:description] = options[:description] if options[:description]
98
+
99
+ commit(:post, 'setup_intents', post, options)
100
+ end
101
+
87
102
  def authorize(money, payment_method, options = {})
88
103
  create_intent(money, payment_method, options.merge!(confirm: true, capture_method: 'manual'))
89
104
  end
@@ -170,6 +185,10 @@ module ActiveMerchant #:nodoc:
170
185
  end
171
186
  end
172
187
 
188
+ def verify(payment_method, options = {})
189
+ create_setup_intent(payment_method, options.merge!(confirm: true))
190
+ end
191
+
173
192
  private
174
193
 
175
194
  def add_connected_account(post, options = {})
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
13
13
 
14
14
  self.supported_countries = %w[NZ CA]
15
15
  self.default_currency = 'NZD'
16
- self.supported_cardtypes = [:visa, :master]
16
+ self.supported_cardtypes = %i[visa master]
17
17
  self.homepage_url = 'https://www.swipehq.com/checkout'
18
18
  self.display_name = 'Swipe Checkout'
19
19
  self.money_format = :dollars
@@ -8,10 +8,10 @@ module ActiveMerchant #:nodoc:
8
8
 
9
9
  self.live_url = 'https://secure.telr.com/gateway/remote.xml'
10
10
 
11
- self.supported_countries = ['AE', 'IN', 'SA']
11
+ self.supported_countries = %w[AE IN SA]
12
12
  self.default_currency = 'AED'
13
13
  self.money_format = :dollars
14
- self.supported_cardtypes = [:visa, :master, :american_express, :maestro, :jcb]
14
+ self.supported_cardtypes = %i[visa master american_express maestro jcb]
15
15
 
16
16
  CVC_CODE_TRANSLATOR = {
17
17
  'Y' => 'M',
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
78
78
 
79
79
  def verify_credentials
80
80
  response = void('0')
81
- !['01', '04'].include?(response.error_code)
81
+ !%w[01 04].include?(response.error_code)
82
82
  end
83
83
 
84
84
  def supports_scrubbing?
@@ -149,7 +149,7 @@ module ActiveMerchant #:nodoc:
149
149
  end
150
150
 
151
151
  def add_ref(doc, action, payment_method)
152
- doc.ref(split_authorization(payment_method)[0]) if ['capture', 'refund', 'void'].include?(action) || payment_method.is_a?(String)
152
+ doc.ref(split_authorization(payment_method)[0]) if %w[capture refund void].include?(action) || payment_method.is_a?(String)
153
153
  end
154
154
 
155
155
  def add_authentication(doc)
@@ -20,7 +20,7 @@ module ActiveMerchant
20
20
  self.homepage_url = 'http://www.tnsi.com/'
21
21
  self.supported_countries = %w(AR AU BR FR DE HK MX NZ SG GB US)
22
22
  self.default_currency = 'USD'
23
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
23
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
24
24
  end
25
25
  end
26
26
  end
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  self.live_url = 'https://webservices.primerchants.com'
6
6
 
7
7
  self.supported_countries = ['US']
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
8
+ self.supported_cardtypes = %i[visa master american_express discover]
9
9
  self.homepage_url = 'http://www.transfirst.com/'
10
10
  self.display_name = 'TransFirst'
11
11
 
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
60
60
  def void(authorization, options={})
61
61
  post = {}
62
62
 
63
- transaction_id, _ = split_authorization(authorization)
63
+ transaction_id, = split_authorization(authorization)
64
64
  add_pair(post, :TransID, transaction_id)
65
65
 
66
66
  commit(:void, post)
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
  self.supported_countries = ['US']
13
13
  self.default_currency = 'USD'
14
14
  self.money_format = :cents
15
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
15
+ self.supported_cardtypes = %i[visa master american_express discover diners_club]
16
16
 
17
17
  V1_NAMESPACE = 'http://postilion/realtime/merchantframework/xsd/v1/'
18
18
  SOAPENV_NAMESPACE = 'http://schemas.xmlsoap.org/soap/envelope/'
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
  self.supported_countries = ['US']
13
13
  self.default_currency = 'USD'
14
14
  self.money_format = :cents
15
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
15
+ self.supported_cardtypes = %i[visa master american_express discover]
16
16
 
17
17
  self.homepage_url = 'https://www.transactpro.lv/business/online-payments-acceptance'
18
18
  self.display_name = 'Transact Pro'
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = ['US']
10
10
 
11
11
  # The card types supported by the payment gateway
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
12
+ self.supported_cardtypes = %i[visa master american_express discover]
13
13
 
14
14
  # The homepage URL of the gateway
15
15
  self.homepage_url = 'https://www.nelixtransax.com/'
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  GI GR HK HU ID IE IL IM IN IS IT JO KW LB LI LK LT LU LV MC
11
11
  MT MU MV MX MY NL NO NZ OM PH PL PT QA RO SA SE SG SI SK SM
12
12
  TR TT UM US VA VN ZA)
13
- self.supported_cardtypes = [:visa, :master, :american_express]
13
+ self.supported_cardtypes = %i[visa master american_express]
14
14
  self.homepage_url = 'https://trexle.com'
15
15
  self.display_name = 'Trexle'
16
16
 
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
67
67
  class TrustCommerceGateway < Gateway
68
68
  self.live_url = self.test_url = 'https://vault.trustcommerce.com/trans/'
69
69
 
70
- SUCCESS_TYPES = ['approved', 'accepted']
70
+ SUCCESS_TYPES = %w[approved accepted]
71
71
 
72
72
  DECLINE_CODES = {
73
73
  'decline' => 'The credit card was declined',
@@ -107,7 +107,7 @@ module ActiveMerchant #:nodoc:
107
107
  VOIDABLE_ACTIONS = %w(preauth sale postauth credit)
108
108
 
109
109
  self.money_format = :cents
110
- self.supported_cardtypes = [:visa, :master, :discover, :american_express, :diners_club, :jcb]
110
+ self.supported_cardtypes = %i[visa master discover american_express diners_club jcb]
111
111
  self.supported_countries = ['US']
112
112
  self.homepage_url = 'http://www.trustcommerce.com/'
113
113
  self.display_name = 'TrustCommerce'
@@ -185,7 +185,7 @@ module ActiveMerchant #:nodoc:
185
185
  # postauth, we preserve active_merchant's nomenclature of capture() for consistency with the rest of the library. To process
186
186
  # a postauthorization with TC, you need an amount in cents or a money object, and a TC transid.
187
187
  def capture(money, authorization, options = {})
188
- transaction_id, _ = split_authorization(authorization)
188
+ transaction_id, = split_authorization(authorization)
189
189
  parameters = {
190
190
  amount: amount(money),
191
191
  transid: transaction_id,
@@ -199,7 +199,7 @@ module ActiveMerchant #:nodoc:
199
199
  # refund() allows you to return money to a card that was previously billed. You need to supply the amount, in cents or a money object,
200
200
  # that you want to refund, and a TC transid for the transaction that you are refunding.
201
201
  def refund(money, identification, options = {})
202
- transaction_id, _ = split_authorization(identification)
202
+ transaction_id, = split_authorization(identification)
203
203
 
204
204
  parameters = {
205
205
  amount: amount(money),
@@ -262,7 +262,7 @@ module ActiveMerchant #:nodoc:
262
262
  def recurring(money, creditcard, options = {})
263
263
  ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
264
264
 
265
- requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily])
265
+ requires!(options, %i[periodicity bimonthly monthly biweekly weekly yearly daily])
266
266
 
267
267
  cycle =
268
268
  case options[:periodicity]
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
73
73
  FAILURE_MESSAGE = 'Default Failure' #:nodoc:
74
74
 
75
75
  self.supported_countries = ['US']
76
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
76
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
77
77
  self.homepage_url = 'http://www.usaepay.com/'
78
78
  self.display_name = 'USA ePay Advanced SOAP Interface'
79
79
 
@@ -676,9 +676,9 @@ module ActiveMerchant #:nodoc:
676
676
  commit(__method__, request)
677
677
  end
678
678
 
679
- TRANSACTION_METHODS = [
680
- :run_sale, :run_auth_only, :run_credit,
681
- :run_check_sale, :run_check_credit
679
+ TRANSACTION_METHODS = %i[
680
+ run_sale run_auth_only run_credit
681
+ run_check_sale run_check_credit
682
682
  ] #:nodoc:
683
683
 
684
684
  TRANSACTION_METHODS.each do |method|
@@ -1336,7 +1336,7 @@ module ActiveMerchant #:nodoc:
1336
1336
  when payment_method[:method].kind_of?(ActiveMerchant::Billing::CreditCard)
1337
1337
  build_tag soap, :string, 'CardNumber', payment_method[:method].number
1338
1338
  build_tag soap, :string, 'CardExpiration',
1339
- "#{"%02d" % payment_method[:method].month}#{payment_method[:method].year.to_s[-2..-1]}"
1339
+ "#{'%02d' % payment_method[:method].month}#{payment_method[:method].year.to_s[-2..-1]}"
1340
1340
  if options[:billing_address]
1341
1341
  build_tag soap, :string, 'AvsStreet', options[:billing_address][:address1]
1342
1342
  build_tag soap, :string, 'AvsZip', options[:billing_address][:zip]
@@ -1432,7 +1432,7 @@ module ActiveMerchant #:nodoc:
1432
1432
  def build_card_expiration(options)
1433
1433
  month = options[:payment_method].month
1434
1434
  year = options[:payment_method].year
1435
- "#{"%02d" % month}#{year.to_s[-2..-1]}" unless month.nil? || year.nil?
1435
+ "#{'%02d' % month}#{year.to_s[-2..-1]}" unless month.nil? || year.nil?
1436
1436
  end
1437
1437
 
1438
1438
  def build_check_data(soap, options)