activemerchant 1.83.0 → 1.84.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +19 -0
  3. data/lib/active_merchant/billing/base.rb +1 -1
  4. data/lib/active_merchant/billing/check.rb +3 -2
  5. data/lib/active_merchant/billing/compatibility.rb +2 -4
  6. data/lib/active_merchant/billing/credit_card.rb +6 -39
  7. data/lib/active_merchant/billing/credit_card_formatting.rb +0 -1
  8. data/lib/active_merchant/billing/credit_card_methods.rb +67 -44
  9. data/lib/active_merchant/billing/gateway.rb +1 -8
  10. data/lib/active_merchant/billing/gateways/adyen.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/allied_wallet.rb +0 -1
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +0 -1
  13. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/balanced.rb +9 -9
  15. data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
  16. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -0
  18. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +0 -1
  19. data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -7
  20. data/lib/active_merchant/billing/gateways/braintree_blue.rb +12 -6
  21. data/lib/active_merchant/billing/gateways/bridge_pay.rb +0 -1
  22. data/lib/active_merchant/billing/gateways/card_connect.rb +2 -2
  23. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/card_stream.rb +9 -18
  25. data/lib/active_merchant/billing/gateways/cardknox.rb +8 -9
  26. data/lib/active_merchant/billing/gateways/cc5.rb +0 -1
  27. data/lib/active_merchant/billing/gateways/cecabank.rb +0 -1
  28. data/lib/active_merchant/billing/gateways/cenpos.rb +1 -1
  29. data/lib/active_merchant/billing/gateways/checkout_v2.rb +6 -6
  30. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/commercegate.rb +0 -1
  32. data/lib/active_merchant/billing/gateways/conekta.rb +6 -8
  33. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -2
  34. data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/culqi.rb +8 -10
  36. data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -2
  37. data/lib/active_merchant/billing/gateways/data_cash.rb +16 -29
  38. data/lib/active_merchant/billing/gateways/dibs.rb +1 -7
  39. data/lib/active_merchant/billing/gateways/digitzs.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/efsnet.rb +0 -4
  41. data/lib/active_merchant/billing/gateways/element.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/epay.rb +8 -9
  43. data/lib/active_merchant/billing/gateways/eway.rb +1 -0
  44. data/lib/active_merchant/billing/gateways/eway_managed.rb +2 -3
  45. data/lib/active_merchant/billing/gateways/exact.rb +0 -2
  46. data/lib/active_merchant/billing/gateways/ezic.rb +0 -1
  47. data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -11
  48. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  49. data/lib/active_merchant/billing/gateways/first_giving.rb +3 -3
  50. data/lib/active_merchant/billing/gateways/first_pay.rb +5 -0
  51. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +2 -2
  52. data/lib/active_merchant/billing/gateways/garanti.rb +4 -5
  53. data/lib/active_merchant/billing/gateways/global_collect.rb +6 -7
  54. data/lib/active_merchant/billing/gateways/iats_payments.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/inspire.rb +2 -2
  56. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  57. data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
  58. data/lib/active_merchant/billing/gateways/iveri.rb +1 -1
  59. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/kushki.rb +7 -9
  61. data/lib/active_merchant/billing/gateways/latitude19.rb +29 -34
  62. data/lib/active_merchant/billing/gateways/linkpoint.rb +1 -3
  63. data/lib/active_merchant/billing/gateways/litle.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/mastercard.rb +1 -2
  65. data/lib/active_merchant/billing/gateways/mercado_pago.rb +0 -1
  66. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +0 -1
  67. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/merchant_ware.rb +3 -3
  69. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +3 -3
  70. data/lib/active_merchant/billing/gateways/mercury.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/micropayment.rb +0 -2
  72. data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -0
  73. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +4 -3
  74. data/lib/active_merchant/billing/gateways/moneris.rb +0 -1
  75. data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -2
  76. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  77. data/lib/active_merchant/billing/gateways/mundipagg.rb +9 -9
  78. data/lib/active_merchant/billing/gateways/nab_transact.rb +0 -1
  79. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -0
  80. data/lib/active_merchant/billing/gateways/nmi.rb +1 -2
  81. data/lib/active_merchant/billing/gateways/ogone.rb +9 -10
  82. data/lib/active_merchant/billing/gateways/openpay.rb +7 -8
  83. data/lib/active_merchant/billing/gateways/opp.rb +110 -112
  84. data/lib/active_merchant/billing/gateways/optimal_payment.rb +1 -4
  85. data/lib/active_merchant/billing/gateways/orbital.rb +1 -2
  86. data/lib/active_merchant/billing/gateways/pagarme.rb +3 -5
  87. data/lib/active_merchant/billing/gateways/pay_conex.rb +0 -1
  88. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +10 -12
  89. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  90. data/lib/active_merchant/billing/gateways/paybox_direct.rb +0 -1
  91. data/lib/active_merchant/billing/gateways/payeezy.rb +15 -4
  92. data/lib/active_merchant/billing/gateways/payex.rb +5 -6
  93. data/lib/active_merchant/billing/gateways/payflow.rb +0 -4
  94. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -2
  95. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +1 -1
  96. data/lib/active_merchant/billing/gateways/payflow_express.rb +54 -55
  97. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  98. data/lib/active_merchant/billing/gateways/payment_express.rb +0 -6
  99. data/lib/active_merchant/billing/gateways/paymill.rb +0 -2
  100. data/lib/active_merchant/billing/gateways/paypal.rb +0 -8
  101. data/lib/active_merchant/billing/gateways/payscout.rb +0 -1
  102. data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/payu_latam.rb +37 -32
  104. data/lib/active_merchant/billing/gateways/pin.rb +2 -2
  105. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -0
  106. data/lib/active_merchant/billing/gateways/psl_card.rb +3 -10
  107. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  108. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +0 -3
  109. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -7
  110. data/lib/active_merchant/billing/gateways/realex.rb +6 -8
  111. data/lib/active_merchant/billing/gateways/redsys.rb +1 -0
  112. data/lib/active_merchant/billing/gateways/s5.rb +0 -1
  113. data/lib/active_merchant/billing/gateways/safe_charge.rb +4 -4
  114. data/lib/active_merchant/billing/gateways/sage.rb +16 -13
  115. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -9
  116. data/lib/active_merchant/billing/gateways/secure_net.rb +0 -1
  117. data/lib/active_merchant/billing/gateways/securion_pay.rb +3 -6
  118. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -2
  119. data/lib/active_merchant/billing/gateways/smart_ps.rb +2 -4
  120. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +5 -5
  121. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -2
  122. data/lib/active_merchant/billing/gateways/stripe.rb +60 -15
  123. data/lib/active_merchant/billing/gateways/telr.rb +5 -6
  124. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  125. data/lib/active_merchant/billing/gateways/trans_first.rb +0 -1
  126. data/lib/active_merchant/billing/gateways/trexle.rb +6 -5
  127. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -0
  128. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +2 -2
  129. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +0 -1
  130. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -0
  132. data/lib/active_merchant/billing/gateways/visanet_peru.rb +28 -32
  133. data/lib/active_merchant/billing/gateways/wepay.rb +0 -1
  134. data/lib/active_merchant/billing/gateways/wirecard.rb +2 -1
  135. data/lib/active_merchant/billing/gateways/worldpay.rb +1 -4
  136. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +5 -8
  137. data/lib/active_merchant/connection.rb +0 -2
  138. data/lib/active_merchant/country.rb +1 -0
  139. data/lib/active_merchant/net_http_ssl_connection.rb +1 -1
  140. data/lib/active_merchant/network_connection_retries.rb +1 -0
  141. data/lib/active_merchant/post_data.rb +1 -0
  142. data/lib/active_merchant/posts_data.rb +0 -2
  143. data/lib/active_merchant/version.rb +1 -1
  144. data/lib/support/gateway_support.rb +3 -4
  145. data/lib/support/ssl_verify.rb +0 -1
  146. metadata +2 -2
