activemerchant 1.108.0 → 1.113.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +69 -0
  3. data/README.md +2 -2
  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 +3 -1
  7. data/lib/active_merchant/billing/credit_card_methods.rb +10 -7
  8. data/lib/active_merchant/billing/gateway.rb +1 -1
  9. data/lib/active_merchant/billing/gateways/adyen.rb +25 -14
  10. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  11. data/lib/active_merchant/billing/gateways/authorize_net.rb +13 -13
  12. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  13. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +4 -4
  14. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  15. data/lib/active_merchant/billing/gateways/balanced.rb +2 -2
  16. data/lib/active_merchant/billing/gateways/bambora_apac.rb +3 -3
  17. data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
  18. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  19. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
  20. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  21. data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
  22. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
  23. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -2
  24. data/lib/active_merchant/billing/gateways/blue_snap.rb +50 -13
  25. data/lib/active_merchant/billing/gateways/borgun.rb +4 -4
  26. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/braintree_blue.rb +85 -35
  29. data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
  30. data/lib/active_merchant/billing/gateways/cams.rb +2 -2
  31. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
  34. data/lib/active_merchant/billing/gateways/cardknox.rb +5 -5
  35. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
  38. data/lib/active_merchant/billing/gateways/cenpos.rb +13 -13
  39. data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
  40. data/lib/active_merchant/billing/gateways/checkout_v2.rb +3 -3
  41. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/clearhaus.rb +3 -3
  43. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  45. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
  46. data/lib/active_merchant/billing/gateways/credorax.rb +13 -3
  47. data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
  48. data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
  49. data/lib/active_merchant/billing/gateways/cyber_source.rb +66 -20
  50. data/lib/active_merchant/billing/gateways/d_local.rb +7 -3
  51. data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
  52. data/lib/active_merchant/billing/gateways/decidir.rb +1 -1
  53. data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
  54. data/lib/active_merchant/billing/gateways/digitzs.rb +3 -3
  55. data/lib/active_merchant/billing/gateways/ebanx.rb +4 -4
  56. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -3
  57. data/lib/active_merchant/billing/gateways/elavon.rb +1 -1
  58. data/lib/active_merchant/billing/gateways/element.rb +7 -3
  59. data/lib/active_merchant/billing/gateways/epay.rb +3 -3
  60. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/eway.rb +1 -1
  62. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  63. data/lib/active_merchant/billing/gateways/eway_rapid.rb +4 -4
  64. data/lib/active_merchant/billing/gateways/exact.rb +3 -3
  65. data/lib/active_merchant/billing/gateways/ezic.rb +2 -2
  66. data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -7
  67. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
  69. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  70. data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +4 -4
  72. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +11 -3
  73. data/lib/active_merchant/billing/gateways/flo2cash.rb +11 -11
  74. data/lib/active_merchant/billing/gateways/forte.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  76. data/lib/active_merchant/billing/gateways/global_collect.rb +10 -5
  77. data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
  78. data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
  79. data/lib/active_merchant/billing/gateways/hps.rb +10 -7
  80. data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
  81. data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
  82. data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
  83. data/lib/active_merchant/billing/gateways/ipp.rb +3 -3
  84. data/lib/active_merchant/billing/gateways/iridium.rb +5 -5
  85. data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
  86. data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
  87. data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
  88. data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
  89. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
  90. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  91. data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
  92. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  93. data/lib/active_merchant/billing/gateways/linkpoint.rb +3 -3
  94. data/lib/active_merchant/billing/gateways/litle.rb +5 -5
  95. data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
  96. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  97. data/lib/active_merchant/billing/gateways/mercado_pago.rb +12 -7
  98. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  100. data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
  101. data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
  102. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
  103. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
  104. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  105. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
  106. data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
  107. data/lib/active_merchant/billing/gateways/migs.rb +1 -1
  108. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
  109. data/lib/active_merchant/billing/gateways/monei.rb +2 -2
  110. data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
  111. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  112. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  113. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
  114. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  115. data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/netaxept.rb +2 -2
  117. data/lib/active_merchant/billing/gateways/netbanx.rb +53 -23
  118. data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
  119. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  120. data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
  121. data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
  122. data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/omise.rb +1 -1
  124. data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
  125. data/lib/active_merchant/billing/gateways/opp.rb +4 -4
  126. data/lib/active_merchant/billing/gateways/optimal_payment.rb +5 -5
  127. data/lib/active_merchant/billing/gateways/orbital.rb +14 -7
  128. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
  129. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
  130. data/lib/active_merchant/billing/gateways/pagarme.rb +3 -3
  131. data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
  132. data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
  134. data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/pay_junction.rb +5 -5
  136. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
  137. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  138. data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
  139. data/lib/active_merchant/billing/gateways/payeezy.rb +5 -5
  140. data/lib/active_merchant/billing/gateways/payex.rb +18 -18
  141. data/lib/active_merchant/billing/gateways/payflow.rb +8 -5
  142. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
  143. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  144. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
  146. data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/paymill.rb +4 -4
  148. data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
  149. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  150. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  151. data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
  152. data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
  153. data/lib/active_merchant/billing/gateways/payu_latam.rb +10 -8
  154. data/lib/active_merchant/billing/gateways/payway.rb +1 -1
  155. data/lib/active_merchant/billing/gateways/pin.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -6
  157. data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
  158. data/lib/active_merchant/billing/gateways/psigate.rb +2 -2
  159. data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
  160. data/lib/active_merchant/billing/gateways/qbms.rb +4 -4
  161. data/lib/active_merchant/billing/gateways/quantum.rb +3 -3
  162. data/lib/active_merchant/billing/gateways/quickbooks.rb +9 -8
  163. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
  164. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
  165. data/lib/active_merchant/billing/gateways/qvalent.rb +2 -2
  166. data/lib/active_merchant/billing/gateways/realex.rb +2 -1
  167. data/lib/active_merchant/billing/gateways/redsys.rb +7 -7
  168. data/lib/active_merchant/billing/gateways/s5.rb +1 -1
  169. data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
  170. data/lib/active_merchant/billing/gateways/sage.rb +3 -3
  171. data/lib/active_merchant/billing/gateways/sage_pay.rb +7 -7
  172. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
  173. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
  174. data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
  175. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
  176. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  177. data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
  178. data/lib/active_merchant/billing/gateways/skip_jack.rb +6 -6
  179. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
  180. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/stripe.rb +8 -8
  182. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +20 -1
  183. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/telr.rb +5 -5
  185. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  186. data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
  187. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +3 -3
  188. data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -1
  189. data/lib/active_merchant/billing/gateways/transax.rb +1 -1
  190. data/lib/active_merchant/billing/gateways/trexle.rb +1 -1
  191. data/lib/active_merchant/billing/gateways/trust_commerce.rb +12 -12
  192. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +10 -10
  193. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +2 -2
  194. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  195. data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
  196. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
  197. data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
  198. data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
  199. data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
  200. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
  201. data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
  202. data/lib/active_merchant/billing/gateways/worldpay.rb +6 -6
  203. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
  204. data/lib/active_merchant/billing/gateways/worldpay_us.rb +3 -3
  205. data/lib/active_merchant/version.rb +1 -1
  206. data/lib/support/gateway_support.rb +1 -1
  207. metadata +45 -31
