zuora_api 1.11.1 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zuora_api/login.rb +21 -21
- data/lib/zuora_api/logins/oauth.rb +1 -1
- data/lib/zuora_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b383a08604a813b310e04d29529cd74204174f029118adc2fb6bb936a13ead1
|
4
|
+
data.tar.gz: f3a21f69b691a869b42d25c2f90d21850fba58bf01635f1f426087fe8f607c89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a584619e8a75484942f1aaa696def992a6b9f3f58e194a7729c00775f07aafb512e77f6731328b91455dd431ff3b9cd11f32300f701e9700f7596da5e2e9e39
|
7
|
+
data.tar.gz: fe8a4777c897e3e96053867a8cd77a1940a4868d39b9660fff230fe832f26f44fc24089f14c680520b4d885c6418f49fe202006e94de45942a6901e758aa025b
|
data/lib/zuora_api/login.rb
CHANGED
@@ -765,7 +765,7 @@ module ZuoraAPI
|
|
765
765
|
if body['path'] == '/oauth/token'
|
766
766
|
if body['status'] == 403 && response.code == 403
|
767
767
|
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Forbidden", response)
|
768
|
-
elsif body['status'] == 400 && response.code == 400
|
768
|
+
elsif body['status'] == 400 && response.code == 400
|
769
769
|
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Invalid Oauth Client Id", response)
|
770
770
|
end
|
771
771
|
end
|
@@ -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
|
-
|
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.
|
1355
|
-
|
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(
|
1358
|
-
encoding = /.*; filename\*=(.*)''(.*)/.match(
|
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(
|
1359
|
+
full_filename ||= /.*; filename=(.*)/.match(content_disposition)[1].strip
|
1361
1360
|
else
|
1362
|
-
raise "Can't parse Content-Disposition header: #{
|
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.
|
1373
|
-
|
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(
|
1376
|
-
encoding = /(.*);charset=(.*)/.match(
|
1375
|
+
type = /(.*);charset=(.*)/.match(content_type)[1]
|
1376
|
+
encoding = /(.*);charset=(.*)/.match(content_type)[2]
|
1377
1377
|
else
|
1378
|
-
type =
|
1378
|
+
type = content_type
|
1379
1379
|
encoding ||= 'UTF-8'
|
1380
1380
|
end
|
1381
1381
|
end
|
1382
1382
|
|
1383
|
-
if response.
|
1384
|
-
export_size = response.
|
1385
|
-
elsif response.
|
1386
|
-
export_size = response.
|
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 = {
|
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
|
|
data/lib/zuora_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zuora Strategic Solutions Group
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|