@@ -179,8 +179,8 @@ module ActiveMerchant #:nodoc:
179
179
  message = message_from(response)
180
180
 
181
181
  PaystationResponse.new(success?(response), message, response,
182
- :test => (response[:tm] && response[:tm].downcase == 't'),
183
- :authorization => response[:paystation_transaction_id]
182
+ :test => (response[:tm] && response[:tm].downcase == 't'),
183
+ :authorization => response[:paystation_transaction_id]
184
184
  )
185
185
  end
186
186
 
@@ -52,6 +52,11 @@ module ActiveMerchant #:nodoc:
52
52
  add_transaction_elements(post, 'CAPTURE', options)
53
53
  add_reference(post, authorization)
54
54
 
55
+ if !amount.nil? && amount.to_f != 0.0
56
+ post[:transaction][:additionalValues] ||= {}
57
+ post[:transaction][:additionalValues][:TX_VALUE] = invoice_for(amount, options)[:TX_VALUE]
58
+ end
59
+
55
60
  commit('capture', post)
56
61
  end
57
62
 
@@ -220,6 +225,10 @@ module ActiveMerchant #:nodoc:
220
225
  end
221
226
 
222
227
  def add_invoice(post, money, options)
228
+ post[:transaction][:order][:additionalValues] = invoice_for(money, options)
229
+ end
230
+
231
+ def invoice_for(money, options)
223
232
  tx_value = {}
