zuora_api 1.11.1 → 1.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b989d5765f32254e3366c7a8ac1a10767dde25e017c5c65ed5e5bf632c0dd7b
4
- data.tar.gz: 4a3eba3c15f5aa826ae5706ba1cb75bf52912d3a8f14fc6539ecdec24b1edb5e
3
+ metadata.gz: 1377cfe445b9ff82e0504e86ef89413c815b4250152769ec11bf6b7b8804cdd9
4
+ data.tar.gz: 9882ca98957ecf177985037124f9e77722fe9c1eeea430f8c5f632fc4327162c
5
5
  SHA512:
6
- metadata.gz: 4d8bf8df713706127297a8e4cb44f2a864f5d45fd5e84b59941b70e8e0faf778af54a0e54fb956bbad6bcef4343fe03272c2eb706da2dd87522a1fa1e88aa915
7
- data.tar.gz: 50acd6787f23d50acc8b258a8a0c2af5737f668331615703178b0bcbaa30d1c4e41627c7f53ad2ac56a4f64fc3a21cb119561077cb43651d71fd5f41ca0594be
6
+ metadata.gz: 5043d898c8ec80517f01bd65daf031880aa4ab91e14669eedece02be8dab5c7b895abeb8d48330c89a9159875f8a9418adb2db2b3017bfe5b698100bb3035183
7
+ data.tar.gz: 85ca8f78f0807ed8c7533e612a0816dcbdf52ec71131c1c122cc110e89898c0dfbe69d560e5130e50f438bced5235331ee4590af12912248319bddfae52cc376
@@ -904,6 +904,8 @@ module ZuoraAPI
904
904
  raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(error_message, response)
905
905
  when /414 Request-URI Too Large/
906
906
  raise ZuoraAPI::Exceptions::ZuoraAPIError.new("Request URL is too long", response)
907
+ when /Not Found/
908
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new("The page you were looking for could not be found. If you believe you reached this page in error, please email support.", response)
907
909
  else
908
910
  raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(error_message, response)
909
911
  end
@@ -1339,11 +1341,7 @@ module ZuoraAPI
1339
1341
  status_code = response.code if response
1340
1342
  case response
1341
1343
  when Net::HTTPOK
1342
- headers = {}
1343
- response.each_header do |k,v|
1344
- headers[k] = v
1345
- end
1346
- Rails.logger.debug("Headers: #{headers.to_s}")
1344
+ Rails.logger.warn("Headers: #{response.to_hash.to_s}")
1347
1345
  if output_file_name.present?
1348
1346
  file_ending ||= output_file_name.end_with?(".csv.zip") ? ".csv.zip" : File.extname(output_file_name)
1349
1347
  filename ||= File.basename(output_file_name, file_ending)
@@ -1351,15 +1349,16 @@ module ZuoraAPI
1351
1349
 
1352
1350
  size, export_progress = [0, 0]
1353
1351
  encoding, type, full_filename = [nil, nil, nil]
1354
- if response.header["Content-Disposition"].present?
1355
- case response.header["Content-Disposition"]
1352
+ if response.get_fields("Content-Disposition").present?
1353
+ content_disposition = response.get_fields("Content-Disposition")[0]
1354
+ case content_disposition
1356
1355
  when /.*; filename\*=.*/
1357
- full_filename ||= /.*; filename\*=(.*)''(.*)/.match(response.header["Content-Disposition"])[2].strip
1358
- encoding = /.*; filename\*=(.*)''(.*)/.match(response.header["Content-Disposition"])[1].strip
1356
+ full_filename ||= /.*; filename\*=(.*)''(.*)/.match(content_disposition)[2].strip
1357
+ encoding = /.*; filename\*=(.*)''(.*)/.match(content_disposition)[1].strip
1359
1358
  when /.*; filename=/
1360
- full_filename ||= /.*; filename=(.*)/.match(response.header["Content-Disposition"])[1].strip
1359
+ full_filename ||= /.*; filename=(.*)/.match(content_disposition)[1].strip
1361
1360
  else
1362
- raise "Can't parse Content-Disposition header: #{response.header["Content-Disposition"]}"
1361
+ raise "Can't parse Content-Disposition header: #{content_disposition}"
1363
1362
  end
1364
1363
  file_ending ||= full_filename.end_with?(".csv.zip") ? ".csv.zip" : File.extname(full_filename)
1365
1364
  filename ||= File.basename(full_filename, file_ending)
@@ -1369,21 +1368,22 @@ module ZuoraAPI
1369
1368
  file_ending ||= uri.path.end_with?(".csv.zip") ? ".csv.zip" : File.extname(uri.path)
1370
1369
  filename ||= File.basename(uri.path, file_ending)
1371
1370
 
1372
- if response.header["Content-Type"].present?
1373
- case response.header["Content-Type"]
1371
+ if response.get_fields("Content-Type").present?
1372
+ content_type = response.get_fields("Content-Type")[0]
1373
+ case content_type
1374
1374
  when /.*;charset=.*/
1375
- type = /(.*);charset=(.*)/.match(response.header["Content-Type"])[1]
1376
- encoding = /(.*);charset=(.*)/.match(response.header["Content-Type"])[2]
1375
+ type = /(.*);charset=(.*)/.match(content_type)[1]
1376
+ encoding = /(.*);charset=(.*)/.match(content_type)[2]
1377
1377
  else
1378
- type = response.header["Content-Type"]
1378
+ type = content_type
1379
1379
  encoding ||= 'UTF-8'
1380
1380
  end
1381
1381
  end
1382
1382
 
1383
- if response.header["Content-Length"].present?
1384
- export_size = response.header["Content-Length"].to_i
1385
- elsif response.header["ContentLength"].present?
1386
- export_size = response.header["ContentLength"].to_i
1383
+ if response.get_fields("Content-Length").present?
1384
+ export_size = response.get_fields("Content-Length")[0].to_i
1385
+ elsif response.get_fields("ContentLength").present?
1386
+ export_size = response.get_fields("ContentLength")[0].to_i
1387
1387
  end
1388
1388
 
1389
1389
  Rails.logger.info("File: #{filename}#{file_ending} #{encoding} #{type} #{export_size}")
@@ -53,7 +53,7 @@ module ZuoraAPI
53
53
  def get_bearer_token(zuora_track_id: nil)
54
54
  raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Request Oauth Login but either 'Oauth Client Id' or 'Oauth Secret' were not passed") if self.oauth_client_id.blank? || self.oauth_secret.blank?
55
55
 
56
- headers = { "content-type" => "application/x-www-form-urlencoded" }
56
+ headers = {"Content-Type" => "application/x-www-form-urlencoded" }
57
57
  headers['Zuora-Track-Id'] = zuora_track_id if zuora_track_id.present?
58
58
  headers['X-Amzn-Trace-Id'] = zuora_track_id if zuora_track_id.present?
59
59
 
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.11.1"
2
+ VERSION = "1.11.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group