@@ -21,7 +21,7 @@ module ActiveMerchant
21
21
  # American Express, Diners Club, JCB, International Maestro,
22
22
  # Style, Clydesdale Financial Services, Other
23
23
 
24
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb, :maestro]
24
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb maestro]
25
25
  self.homepage_url = 'http://www.paymentsolutionsltd.com/'
26
26
  self.display_name = 'PSL Payment Solutions'
27
27
 
@@ -183,7 +183,7 @@ module ActiveMerchant
183
183
  address = options[:billing_address] || options[:address]
184
184
  return if address.nil?
185
185
 
186
- post[:QAAddress] = [:address1, :address2, :city, :state].collect { |a| address[a] }.reject(&:blank?).join(' ')
186
+ post[:QAAddress] = %i[address1 address2 city state].collect { |a| address[a] }.reject(&:blank?).join(' ')
187
187
  post[:QAPostcode] = address[:zip]
188
188
  end
189
189
 
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  self.homepage_url = 'http://payments.intuit.com/'
12
12
  self.display_name = 'QuickBooks Merchant Services'
13
13
  self.default_currency = 'USD'
14
- self.supported_cardtypes = [:visa, :master, :discover, :american_express, :diners_club, :jcb]
14
+ self.supported_cardtypes = %i[visa master discover american_express diners_club jcb]
15
15
  self.supported_countries = ['US']
