activemerchant 1.107.4 → 1.112.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 +63 -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 +23 -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 +82 -34
  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 +67 -19
  49. data/lib/active_merchant/billing/gateways/d_local.rb +20 -6
  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 +4 -4
  55. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
  56. data/lib/active_merchant/billing/gateways/elavon.rb +5 -4
  57. data/lib/active_merchant/billing/gateways/element.rb +8 -4
  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 +9 -7
  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 +3 -3
  74. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/global_collect.rb +10 -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 +1 -1
  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 +5 -5
  94. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  95. data/lib/active_merchant/billing/gateways/mercado_pago.rb +11 -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 +6 -6
  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 +11 -9
  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 +3 -2
  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 +6 -6
  179. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +21 -2
  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 +7 -7
  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 +46 -32
@@ -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'
@@ -166,7 +166,7 @@ module ActiveMerchant #:nodoc:
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] || "WEB"
169
+ post[:echeck][:sec_code] = options[:sec_code] || 'PPD'
170
170
  end
171
171
 
172
172
  def add_credit_card(post, payment)
@@ -260,7 +260,7 @@ module ActiveMerchant #:nodoc:
260
260
  end
261
261
 
262
262
  def transaction_id_from(authorization)
263
- transaction_id, _, original_auth_transaction_id, _ = split_authorization(authorization)
263
+ transaction_id, _, original_auth_transaction_id, = split_authorization(authorization)
264
264
  original_auth_transaction_id.present? ? original_auth_transaction_id : transaction_id
265
265
  end
266
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'
@@ -100,6 +100,7 @@ module ActiveMerchant #:nodoc:
100
100
  'invoiceNumber' => options[:invoice]
101
101
  }
102
102
  add_airline_data(post, options) if options[:airline_data]
103
+ add_number_of_installments(post, options) if options[:number_of_installments]
103
104
  end
104
105
 
105
106
  def add_airline_data(post, options)
@@ -231,6 +232,10 @@ module ActiveMerchant #:nodoc:
231
232
  post['fraudFields'] = fraud_fields unless fraud_fields.empty?
232
233
  end
233
234
 
235
+ def add_number_of_installments(post, options)
236
+ post['order']['additionalInput']['numberOfInstallments'] = options[:number_of_installments] if options[:number_of_installments]
237
+ end
238
+
234
239
  def parse(body)
235
240
  JSON.parse(body)
236
241
  end
@@ -291,11 +296,11 @@ module ActiveMerchant #:nodoc:
291
296
  end
292
297
 
293
298
  def auth_digest(action, post, authorization = nil)
294
- data = <<-EOS
295
- POST
296
- #{content_type}
297
- #{date}
298
- #{uri(action, authorization)}
299
+ data = <<~EOS
300
+ POST
301
+ #{content_type}
302
+ #{date}
303
+ #{uri(action, authorization)}
299
304
  EOS
300
305
  digest = OpenSSL::Digest.new('sha256')
301
306
  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'
@@ -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)
@@ -38,7 +38,7 @@ module ActiveMerchant #:nodoc:
38
38
  self.supported_countries = ['US']
39
39
 
40
40
  # The card types supported by the payment gateway
41
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
41
+ self.supported_cardtypes = %i[visa master american_express discover]
42
42
 
43
43
  # The homepage URL of the gateway
44
44
  self.homepage_url = 'http://www.itransact.com/'
@@ -5,10 +5,10 @@ module ActiveMerchant #:nodoc:
5
5
  class IveriGateway < Gateway
6
6
  self.live_url = self.test_url = 'https://portal.nedsecure.co.za/iVeriWebService/Service.asmx'
7
7
 
8
- self.supported_countries = ['US', 'ZA', 'GB']
8
+ self.supported_countries = %w[US ZA GB]
9
9
  self.default_currency = 'ZAR'
10
10
  self.money_format = :cents
11
- self.supported_cardtypes = [:visa, :master, :american_express]
11
+ self.supported_cardtypes = %i[visa master american_express]
12
12
 
13
13
  self.homepage_url = 'http://www.iveri.com'
14
14
  self.display_name = 'iVeri'
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = %w(AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW)
10
10
  self.default_currency = 'EUR'
11
11
  self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LWD OMR TND)
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
12
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
13
13
 
14
14
  self.homepage_url = 'https://www.ixopay.com'
15
15
  self.display_name = 'Ixopay'
@@ -8,10 +8,10 @@ module ActiveMerchant #:nodoc:
8
8
  self.live_ca_url = 'https://gateway17.jetpay.com/canada-bb'
9
9
 
10
10
  # The countries the gateway supports merchants from as 2 digit ISO country codes
11
- self.supported_countries = ['US', 'CA']
11
+ self.supported_countries = %w[US CA]
12
12
 
