activemerchant 1.107.2 → 1.110.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +73 -0
  3. data/README.md +3 -3
  4. data/lib/active_merchant/billing/base.rb +0 -13
  5. data/lib/active_merchant/billing/check.rb +1 -1
  6. data/lib/active_merchant/billing/credit_card.rb +2 -0
  7. data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
  8. data/lib/active_merchant/billing/gateways/adyen.rb +18 -12
  9. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  10. data/lib/active_merchant/billing/gateways/authorize_net.rb +8 -8
  11. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  12. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
  13. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
  15. data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
  16. data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  18. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
  19. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
  21. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
  22. data/lib/active_merchant/billing/gateways/blue_pay.rb +4 -4
  23. data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
  25. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/braintree_blue.rb +84 -35
  28. data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
  29. data/lib/active_merchant/billing/gateways/cams.rb +2 -2
  30. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
  33. data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
  34. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
  38. data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
  39. data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
  40. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  41. data/lib/active_merchant/billing/gateways/clearhaus.rb +4 -4
  42. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
  45. data/lib/active_merchant/billing/gateways/credorax.rb +7 -3
  46. data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
  47. data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
  48. data/lib/active_merchant/billing/gateways/cyber_source.rb +72 -23
  49. data/lib/active_merchant/billing/gateways/d_local.rb +24 -8
  50. data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
  51. data/lib/active_merchant/billing/gateways/decidir.rb +24 -0
  52. data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
  53. data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
  54. data/lib/active_merchant/billing/gateways/ebanx.rb +6 -4
  55. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
  56. data/lib/active_merchant/billing/gateways/elavon.rb +56 -9
  57. data/lib/active_merchant/billing/gateways/element.rb +16 -8
  58. data/lib/active_merchant/billing/gateways/epay.rb +3 -3
  59. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/eway.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  62. data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
  63. data/lib/active_merchant/billing/gateways/exact.rb +3 -3
  64. data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
  65. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  66. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
  68. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  69. data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
  70. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +5 -5
  71. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +12 -4
  72. data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
  73. data/lib/active_merchant/billing/gateways/forte.rb +9 -8
  74. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/global_collect.rb +5 -5
  76. data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
  77. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  78. data/lib/active_merchant/billing/gateways/hps.rb +3 -3
  79. data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
  80. data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
  81. data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
  82. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  83. data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
  84. data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
  85. data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
  86. data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
  87. data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
  88. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
  89. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  90. data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
  91. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  92. data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
  93. data/lib/active_merchant/billing/gateways/litle.rb +10 -5
  94. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  95. data/lib/active_merchant/billing/gateways/mercado_pago.rb +12 -6
  96. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
  97. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  98. data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
  100. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
  101. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
  102. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  103. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
  104. data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
  105. data/lib/active_merchant/billing/gateways/migs.rb +1 -1
  106. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
  107. data/lib/active_merchant/billing/gateways/monei.rb +2 -2
  108. data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
  109. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  110. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  111. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
  112. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  113. data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
  114. data/lib/active_merchant/billing/gateways/netaxept.rb +3 -3
  115. data/lib/active_merchant/billing/gateways/netbanx.rb +51 -23
  116. data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
  117. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  118. data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
  119. data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
  120. data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
  121. data/lib/active_merchant/billing/gateways/omise.rb +1 -1
  122. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  123. data/lib/active_merchant/billing/gateways/opp.rb +2 -2
  124. data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
  125. data/lib/active_merchant/billing/gateways/orbital.rb +49 -7
  126. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
  127. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
  128. data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
  129. data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
  130. data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
  132. data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
  134. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
  135. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
  137. data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
  138. data/lib/active_merchant/billing/gateways/payex.rb +13 -13
  139. data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
  140. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
  143. data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
  144. data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
  146. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
  149. data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
  150. data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -8
  151. data/lib/active_merchant/billing/gateways/payway.rb +1 -1
  152. data/lib/active_merchant/billing/gateways/pin.rb +2 -2
  153. data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
  154. data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
  155. data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
  157. data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
  158. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  159. data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
  160. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
  161. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
  162. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  163. data/lib/active_merchant/billing/gateways/realex.rb +11 -4
  164. data/lib/active_merchant/billing/gateways/redsys.rb +5 -5
  165. data/lib/active_merchant/billing/gateways/s5.rb +1 -1
  166. data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
  167. data/lib/active_merchant/billing/gateways/sage.rb +3 -3
  168. data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
  169. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
  170. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
  171. data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
  172. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
  173. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  174. data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
  175. data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
  176. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  177. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  178. data/lib/active_merchant/billing/gateways/stripe.rb +13 -8
  179. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +46 -3
  180. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/telr.rb +4 -4
  182. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  183. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  184. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
  185. data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
  186. data/lib/active_merchant/billing/gateways/transax.rb +1 -1
  187. data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
  188. data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
  189. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
  190. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
  191. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  192. data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
  193. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
  194. data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
  195. data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
  196. data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
  197. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
  198. data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
  199. data/lib/active_merchant/billing/gateways/worldpay.rb +8 -8
  200. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
  201. data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
  202. data/lib/active_merchant/connection.rb +40 -42
  203. data/lib/active_merchant/network_connection_retries.rb +10 -12
  204. data/lib/active_merchant/version.rb +1 -1
  205. data/lib/support/gateway_support.rb +1 -1
  206. metadata +36 -36