16
16
 
17
17
  TYPES = {
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
20
20
  purchase: 'CustomerCreditCardCharge',
21
21
  refund: 'CustomerCreditCardTxnVoidOrRefund',
22
22
  void: 'CustomerCreditCardTxnVoid',
23
- query: 'MerchantAccountQuery',
23
+ query: 'MerchantAccountQuery'
24
24
  }
25
25
 
26
26
  # Creates a new QbmsGateway
@@ -168,7 +168,7 @@ module ActiveMerchant #:nodoc:
168
168
  if status_code != 0
169
169
  return {
170
170
  status_code: status_code,
171
- status_message: signon.attributes['statusMessage'],
171
+ status_message: signon.attributes['statusMessage']
172
172
  }
173
173
  end
174
174
 
@@ -176,7 +176,7 @@ module ActiveMerchant #:nodoc:
176
176
 
177
177
  results = {
178
178
  status_code: response.attributes['statusCode'].to_i,
179
- status_message: response.attributes['statusMessage'],
179
+ status_message: response.attributes['statusMessage']
180
180
  }
181
181
 
182
182
  response.elements.each do |e|
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
13
13
  self.live_url = self.test_url = 'https://secure.quantumgateway.com/cgi/xml_requester.php'
14
14
 
15
15
  # visa, master, american_express, discover
16
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
16
+ self.supported_cardtypes = %i[visa master american_express discover]
17
17
  self.supported_countries = ['US']
18
18
  self.default_currency = 'USD'
19
19
  self.money_format = :dollars
@@ -95,7 +95,7 @@ module ActiveMerchant #:nodoc:
95
95
  def build_capture_request(money, authorization, options)
96
96
  xml = Builder::XmlMarkup.new
97
97
  add_common_credit_card_info(xml, 'PREVIOUS_SALE')
98
- transaction_id, _ = authorization_parts_from(authorization)
98
+ transaction_id, = authorization_parts_from(authorization)
99
99
  add_transaction_id(xml, transaction_id)
100
100
  xml.target!
101
101
  end
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
116
116
  def build_void_request(authorization, options)
117
117
  xml = Builder::XmlMarkup.new
118
118
  add_common_credit_card_info(xml, 'VOID')
119
- transaction_id, _ = authorization_parts_from(authorization)
119
+ transaction_id, = authorization_parts_from(authorization)
120
120
  add_transaction_id(xml, transaction_id)
121
121
  xml.target!
122
122
  end
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.supported_countries = ['US']
8
8
  self.default_currency = 'USD'
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners]
9
+ self.supported_cardtypes = %i[visa master american_express discover diners]
10
10
 
11
11
  self.homepage_url = 'http://payments.intuit.com'
12
12
  self.display_name = 'QuickBooks Payments'
@@ -83,7 +83,7 @@ module ActiveMerchant #:nodoc:
83
83
 
84
84
  def capture(money, authorization, options = {})
85
85
  post = {}
86
- authorization, _ = split_authorization(authorization)
86
+ authorization, = split_authorization(authorization)
87
87
  post[:amount] = localized_amount(money, currency(money))
88
88
  add_context(post, options)
89
89
 
@@ -95,7 +95,7 @@ module ActiveMerchant #:nodoc:
95
95
  post = {}
96
96
  post[:amount] = localized_amount(money, currency(money))