224
233
  tx_value[:value] = amount(money)
225
234
  tx_value[:currency] = options[:currency] || currency(money)
@@ -237,7 +246,7 @@ module ActiveMerchant #:nodoc:
237
246
  additional_values[:TX_TAX] = tx_tax if @options[:payment_country] == 'CO'
238
247
  additional_values[:TX_TAX_RETURN_BASE] = tx_tax_return_base if @options[:payment_country] == 'CO'
239
248
 
240
- post[:transaction][:order][:additionalValues] = additional_values
249
+ additional_values
241
250
  end
242
251
 
243
252
  def add_signature(post)
@@ -310,25 +319,23 @@ module ActiveMerchant #:nodoc:
310
319
  end
311
320
 
312
321
  def commit(action, params)
313
- begin
314
- raw_response = ssl_post(url, post_data(params), headers)
315
- response = parse(raw_response)
316
- rescue ResponseError => e
317
- raw_response = e.response.body
318
- response_error(raw_response)
319
- rescue JSON::ParserError
320
- unparsable_response(raw_response)
321
- else
322
- success = success_from(action, response)
323
- Response.new(
324
- success,
325
- message_from(action, success, response),
326
- response,
327
- authorization: success ? authorization_from(action, response) : nil,
328
- error_code: success ? nil : error_from(action, response),
329
- test: test?
330
- )
331
- end
322
+ raw_response = ssl_post(url, post_data(params), headers)
323
+ response = parse(raw_response)
324
+ rescue ResponseError => e
325
+ raw_response = e.response.body
326
+ response_error(raw_response)
327
+ rescue JSON::ParserError
328
+ unparsable_response(raw_response)
329
+ else
330
+ success = success_from(action, response)
331
+ Response.new(
332
+ success,
333
+ message_from(action, success, response),
334
+ response,
335
+ authorization: success ? authorization_from(action, response) : nil,
336
+ error_code: success ? nil : error_from(action, response),
337
+ test: test?
338
+ )
332
339
  end
333
340
 
334
341
  def headers
@@ -416,18 +423,16 @@ module ActiveMerchant #:nodoc:
416
423
  end
417
424
 
418
425
  def response_error(raw_response)
419
- begin
420
- response = parse(raw_response)
421
- rescue JSON::ParserError
422
- unparsable_response(raw_response)
423
- else
424
- return Response.new(
425
- false,
426
- message_from('', false, response),
427
- response,
428
- :test => test?
429
- )
430
- end
426
+ response = parse(raw_response)
427
+ rescue JSON::ParserError
428
+ unparsable_response(raw_response)
429
+ else
430
+ return Response.new(
431
+ false,
432
+ message_from('', false, response),
433
+ response,
434
+ :test => test?
435
+ )
431
436
  end
432
437
 
433
438
  def unparsable_response(raw_response)