13
13
  # The card types supported by the payment gateway
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
14
+ self.supported_cardtypes = %i[visa master american_express discover]
15
15
 
16
16
  # The homepage URL of the gateway
17
17
  self.homepage_url = 'http://www.jetpay.com/'
@@ -6,8 +6,8 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.money_format = :cents
8
8
  self.default_currency = 'USD'
9
- self.supported_countries = ['US', 'CA']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
9
+ self.supported_countries = %w[US CA]
10
+ self.supported_cardtypes = %i[visa master american_express discover]
11
11
 
12
12
  self.homepage_url = 'http://www.jetpay.com'
13
13
  self.display_name = 'JetPay'
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  self.money_format = :cents
11
11
  self.homepage_url = 'https://www.komoju.com/'
12
12
  self.display_name = 'Komoju'
13
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express jcb]
14
14
 
15
15
  STANDARD_ERROR_CODE_MAPPING = {
16
16
  'bad_verification_value' => 'incorrect_cvc',
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
7
7
  self.test_url = 'https://api-uat.kushkipagos.com/'
8
8
  self.live_url = 'https://api.kushkipagos.com/'
9
9
 
10
- self.supported_countries = ['CL', 'CO', 'EC', 'MX', 'PE']
10
+ self.supported_countries = %w[CL CO EC MX PE]
11
11
  self.default_currency = 'USD'
12
12
  self.money_format = :dollars
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
13
+ self.supported_cardtypes = %i[visa master american_express discover diners_club alia]
14
14
 
15
15
  def initialize(options={})
16
16
  requires!(options, :public_merchant_id, :private_merchant_id)
@@ -184,7 +184,7 @@ module ActiveMerchant #:nodoc:
184
184
  end
185
185
 
186
186
  def ssl_invoke(action, params)
187
- if ['void', 'refund'].include?(action)
187
+ if %w[void refund].include?(action)
188
188
  ssl_request(:delete, url(action, params), nil, headers(action))
189
189
  else
190
190
  ssl_post(url(action, params), post_data(params), headers(action))
@@ -206,7 +206,7 @@ module ActiveMerchant #:nodoc:
206
206
  def url(action, params)
207
207
  base_url = test? ? test_url : live_url
208
208
 
209
- if ['void', 'refund'].include?(action)
209
+ if %w[void refund].include?(action)
210
210
  base_url + 'v1/' + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
211
211
  else
212
212
  base_url + 'card/v1/' + ENDPOINT[action]
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
7
7
  self.live_url = 'https://gateway.l19tech.com/payments/'
8
8
  self.test_url = 'https://gateway-sb.l19tech.com/payments/'
9
9
 
10
- self.supported_countries = ['US', 'CA']
10
+ self.supported_countries = %w[US CA]
11
11
  self.default_currency = 'USD'
12
12
  self.money_format = :dollars
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
14
14
 
15
15
  RESPONSE_CODE_MAPPING = {
16
16
  '100' => 'Approved',
@@ -130,7 +130,7 @@ module ActiveMerchant #:nodoc:
130
130
  self.live_url = 'https://secure.linkpt.net:1129/'
131
131
 
132
132
  self.supported_countries = ['US']
133
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
133
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
134
134
  self.homepage_url = 'http://www.linkpoint.com/'
135
135
  self.display_name = 'LinkPoint'
136
136
 
@@ -169,7 +169,7 @@ module ActiveMerchant #:nodoc:
169
169
  def recurring(money, creditcard, options={})
170
170
  ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
171
171
 
172
- requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily], :installments, :order_id)
172
+ requires!(options, %i[periodicity bimonthly monthly biweekly weekly yearly daily], :installments, :order_id)
173
173
 