97
97
  add_context(post, options)
98
- authorization, _ = split_authorization(authorization)
98
+ authorization, = split_authorization(authorization)
99
99
 
100
100
  response = commit(refund_uri(authorization), post)
101
101
  check_token_response(response, refund_uri(authorization), post, options)
@@ -151,8 +151,9 @@ module ActiveMerchant #:nodoc:
151
151
  if address = options[:billing_address] || options[:address]
152
152
  card_address[:streetAddress] = address[:address1]
153
153
  card_address[:city] = address[:city]
154
- card_address[:region] = address[:state] || address[:region]
155
- card_address[:country] = address[:country]
154
+ region = address[:state] || address[:region]
155
+ card_address[:region] = region if region.present?
156
+ card_address[:country] = address[:country] if address[:country].present?
156
157
  card_address[:postalCode] = address[:zip] if address[:zip]
157
158
  end
158
159
  post[:card][:address] = card_address
@@ -239,7 +240,7 @@ module ActiveMerchant #:nodoc:
239
240
  def headers(method, uri)
240
241
  return oauth_v2_headers if @options[:refresh_token]
241
242
 
242
- raise ArgumentError, "Invalid HTTP method: #{method}. Valid methods are :post and :get" unless [:post, :get].include?(method)
243
+ raise ArgumentError, "Invalid HTTP method: #{method}. Valid methods are :post and :get" unless %i[post get].include?(method)
243
244
 
244
245
  request_uri = URI.parse(uri)
245
246
 
@@ -323,7 +324,7 @@ module ActiveMerchant #:nodoc:
323
324
  def success?(response)
324
325
  return FRAUD_WARNING_CODES.concat(['0']).include?(response['errors'].first['code']) if response['errors']
325
326
 
326
- !['DECLINED', 'CANCELLED'].include?(response['status']) && !['AuthenticationFailed', 'AuthorizationFailed'].include?(response['code'])
327
+ !%w[DECLINED CANCELLED].include?(response['status']) && !%w[AuthenticationFailed AuthorizationFailed].include?(response['code'])
327
328
  end
328
329
 
329
330
  def message_from(response)
@@ -331,7 +332,7 @@ module ActiveMerchant #:nodoc:
331
332
  end
332
333
 
333
334
  def errors_from(response)
334
- if ['AuthenticationFailed', 'AuthorizationFailed'].include?(response['code'])
335
+ if %w[AuthenticationFailed AuthorizationFailed].include?(response['code'])
335
336
  response['code']
336
337
  else
337
338
  response['errors'].present? ? STANDARD_ERROR_CODE_MAPPING[response['errors'].first['code']] : ''
@@ -168,9 +168,9 @@ module QuickpayCommon
168
168
  base.default_currency = 'DKK'
169
169
  base.money_format = :cents
170
170
 
171
- base.supported_cardtypes = [:dankort, :forbrugsforeningen, :visa, :master,
172
- :american_express, :diners_club, :jcb, :maestro]
173
- base.supported_countries = ['DE', 'DK', 'ES', 'FI', 'FR', 'FO', 'GB', 'IS', 'NO', 'SE']
171
+ base.supported_countries = %w[DE DK ES FI FR FO GB IS NO SE]
172
+ base.supported_cardtypes = %i[dankort forbrugsforeningen visa master
173
+ american_express diners_club jcb maestro]
174
174
  base.homepage_url = 'http://quickpay.net/'
175
175
  base.display_name = 'QuickPay'
176
176
  end
@@ -24,11 +24,11 @@ module ActiveMerchant
24
24
  r.process {
25
25
  post = authorization_params(money, credit_card_or_reference, options)
26
26
  add_autocapture(post, false)
27
- commit(synchronized_path("/payments/#{r.responses.last.params["id"]}/authorize"), post)
27
+ commit(synchronized_path("/payments/#{r.responses.last.params['id']}/authorize"), post)
28
28
  }