@@ -84,6 +84,7 @@ module ActiveMerchant #:nodoc:
84
84
  gsub(/(number\\?":\\?")(\d*)/, '\1[FILTERED]').
85
85
  gsub(/(cvc\\?":\\?")(\d*)/, '\1[FILTERED]')
86
86
  end
87
+
87
88
  private
88
89
 
89
90
  def add_amount(post, money, options)
@@ -120,7 +121,7 @@ module ActiveMerchant #:nodoc:
120
121
  def add_capture(post, options)
121
122
  capture = options[:capture]
122
123
 
123
- post[:capture] = capture == false ? false : true
124
+ post[:capture] = capture != false
124
125
  end
125
126
 
126
127
  def add_creditcard(post, creditcard)
@@ -173,7 +174,6 @@ module ActiveMerchant #:nodoc:
173
174
  elsif body['error']
174
175
  error_response(body)
175
176
  end
176
-
177
177
  rescue JSON::ParserError
178
178
  return unparsable_response(raw_response)
179
179
  end
@@ -172,6 +172,7 @@ module ActiveMerchant
172
172
  end
173
173
 
174
174
  private
175
+
175
176
  def commit(action, post)
176
177
  response = parse( ssl_post(self.live_url, post_data(action, post)) )
177
178
  success = SUCCESS_CODES.include?(response[:finalstatus])
@@ -17,11 +17,11 @@ module ActiveMerchant
17
17
  self.default_currency = 'GBP'
18
18
 
19
19
  self.supported_countries = ['GB']