@@ -5,7 +5,7 @@ module ActiveMerchant
5
5
 
6
6
  self.supported_countries = %w(AU CA CN FR DE GI IL MT MU MX NL NZ PA PH RU SG KR ES KN GB US)
7
7
  self.default_currency = 'USD'
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
8
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
9
9
 
10
10
  self.homepage_url = 'http://www.ezic.com/'
11
11
  self.display_name = 'Ezic'
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = ['AU']
10
10
  self.default_currency = 'AUD'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
12
+ self.supported_cardtypes = %i[visa master american_express jcb]
13
13
 
14
14
  self.homepage_url = 'https://www.fatzebra.com.au/'
15
15
  self.display_name = 'Fat Zebra'
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
48
48
  end
49
49
 
50
50
  def capture(money, authorization, options = {})
51
- txn_id, _ = authorization.to_s.split('|')
51
+ txn_id, = authorization.to_s.split('|')
52
52
  post = {}
53
53
 
54
54
  add_amount(post, money, options)
@@ -58,7 +58,7 @@ module ActiveMerchant #:nodoc:
58
58
  end
59
59
 
60
60
  def refund(money, authorization, options={})
61
- txn_id, _ = authorization.to_s.split('|')
61
+ txn_id, = authorization.to_s.split('|')
62
62
  post = {}
63
63
 
64
64
  add_extra_options(post, options)
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
  post[:cvv] = creditcard.verification_value if creditcard.verification_value?
111
111
  post[:card_holder] = creditcard.name if creditcard.name
112
112
  elsif creditcard.is_a?(String)
113
- id, _ = creditcard.to_s.split('|')
113
+ id, = creditcard.to_s.split('|')
114
114
  post[:card_token] = id
115
115
  post[:cvv] = options[:cvv]
116
116
  elsif creditcard.is_a?(Hash)
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
  self.default_currency = 'CAD'
13
13
 
14
14
  # The card types supported by the payment gateway
15
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
15
+ self.supported_cardtypes = %i[visa master american_express discover]
16
16
 
17
17
  # The homepage URL of the gateway
18
18
  self.homepage_url = 'http://www.federatedcanada.com/'
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
7
7
  self.test_url = 'https://entegrasyon.asseco-see.com.tr/fim/api'
8
8
 
9
9
  # The countries the gateway supports merchants from as 2 digit ISO country codes
10
- self.supported_countries = ['US', 'TR']
10
+ self.supported_countries = %w[US TR]
11
11
 
12
12
  # The card types supported by the payment gateway
13
- self.supported_cardtypes = [:visa, :master]
13
+ self.supported_cardtypes = %i[visa master]
14
14
 
15
15
  # The homepage URL of the gateway
16
16
  self.homepage_url = 'https://www.fbwebpos.com/'
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
  self.live_url = 'https://api.firstgiving.com'
8
8
 
9
9
  self.supported_countries = ['US']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
10
+ self.supported_cardtypes = %i[visa master american_express discover]
11
11
  self.homepage_url = 'http://www.firstgiving.com/'