29
29
  r.process {
30
30
  post = capture_params(money, credit_card_or_reference, options)
31
- commit(synchronized_path("/payments/#{r.responses.last.params["id"]}/capture"), post)
31
+ commit(synchronized_path("/payments/#{r.responses.last.params['id']}/capture"), post)
32
32
  }
33
33
  end
34
34
  end
@@ -42,7 +42,7 @@ module ActiveMerchant
42
42
  r.process { create_payment(money, options) }
43
43
  r.process {
44
44
  post = authorization_params(money, credit_card_or_reference, options)
45
- commit(synchronized_path("/payments/#{r.responses.last.params["id"]}/authorize"), post)
45
+ commit(synchronized_path("/payments/#{r.responses.last.params['id']}/authorize"), post)
46
46
  }
47
47
  end
48
48
  end
@@ -191,7 +191,7 @@ module ActiveMerchant
191
191
 
192
192
  post[:shipping_address] = map_address(options[:shipping_address]) if options[:shipping_address]
193
193
 
194
- [:metadata, :branding_id, :variables].each do |field|
194
+ %i[metadata branding_id variables].each do |field|
195
195
  post[field] = options[field] if options[field]
196
196
  end
197
197
  end
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  self.supported_countries = ['AU']
11
11
  self.default_currency = 'AUD'
12
12
  self.money_format = :cents
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners]
13
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners]
14
14
 
15
15
  CVV_CODE_MAPPING = {
16
16
  'S' => 'D'
@@ -280,7 +280,7 @@ module ActiveMerchant #:nodoc:
280
280
  '12' => STANDARD_ERROR_CODE[:card_declined],
281
281
  '06' => STANDARD_ERROR_CODE[:processing_error],
282
282
  '01' => STANDARD_ERROR_CODE[:call_issuer],
283
- '04' => STANDARD_ERROR_CODE[:pickup_card],
283
+ '04' => STANDARD_ERROR_CODE[:pickup_card]
284
284
  }
285
285
 
286
286
  def error_code_from(succeeded, response)
@@ -31,7 +31,7 @@ module ActiveMerchant
31
31
 
32
32
  self.money_format = :cents
33
33
  self.default_currency = 'EUR'
34
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
34
+ self.supported_cardtypes = %i[visa master american_express diners_club]
35
35
  self.supported_countries = %w(IE GB FR BE NL LU IT US CA ES)
36
36
  self.homepage_url = 'http://www.realexpayments.com/'
37
37
  self.display_name = 'Realex'
@@ -316,6 +316,7 @@ module ActiveMerchant
316
316
  else
317
317
  xml.tag! 'cavv', three_d_secure[:cavv]
318
318
  xml.tag! 'xid', three_d_secure[:xid]
319
+ version = '1'
319
320
  end
320
321
  xml.tag! 'eci', three_d_secure[:eci]
321
322
  xml.tag! 'message_version', version
@@ -44,7 +44,7 @@ module ActiveMerchant #:nodoc:
44
44
  self.money_format = :cents
45
45
 
46
46
  # Not all card types may be activated by the bank!
47
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :diners_club, :unionpay]
47
+ self.supported_cardtypes = %i[visa master american_express jcb diners_club unionpay]
48
48
  self.homepage_url = 'http://www.redsys.es/'
49
49
  self.display_name = 'Redsys'
50
50
 
@@ -225,7 +225,7 @@ module ActiveMerchant #:nodoc:
225
225
  data = {}
226
226
  add_action(data, :capture)
227
227
  add_amount(data, money, options)
228
- order_id, _, _ = split_authorization(authorization)
228
+ order_id, = split_authorization(authorization)
229
229
  add_order(data, order_id)
230
230
  data[:description] = options[:description]
231
231
 
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
247
247
  data = {}
248
248
  add_action(data, :refund)
249
249
  add_amount(data, money, options)
250
- order_id, _, _ = split_authorization(authorization)
250
+ order_id, = split_authorization(authorization)
251
251
  add_order(data, order_id)
252
252
  data[:description] = options[:description]
253
253
 