20
- # Visa Credit, Visa Debit, Mastercard, Maestro, Solo, Electron,
20
+ # Visa Credit, Visa Debit, Mastercard, Maestro, Electron,
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, :switch, :solo, :maestro ]
24
+ self.supported_cardtypes = [ :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
 
@@ -174,12 +174,6 @@ module ActiveMerchant
174
174
  post[:ExpMonth] = credit_card.month
175
175
  post[:ExpYear] = credit_card.year
176
176
 
177
- if requires_start_date_or_issue_number?(credit_card)
178
- post[:IssueNumber] = credit_card.issue_number unless credit_card.issue_number.blank?
179
- post[:StartMonth] = credit_card.start_month unless credit_card.start_month.blank?
180
- post[:StartYear] = credit_card.start_year unless credit_card.start_year.blank?
181
- end
182
-
183
177
  # CV2 check
184
178
  post[:AVSCV2Check] = credit_card.verification_value? ? 'YES' : 'NO'
185
179
  post[:CV2] = credit_card.verification_value if credit_card.verification_value?
@@ -189,7 +183,7 @@ module ActiveMerchant
189
183
  address = options[:billing_address] || options[:address]
190
184
  return if address.nil?
191
185
 
192
- post[:QAAddress] = [:address1, :address2, :city, :state].collect{|a| address[a]}.reject{|a| a.blank?}.join(' ')
186
+ post[:QAAddress] = [:address1, :address2, :city, :state].collect{|a| address[a]}.reject(&:blank?).join(' ')
193
187
  post[:QAPostcode] = address[:zip]
194
188
  end
195
189
 
@@ -246,7 +240,6 @@ module ActiveMerchant
246
240
  # -a hash with all of the values returned in the PSL response
247
241
  #
248
242
  def parse(body)
249
-
250
243
  fields = {}
251
244
  for line in body.split('&')
252
245
  key, value = *line.scan( %r{^(\w+)\=(.*)$} ).flatten
@@ -216,10 +216,10 @@ module ActiveMerchant #:nodoc:
216
216
  end
217
217
 
218
218
  Response.new(success, message, response,
219
- :test => test?,
220
- :authorization => authorization,
221
- :avs_result => { :code => response[:AVSResponseCode] },
222
- :cvv_result => response[:CVV2ResponseCode]
219
+ :test => test?,
220
+ :authorization => authorization,
221
+ :avs_result => { :code => response[:AVSResponseCode] },
222
+ :cvv_result => response[:CVV2ResponseCode]
223
223
  )
224
224
  end
225
225
 
@@ -1,6 +1,5 @@
1
1
 
2
2
  module QuickpayCommon
3
-
4
3
  MD5_CHECK_FIELDS = {
5
4
  3 => {
6
5
  :authorize => %w(protocol msgtype merchant ordernumber amount
@@ -175,7 +174,6 @@ module QuickpayCommon
175
174
  base.supported_countries = ['DE', 'DK', 'ES', 'FI', 'FR', 'FO', 'GB', 'IS', 'NO', 'SE']
176
175
  base.homepage_url = 'http://quickpay.net/'
177
176
  base.display_name = 'QuickPay'
178
-
179
177
  end
180
178
 
181
179
  def expdate(credit_card)
@@ -184,5 +182,4 @@ module QuickpayCommon
184
182
 
185
183
  "#{year}#{month}"
186
184
  end
187
-
188
185
  end
@@ -276,11 +276,9 @@ module ActiveMerchant
276
276
  end
277
277
 
278
278
  def response_error(raw_response)
279
- begin
280
- parse(raw_response)
281
- rescue JSON::ParserError
282
- json_error(raw_response)
283
- end
279
+ parse(raw_response)
280
+ rescue JSON::ParserError
281
+ json_error(raw_response)
284
282
  end
285
283
 
286
284
  def json_error(raw_response)
@@ -292,8 +290,6 @@ module ActiveMerchant
292
290
  def synchronized_path(path)
293
291
  "#{path}?synchronized"
294
292
  end
295
-
296
293
  end
297
-
298
294
  end
299
295
  end
@@ -26,15 +26,12 @@ module ActiveMerchant
26
26
  'visa' => 'VISA',
27
27
  'american_express' => 'AMEX',
28
28
  'diners_club' => 'DINERS',
29
- 'switch' => 'SWITCH',
30
- 'solo' => 'SWITCH',
31
- 'laser' => 'LASER',
32
29
  'maestro' => 'MC'
33
30
  }
34
31
 
35
32
  self.money_format = :cents
36
33
  self.default_currency = 'EUR'
37
- self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club, :switch, :solo, :laser ]
34
+ self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club ]
38
35
  self.supported_countries = %w(IE GB FR BE NL LU IT US CA ES)
39
36
  self.homepage_url = 'http://www.realexpayments.com/'
40
37
  self.display_name = 'Realex'
@@ -89,11 +86,12 @@ module ActiveMerchant
89
86
 
90
87
  def scrub(transcript)
91
88
  transcript.
92
- gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
93
- gsub(%r((<number>)\d+(</number>))i, '\1[FILTERED]\2')
89
+ gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
90
+ gsub(%r((<number>)\d+(</number>))i, '\1[FILTERED]\2')
94
91
  end
95
92
 
96
93
  private
94
+
97
95
  def commit(request)
98
96
  response = parse(ssl_post(self.live_url, request))
99
97
 
@@ -245,7 +243,7 @@ module ActiveMerchant
245
243
  xml.tag! 'expdate', expiry_date(credit_card)
246
244
  xml.tag! 'chname', credit_card.name
247
245
  xml.tag! 'type', CARD_MAPPING[card_brand(credit_card).to_s]
248
- xml.tag! 'issueno', credit_card.issue_number
246
+ xml.tag! 'issueno', ''
249
247
  xml.tag! 'cvn' do
250
248
  xml.tag! 'number', credit_card.verification_value
251
249
  xml.tag! 'presind', (options['presind'] || (credit_card.verification_value? ? 1 : nil))
@@ -267,7 +265,7 @@ module ActiveMerchant
267
265
 
268
266
  def format_address_code(address)
269
267
  code = [address[:zip].to_s, address[:address1].to_s + address[:address2].to_s]
270
- code.collect{|e| e.gsub(/\D/, '')}.reject{|e| e.empty?}.join('|')
268
+ code.collect{|e| e.gsub(/\D/, '')}.reject(&:empty?).join('|')
271
269
  end
272
270
 
273
271
  def new_timestamp
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  require 'nokogiri'
3
4
 
4
5
  module ActiveMerchant #:nodoc:
@@ -96,7 +96,6 @@ module ActiveMerchant #:nodoc:
96
96
  end
97
97
  end
98
98
 
99
-
100
99
  def supports_scrubbing?
101
100
  true
102
101
  end
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  def capture(money, authorization, options={})
44
44
  post = {}
45
45
  auth, transaction_id, token, exp_month, exp_year, _, original_currency = authorization.split('|')
46
- add_transaction_data('Settle', post, money, (options.merge!({currency: original_currency})))
46
+ add_transaction_data('Settle', post, money, options.merge!({currency: original_currency}))
47
47
  post[:sg_AuthCode] = auth
48
48
  post[:sg_TransactionID] = transaction_id
49
49
  post[:sg_CCToken] = token
@@ -56,7 +56,7 @@ module ActiveMerchant #:nodoc:
56
56
  def refund(money, authorization, options={})
57
57
  post = {}
58
58
  auth, transaction_id, token, exp_month, exp_year, _, original_currency = authorization.split('|')
59
- add_transaction_data('Credit', post, money, (options.merge!({currency: original_currency})))
59
+ add_transaction_data('Credit', post, money, options.merge!({currency: original_currency}))
60
60
  post[:sg_CreditType] = 2
61
61
  post[:sg_AuthCode] = auth
62
62
  post[:sg_TransactionID] = transaction_id
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  def void(authorization, options={})
80
80
  post = {}
81
81
  auth, transaction_id, token, exp_month, exp_year, original_amount, original_currency = authorization.split('|')
82
- add_transaction_data('Void', post, (original_amount.to_f * 100), (options.merge!({currency: original_currency})))
82
+ add_transaction_data('Void', post, (original_amount.to_f * 100), options.merge!({currency: original_currency}))
83
83
  post[:sg_CreditType] = 2
84
84
  post[:sg_AuthCode] = auth
85
85
  post[:sg_TransactionID] = transaction_id
@@ -181,7 +181,7 @@ module ActiveMerchant #:nodoc:
181
181
  end
182
182
 
183
183
  def element_name_to_symbol(response, childnode)
184
- name = "#{childnode.name.downcase}"
184
+ name = childnode.name.downcase
185
185
  response[name.to_sym] = childnode.text
186
186
  end
187
187
 
@@ -98,16 +98,16 @@ module ActiveMerchant #:nodoc:
98
98
 
99
99
  def scrub(transcript)
100
100
  force_utf8(transcript).
101
- gsub(%r((M_id=)[^&]*), '\1[FILTERED]').
102
- gsub(%r((M_key=)[^&]*), '\1[FILTERED]').
103
- gsub(%r((C_cardnumber=)[^&]*), '\1[FILTERED]').
104
- gsub(%r((C_cvv=)[^&]*), '\1[FILTERED]').
105
- gsub(%r((C_rte=)[^&]*), '\1[FILTERED]').
106
- gsub(%r((C_acct=)[^&]*), '\1[FILTERED]').
107
- gsub(%r((C_ssn=)[^&]*), '\1[FILTERED]').
108
- gsub(%r((<ns1:CARDNUMBER>).+(</ns1:CARDNUMBER>)), '\1[FILTERED]\2').
109
- gsub(%r((<ns1:M_ID>).+(</ns1:M_ID>)), '\1[FILTERED]\2').
110
- gsub(%r((<ns1:M_KEY>).+(</ns1:M_KEY>)), '\1[FILTERED]\2')
101
+ gsub(%r((M_id=)[^&]*), '\1[FILTERED]').
102
+ gsub(%r((M_key=)[^&]*), '\1[FILTERED]').
103
+ gsub(%r((C_cardnumber=)[^&]*), '\1[FILTERED]').
104
+ gsub(%r((C_cvv=)[^&]*), '\1[FILTERED]').
105
+ gsub(%r((C_rte=)[^&]*), '\1[FILTERED]').
106
+ gsub(%r((C_acct=)[^&]*), '\1[FILTERED]').
107
+ gsub(%r((C_ssn=)[^&]*), '\1[FILTERED]').
108
+ gsub(%r((<ns1:CARDNUMBER>).+(</ns1:CARDNUMBER>)), '\1[FILTERED]\2').
109
+ gsub(%r((<ns1:M_ID>).+(</ns1:M_ID>)), '\1[FILTERED]\2').
110
+ gsub(%r((<ns1:M_KEY>).+(</ns1:M_KEY>)), '\1[FILTERED]\2')
111
111
  end
112
112
 
113
113
  private
@@ -364,9 +364,12 @@ module ActiveMerchant #:nodoc:
364
364
  end
365
365
 
366
366
  def commit(action, request)
367
- response = parse(@gateway.ssl_post(@live_url,
368
- build_soap_request(action, request),
369
- build_headers(action))
367
+ response = parse(
368
+ @gateway.ssl_post(
369
+ @live_url,
370
+ build_soap_request(action, request),
371
+ build_headers(action)
372
+ )
370
373
  )
371
374
 
372
375
  case action
@@ -28,8 +28,6 @@ module ActiveMerchant #:nodoc:
28
28
  :visa => 'VISA',
29
29
  :master => 'MC',
30
30
  :delta => 'DELTA',
31
- :solo => 'SOLO',
32
- :switch => 'MAESTRO',
33
31
  :maestro => 'MAESTRO',
34
32
  :american_express => 'AMEX',
35
33
  :electron => 'UKE',
@@ -71,7 +69,7 @@ module ActiveMerchant #:nodoc:
71
69
  recipient_dob: :FIRecipientDoB
72
70
  }
73
71
 
74
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :switch, :solo, :maestro, :diners_club]
72
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :diners_club]
75
73
  self.supported_countries = ['GB', 'IE']