12
12
  self.default_currency = 'USD'
13
13
  self.display_name = 'FirstGiving'
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  self.supported_countries = ['US']
9
9
  self.default_currency = 'USD'
10
10
  self.money_format = :dollars
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
 
13
13
  self.homepage_url = 'http://1stpaygateway.net/'
14
14
  self.display_name = '1stPayGateway.Net'
@@ -22,7 +22,7 @@ module ActiveMerchant #:nodoc:
22
22
 
23
23
  SUCCESS = 'true'
24
24
 
25
- SENSITIVE_FIELDS = [:verification_str2, :expiry_date, :card_number]
25
+ SENSITIVE_FIELDS = %i[verification_str2 expiry_date card_number]
26
26
 
27
27
  BRANDS = {
28
28
  visa: 'Visa',
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  DEFAULT_ECI = '07'
38
38
 
39
39
  self.supported_cardtypes = BRANDS.keys
40
- self.supported_countries = ['CA', 'US']
40
+ self.supported_countries = %w[CA US]
41
41
  self.default_currency = 'USD'
42
42
  self.homepage_url = 'http://www.firstdata.com'
43
43
  self.display_name = 'FirstData Global Gateway e4'
@@ -217,7 +217,7 @@ module ActiveMerchant #:nodoc:
217
217
  end
218
218
 
219
219
  def add_identification(xml, identification)
220
- authorization_num, transaction_tag, _ = identification.split(';')
220
+ authorization_num, transaction_tag, = identification.split(';')
221
221
 
222
222
  xml.tag! 'Authorization_Num', authorization_num
223
223
  xml.tag! 'Transaction_Tag', transaction_tag
@@ -255,14 +255,14 @@ module ActiveMerchant #:nodoc:
255
255
  (credit_card.respond_to?(:eci) ? credit_card.eci : nil) || options[:eci] || DEFAULT_ECI
256
256
  end
257
257
 
258
- xml.tag! 'Ecommerce_Flag', eci.to_s =~ /^[0-9]+$/ ? eci.to_s.rjust(2, '0') : eci
258
+ xml.tag! 'Ecommerce_Flag', /^[0-9]+$/.match?(eci.to_s) ? eci.to_s.rjust(2, '0') : eci
259
259
  end
260
260
 
261
261
  def add_credit_card_verification_strings(xml, credit_card, options)
262
262
  address = options[:billing_address] || options[:address]
263
263
  if address
264
264
  address_values = []
265
- [:address1, :zip, :city, :state, :country].each { |part| address_values << address[part].to_s }
265
+ %i[address1 zip city state country].each { |part| address_values << address[part].to_s.tr("\r\n", ' ').strip }
266
266
  xml.tag! 'VerificationStr1', address_values.join('|')
267
267
  end
268
268
 
@@ -16,7 +16,7 @@ module ActiveMerchant #:nodoc:
16
16
 
17
17
  SUCCESS = 'true'
18
18
 
19
- SENSITIVE_FIELDS = [:cvdcode, :expiry_date, :card_number]
19
+ SENSITIVE_FIELDS = %i[cvdcode expiry_date card_number]
20
20
 
21
21
  BRANDS = {
22
22
  visa: 'Visa',
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
29
29
  DEFAULT_ECI = '07'
30
30
 
31
31
  self.supported_cardtypes = BRANDS.keys
32
- self.supported_countries = ['CA', 'US']
32
+ self.supported_countries = %w[CA US]
33
33
  self.default_currency = 'USD'
34
34
  self.homepage_url = 'http://www.firstdata.com'
35
35
  self.display_name = 'FirstData Global Gateway e4 v27'
@@ -191,7 +191,7 @@ module ActiveMerchant #:nodoc:
191
191
  end
192
192
 
193
193
  def add_identification(xml, identification)
194
- authorization_num, transaction_tag, _ = identification.split(';')
194
+ authorization_num, transaction_tag, = identification.split(';')
195
195
 
196
196
  xml.tag! 'Authorization_Num', authorization_num
197
197
  xml.tag! 'Transaction_Tag', transaction_tag
@@ -229,7 +229,7 @@ module ActiveMerchant #:nodoc:
229
229
  (credit_card.respond_to?(:eci) ? credit_card.eci : nil) || options[:eci] || DEFAULT_ECI
230
230
  end
231
231
 
232
- xml.tag! 'Ecommerce_Flag', eci.to_s =~ /^[0-9]+$/ ? eci.to_s.rjust(2, '0') : eci
232
+ xml.tag! 'Ecommerce_Flag', /^[0-9]+$/.match?(eci.to_s) ? eci.to_s.rjust(2, '0') : eci
233
233
  end
234
234
 
235
235
  def add_credit_card_verification_strings(xml, credit_card, options)
@@ -287,6 +287,8 @@ module ActiveMerchant #:nodoc:
287
287
 
288
288
  def add_address(xml, options)
289
289
  if (address = options[:billing_address] || options[:address])
290
+ address = strip_line_breaks(address)
291
+
290
292
  xml.tag! 'Address' do
291
293
  xml.tag! 'Address1', address[:address1]
292
294
  xml.tag! 'Address2', address[:address2] if address[:address2]
@@ -299,6 +301,12 @@ module ActiveMerchant #:nodoc:
299
301
  end
300
302
  end
301
303
 
304
+ def strip_line_breaks(address)
305
+ return unless address.is_a?(Hash)
306
+
307
+ Hash[address.map { |k, s| [k, s&.tr("\r\n", ' ')&.strip] }]
308
+ end
309
+
302
310
  def add_invoice(xml, options)
303
311
  xml.tag! 'Reference_No', options[:order_id]
304
312
  xml.tag! 'Reference_3', options[:description] if options[:description]
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  self.supported_countries = ['NZ']
11
11
  self.default_currency = 'NZD'
12
12
  self.money_format = :dollars
13
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
13
+ self.supported_cardtypes = %i[visa master american_express diners_club]
14
14
 
15
15
  BRAND_MAP = {
16
16
  'visa' => 'VISA',
@@ -142,15 +142,15 @@ module ActiveMerchant #:nodoc:
142
142
  end
143
143
 
144
144
  def envelope_wrap(action, body)
145
- <<-EOS
146
- <?xml version="1.0" encoding="utf-8"?>
147
- <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
148
- <soap12:Body>
149
- <#{action} xmlns="http://www.flo2cash.co.nz/webservices/paymentwebservice">
150
- #{body}
151
- </#{action}>
152
- </soap12:Body>
153
- </soap12:Envelope>
145
+ <<~EOS
146
+ <?xml version="1.0" encoding="utf-8"?>
147
+ <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
148
+ <soap12:Body>
149
+ <#{action} xmlns="http://www.flo2cash.co.nz/webservices/paymentwebservice">
150
+ #{body}
151
+ </#{action}>
152
+ </soap12:Body>
153
+ </soap12:Envelope>
154
154
  EOS
155
155
  end
156
156
 
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
 
11
11
  self.supported_countries = ['US']
12
12
  self.default_currency = 'USD'
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
13
+ self.supported_cardtypes = %i[visa master american_express discover]
14
14
 
15
15
  self.homepage_url = 'https://www.forte.net'
16
16
  self.display_name = 'Forte'
@@ -24,7 +24,7 @@ module ActiveMerchant #:nodoc:
24
24
  post = {}
25
25
  add_amount(post, money, options)
26
26
  add_invoice(post, options)
27
- add_payment_method(post, payment_method)
27
+ add_payment_method(post, payment_method, options)
28
28
  add_billing_address(post, payment_method, options)
29
29
  add_shipping_address(post, options)
30
30
  post[:action] = 'sale'
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
36
36
  post = {}
37
37
  add_amount(post, money, options)
38
38
  add_invoice(post, options)
39
- add_payment_method(post, payment_method)
39
+ add_payment_method(post, payment_method, options)
40
40
  add_billing_address(post, payment_method, options)
41
41
  add_shipping_address(post, options)
42
42
  post[:action] = 'authorize'
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
  post = {}
58
58
  add_amount(post, money, options)
59
59
  add_invoice(post, options)
60
- add_payment_method(post, payment_method)
60
+ add_payment_method(post, payment_method, options)
61
61
  add_billing_address(post, payment_method, options)
62
62
  post[:action] = 'disburse'
63
63
 
@@ -151,21 +151,22 @@ module ActiveMerchant #:nodoc:
151
151
  post[:shipping_address][:physical_address][:locality] = address[:city] if address[:city]
152
152
  end
153
153
 
154
- def add_payment_method(post, payment_method)
154
+ def add_payment_method(post, payment_method, options)
155
155
  if payment_method.respond_to?(:brand)
156
156
  add_credit_card(post, payment_method)
157
157
  else
158
- add_echeck(post, payment_method)
158
+ add_echeck(post, payment_method, options)
159
159
  end
160
160
  end
161
161
 
162
- def add_echeck(post, payment)
162
+ def add_echeck(post, payment, options)
163
163
  post[:echeck] = {}
164
164
  post[:echeck][:account_holder] = payment.name
165
165
  post[:echeck][:account_number] = payment.account_number
166
166
  post[:echeck][:routing_number] = payment.routing_number
167
167
  post[:echeck][:account_type] = payment.account_type
168
168
  post[:echeck][:check_number] = payment.number
169
+ post[:echeck][:sec_code] = options[:sec_code] || 'PPD'
169
170
  end
170
171
 
171
172
  def add_credit_card(post, payment)
@@ -259,7 +260,7 @@ module ActiveMerchant #:nodoc:
259
260
  end
260
261
 
261
262
  def transaction_id_from(authorization)
262
- transaction_id, _, original_auth_transaction_id, _ = split_authorization(authorization)
263
+ transaction_id, _, original_auth_transaction_id, = split_authorization(authorization)
263
264
  original_auth_transaction_id.present? ? original_auth_transaction_id : transaction_id
264
265
  end
265
266
  end
@@ -5,10 +5,10 @@ module ActiveMerchant #:nodoc:
5
5
  self.test_url = 'https://sanalposprovtest.garanti.com.tr/VPServlet'
6
6
 
7
7
  # The countries the gateway supports merchants from as 2 digit ISO country codes
8
- self.supported_countries = ['US', 'TR']
8
+ self.supported_countries = %w[US TR]
9
9
 
10
10
  # The card types supported by the payment gateway
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
 
13
13
  # The homepage URL of the gateway
14
14
  self.homepage_url = 'https://sanalposweb.garanti.com.tr'
@@ -291,11 +291,11 @@ module ActiveMerchant #:nodoc:
291
291
  end
292
292
 
293
293
  def auth_digest(action, post, authorization = nil)
294
- data = <<-EOS
295
- POST
296
- #{content_type}
297
- #{date}
298
- #{uri(action, authorization)}
294
+ data = <<~EOS
295
+ POST
296
+ #{content_type}
297
+ #{date}
298
+ #{uri(action, authorization)}
299
299
  EOS
300
300
  digest = OpenSSL::Digest.new('sha256')
301
301
  key = @options[:secret_api_key]
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
 
9
9
  self.supported_countries = %w(CA PR US)
10
10
  self.default_currency = 'USD'
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
11
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
12
12
 
13
13
  self.homepage_url = 'https://www.globalpaymentsinc.com'
14
14
  self.display_name = 'Global Transport'
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
  self.supported_countries = ['IN']
13
13
  self.default_currency = 'INR'
14
14
  self.money_format = :dollars
15
- self.supported_cardtypes = [:visa, :master, :discover, :diners_club]
15
+ self.supported_cardtypes = %i[visa master discover diners_club]
16
16
 
17
17
  def initialize(options={})
18
18
  requires!(options, :login, :password)
@@ -81,14 +81,14 @@ module ActiveMerchant #:nodoc:
81
81
  post[:udf2] = escape(options[:email]) if options[:email]
82
82
  if address = (options[:billing_address] || options[:address])
83
83
  post[:udf3] = escape(address[:phone]) if address[:phone]
84
- post[:udf4] = escape(<<EOA)
85
- #{address[:name]}
86
- #{address[:company]}
87
- #{address[:address1]}
88
- #{address[:address2]}
89
- #{address[:city]} #{address[:state]} #{address[:zip]}
90
- #{address[:country]}
91
- EOA
84
+ post[:udf4] = escape(<<~EOA)
85
+ #{address[:name]}
86
+ #{address[:company]}
87
+ #{address[:address1]}
88
+ #{address[:address2]}
89
+ #{address[:city]} #{address[:state]} #{address[:zip]}
90
+ #{address[:country]}
91
+ EOA
92
92
  end
93
93
  end
94
94
 
@@ -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 = [:visa, :master, :american_express, :discover, :jbc, :diners_club]
11
+ self.supported_cardtypes = %i[visa master american_express discover jbc diners_club]
12
12
 
13
13
  self.homepage_url = 'http://developer.heartlandpaymentsystems.com/SecureSubmit/'
14
14
  self.display_name = 'Heartland Payment Systems'
@@ -201,9 +201,9 @@ module ActiveMerchant #:nodoc:
201
201
  xml.hps :RoutingNumber, check.routing_number
202
202
  xml.hps :AccountNumber, check.account_number
203
203
  xml.hps :CheckNumber, check.number
204
- xml.hps :AccountType, check.account_type.upcase
204
+ xml.hps :AccountType, check.account_type&.upcase
205
205
  end
206
- xml.hps :CheckType, check.account_holder_type.upcase
206
+ xml.hps :CheckType, check.account_holder_type&.upcase
207
207
  end
208
208
 
209
209
  def add_details(xml, options)
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
 
9
9
  self.supported_countries = %w(AU BR CA CH DE DK ES FI FR GR HK IE IT NL NO PT SE SG TR GB US TH ID PH BE)
10
10
  self.default_currency = 'USD'
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
 
13
13
  self.homepage_url = 'http://home.iatspayments.com/'
14
14
  self.display_name = 'iATS Payments'
@@ -260,7 +260,7 @@ module ActiveMerchant #:nodoc:
260
260
  end
261
261
 
262
262
  def authorization_from(action, response)
263
- if [:store, :unstore].include?(action)
263
+ if %i[store unstore].include?(action)
264
264
  response[:customercode]
265
265
  elsif [:purchase_check].include?(action)
266
266
  response[:transaction_id] ? "#{response[:transaction_id]}|check" : nil
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  self.live_url = self.test_url = 'https://secure.inspiregateway.net/api/transact.php'
6
6
 
7
7
  self.supported_countries = ['US']
8
- self.supported_cardtypes = [:visa, :master, :american_express]
8
+ self.supported_cardtypes = %i[visa master american_express]
9
9
  self.homepage_url = 'http://www.inspiregateway.com'
10
10
  self.display_name = 'Inspire Commerce'
11
11
 
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  self.money_format = :dollars
9
9
  self.default_currency = 'USD'
10
10
  # The card types supported by the payment gateway
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
 
13
13
  # The homepage URL of the gateway
14
14
  self.homepage_url = 'http://www.instapayllc.com'
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
  self.test_url = 'https://demo.ippayments.com.au/interface/api/dts.asmx'
8
8
 
9
9
  self.supported_countries = ['AU']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
10
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb]
11
11
 
12
12
  self.homepage_url = 'http://www.ippayments.com.au/'
13
13
  self.display_name = 'IPP'
@@ -10,12 +10,12 @@ module ActiveMerchant #:nodoc:
10
10
  self.live_url = self.test_url = 'https://gw1.iridiumcorp.net/'
11
11
 
12
12
  # The countries the gateway supports merchants from as 2 digit ISO country codes
13
- self.supported_countries = ['GB', 'ES']
13
+ self.supported_countries = %w[GB ES]
14
14
  self.default_currency = 'EUR'
15
15
  self.money_format = :cents
16
16
 
17
17
  # The card types supported by the payment gateway
18
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :maestro, :jcb, :diners_club]
18
+ self.supported_cardtypes = %i[visa master american_express discover maestro jcb diners_club]
19
19
 
20
20
  # The homepage URL of the gateway
21
21
  self.homepage_url = 'http://www.iridiumcorp.co.uk/'
@@ -288,7 +288,7 @@ module ActiveMerchant #:nodoc:
288
288
 
289
289
  def build_reference_request(type, money, authorization, options)
290
290
  options[:action] = 'CrossReferenceTransaction'
291
- order_id, cross_reference, _ = authorization.split(';')
291
+ order_id, cross_reference, = authorization.split(';')
292
292
  build_request(options) do |xml|
293
293
  if money
294
294
  currency = options[:currency] || currency(money)