174
174
  options.update(
175
175
  ordertype: 'SALE',
@@ -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, :diners_club, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
14
14
 
15
15
  self.homepage_url = 'http://www.vantiv.com/'
16
16
  self.display_name = 'Vantiv eCommerce'
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  end
54
54
 
55
55
  def capture(money, authorization, options={})
56
- transaction_id, _, _ = split_authorization(authorization)
56
+ transaction_id, = split_authorization(authorization)
57
57
 
58
58
  request = build_xml_request do |doc|
59
59
  add_authentication(doc)
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
78
78
  add_descriptor(doc, options)
79
79
  doc.send(refund_type(payment), transaction_attributes(options)) do
80
80
  if payment.is_a?(String)
81
- transaction_id, _, _ = split_authorization(payment)
81
+ transaction_id, = split_authorization(payment)
82
82
  doc.litleTxnId(transaction_id)
83
83
  doc.amount(money) if money
84
84
  elsif check?(payment)
@@ -192,7 +192,7 @@ module ActiveMerchant #:nodoc:
192
192
  end
193
193
 
194
194
  def refund_type(payment)
195
- _, kind, _ = split_authorization(payment)
195
+ _, kind, = split_authorization(payment)
196
196
  if check?(payment) || kind == 'echeckSales'
197
197
  :echeckCredit
198
198
  else
@@ -274,7 +274,7 @@ module ActiveMerchant #:nodoc:
274
274
  doc.accType(payment_method.account_type.capitalize)
275
275
  doc.accNum(payment_method.account_number)
276
276
  doc.routingNum(payment_method.routing_number)
277
- doc.checkNum(payment_method.number)
277
+ doc.checkNum(payment_method.number) if payment_method.number
278
278
  end
279
279
  else
280
280
  doc.card do
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  self.supported_countries = ['BR']
12
12
  self.default_currency = 'BRL'
13
13
  self.money_format = :dollars
14
- self.supported_cardtypes = [:visa, :master, :discover, :american_express, :diners_club]
14
+ self.supported_cardtypes = %i[visa master discover american_express diners_club]
15
15
  self.homepage_url = 'http://www.maxipago.com/'
16
16
  self.display_name = 'maxiPago!'
17
17
 
@@ -212,7 +212,7 @@ module ActiveMerchant #:nodoc:
212
212
  end
213
213
 
214
214
  def add_order_id(xml, authorization)
215
- order_id, _ = split_authorization(authorization)
215
+ order_id, = split_authorization(authorization)
216
216
  xml.orderID order_id
217
217
  end
218
218
  end
@@ -3,8 +3,8 @@ module ActiveMerchant #:nodoc:
3
3
  class MercadoPagoGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
5
5
 
6
- self.supported_countries = ['AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY']
7
- self.supported_cardtypes = [:visa, :master, :american_express, :elo, :cabal, :naranja]
6
+ self.supported_countries = %w[AR BR CL CO MX PE UY]
7
+ self.supported_cardtypes = %i[visa master american_express elo cabal naranja]
8
8
 
9
9
  self.homepage_url = 'https://www.mercadopago.com/'
10
10
  self.display_name = 'Mercado Pago'
@@ -33,7 +33,7 @@ module ActiveMerchant #:nodoc:
33
33
 
34
34
  def capture(money, authorization, options={})
35
35
  post = {}
36
- authorization, _ = authorization.split('|')
36
+ authorization, = authorization.split('|')
37
37
  post[:capture] = true
38
38
  post[:transaction_amount] = amount(money).to_f
39
39
  commit('capture', "payments/#{authorization}", post)
@@ -47,7 +47,7 @@ module ActiveMerchant #:nodoc:
47
47
  end
48
48
 
49
49
  def void(authorization, options={})
50
- authorization, _ = authorization.split('|')
50
+ authorization, = authorization.split('|')
51
51
  post = { status: 'cancelled' }
52
52
  commit('void', "payments/#{authorization}", post)
53
53
  end
@@ -98,6 +98,7 @@ module ActiveMerchant #:nodoc:
98
98
  add_processing_mode(post, options)
99
99
  add_net_amount(post, options)
100
100
  add_taxes(post, options)
101
+ add_notification_url(post, options)
101
102
  post[:binary_mode] = (options[:binary_mode].nil? ? true : options[:binary_mode])
102
103
  post
103
104
  end
@@ -203,6 +204,10 @@ module ActiveMerchant #:nodoc:
203
204
  post[:net_amount] = Float(options[:net_amount]) if options[:net_amount]
204
205
  end
205
206
 
207
+ def add_notification_url(post, options)
208
+ post[:notification_url] = options[:notification_url] if options[:notification_url]
209
+ end
210
+
206
211
  def add_taxes(post, options)
207
212
  return unless (tax_object = options[:taxes])
208
213
 
@@ -251,7 +256,7 @@ module ActiveMerchant #:nodoc:
251
256
  end
252
257
 
253
258
  def commit(action, path, parameters)
254
- if ['capture', 'void'].include?(action)
259
+ if %w[capture void].include?(action)
255
260
  response = parse(ssl_request(:put, url(path), post_data(parameters), headers))
256
261
  else
257
262
  response = parse(ssl_post(url(path), post_data(parameters), headers(parameters)))
@@ -271,7 +276,7 @@ module ActiveMerchant #:nodoc:
271
276
  if action == 'refund'
272
277
  response['status'] != 404 && response['error'].nil?
273
278
  else
274
- ['active', 'approved', 'authorized', 'cancelled', 'in_process'].include?(response['status'])
279
+ %w[active approved authorized cancelled in_process].include?(response['status'])
275
280
  end
276
281
  end
277
282