76
74
  self.default_currency = 'GBP'
77
75
 
@@ -183,6 +181,7 @@ module ActiveMerchant #:nodoc:
183
181
  end
184
182
 
185
183
  private
184
+
186
185
  def truncate(value, max_size)
187
186
  return nil unless value
188
187
  return value.to_s if CGI.escape(value.to_s).length <= max_size
@@ -291,11 +290,6 @@ module ActiveMerchant #:nodoc:
291
290
  add_pair(post, :CardNumber, credit_card.number, :required => true)
292
291
 
293
292
  add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), :required => true)
294
-
295
- if requires_start_date_or_issue_number?(credit_card)
296
- add_pair(post, :StartDate, format_date(credit_card.start_month, credit_card.start_year))
297
- add_pair(post, :IssueNumber, credit_card.issue_number)
298
- end
299
293
  add_pair(post, :CardType, map_card_type(credit_card))
300
294
 
301
295
  add_pair(post, :CV2, credit_card.verification_value)
@@ -436,6 +430,5 @@ module ActiveMerchant #:nodoc:
436
430
  payment_method.split(';').last == 'purchase'
437
431
  end
438
432
  end
439
-
440
433
  end
441
434
  end
@@ -189,7 +189,6 @@ module ActiveMerchant #:nodoc:
189
189
  xml.tag!('CUSTOMER_SHIP', NIL_ATTRIBUTE) do
190
190
  end
191
191
  end
192
-
193
192
  end
194
193
 
195
194
  def add_merchant_key(xml, options)
@@ -4,7 +4,6 @@ module ActiveMerchant #:nodoc:
4
4
  self.test_url = 'https://api.securionpay.com/'
5
5
  self.live_url = 'https://api.securionpay.com/'
6
6
 
7
-
8
7
  self.supported_countries = %w(AL AD AT BY BE BG HR CY CZ RE DK EE IS FI FR DE GI GR HU IS IE IT IL LV LI LT LU
9
8
  MK MT MD MC NL NO PL PT RO RU MA RS SK SI ES SE CH UA GB KI CI ME)
10
9
 
@@ -205,11 +204,9 @@ module ActiveMerchant #:nodoc:
205
204
  end
206
205
 
207
206
  def response_error(raw_response)
208
- begin
209
- parse(raw_response)
210
- rescue JSON::ParserError
211
- json_error(raw_response)
212
- end
207
+ parse(raw_response)
208
+ rescue JSON::ParserError
209
+ json_error(raw_response)
213
210
  end
214
211
 
215
212
  def post_data(params)