@@ -476,11 +476,11 @@ module ActiveMerchant #:nodoc:
476
476
  if validate_signature(params)
477
477
  message = response_text(params[:ds_response])
478
478
  options[:authorization] = build_authorization(params)
479
- success = is_success_response?(params[:ds_response])
479
+ success = success_response?(params[:ds_response])
480
480
  else
481
481
  message = 'Response failed validation check'
482
482
  end
483
- elsif ['iniciaPeticion', 'trataPeticion'].include?(action)
483
+ elsif %w[iniciaPeticion trataPeticion].include?(action)
484
484
  vxml = Nokogiri::XML(data).remove_namespaces!.xpath("//Envelope/Body/#{action}Response/#{action}Return").inner_text
485
485
  xml = Nokogiri::XML(vxml)
486
486
  node = (action == 'iniciaPeticion' ? 'INFOTARJETA' : 'OPERACION')
@@ -490,7 +490,7 @@ module ActiveMerchant #:nodoc:
490
490
  end
491
491
  message = response_text_3ds(xml, params)
492
492
  options[:authorization] = build_authorization(params)
493
- success = params.size > 0 && is_success_response?(params[:ds_response])
493
+ success = params.size > 0 && success_response?(params[:ds_response])
494
494
  else
495
495
  # Some kind of programmer error with the request!
496
496
  message = "#{code} ERROR"
@@ -559,7 +559,7 @@ module ActiveMerchant #:nodoc:
559
559
  message
560
560
  end
561
561
 
562
- def is_success_response?(code)
562
+ def success_response?(code)
563
563
  (code.to_i < 100) || [400, 481, 500, 900].include?(code.to_i)
564
564
  end
565
565
 
@@ -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'
@@ -248,7 +248,7 @@ module ActiveMerchant #:nodoc:
248
248
  add_pair(post, :BillingAddress1, truncate(billing_address[:address1], 100))
249
249
  add_pair(post, :BillingAddress2, truncate(billing_address[:address2], 100))
250
250
  add_pair(post, :BillingCity, truncate(billing_address[:city], 40))
251
- add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if is_usa(billing_address[:country])
251
+ add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if usa?(billing_address[:country])
252
252
  add_pair(post, :BillingCountry, truncate(billing_address[:country], 2))
253
253
  add_pair(post, :BillingPhone, sanitize_phone(billing_address[:phone]))
254
254
  add_pair(post, :BillingPostCode, truncate(billing_address[:zip], 10))
@@ -261,7 +261,7 @@ module ActiveMerchant #:nodoc:
261
261
  add_pair(post, :DeliveryAddress1, truncate(shipping_address[:address1], 100))
262
262
  add_pair(post, :DeliveryAddress2, truncate(shipping_address[:address2], 100))
263
263
  add_pair(post, :DeliveryCity, truncate(shipping_address[:city], 40))
264
- add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if is_usa(shipping_address[:country])
264
+ add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if usa?(shipping_address[:country])
265
265
  add_pair(post, :DeliveryCountry, truncate(shipping_address[:country], 2))
266
266
  add_pair(post, :DeliveryPhone, sanitize_phone(shipping_address[:phone]))
267
267
  add_pair(post, :DeliveryPostCode, truncate(shipping_address[:zip], 10))
@@ -317,7 +317,7 @@ module ActiveMerchant #:nodoc:
317
317
  truncate(cleansed, 20)
318
318
  end
319
319
 
320
- def is_usa(country)
320
+ def usa?(country)
321
321
  truncate(country, 2) == 'US'
322
322
  end
323
323
 
@@ -351,7 +351,7 @@ module ActiveMerchant #:nodoc:
351
351
  authorization: authorization_from(response, parameters, action),
352
352
  avs_result: {
353
353
  street_match: AVS_CODE[response['AddressResult']],
354
- postal_match: AVS_CODE[response['PostCodeResult']],
354
+ postal_match: AVS_CODE[response['PostCodeResult']]
355
355
  },
356
356
  cvv_result: CVV_CODE[response['CV2Result']]
357
357
  )
@@ -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'