zuora_api 1.11.15 → 1.12.1
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 +4 -4
- data/lib/zuora_api/login.rb +21 -6
- 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: af70e60b33a8218244160f20471304ba6079c5b516414a4a5f7a47bf9c9f7466
|
4
|
+
data.tar.gz: 5e4986ecf49fbb0e0b77f56844e26c93f63714eeac75ee2c00ffe2733c557fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf78434128fc10062f309563ff05f672008f65efa9cc02677024bab1b379eade787a16addfa6372318fd20d5230cb113d2da3608f48bd09652511c609bc28d8d
|
7
|
+
data.tar.gz: 0e7a55c6feec168ebbf2007eda632a4a8b2d0066b3be5b8790f10d83bbe6d04e2da23dcb6a85eb120b92e32c4870605838579c5aa3d61a7af720c1d9009af14a
|
data/lib/zuora_api/login.rb
CHANGED
@@ -5,9 +5,9 @@ require 'zuora_api/exceptions'
|
|
5
5
|
|
6
6
|
module ZuoraAPI
|
7
7
|
class Login
|
8
|
-
ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging' ]
|
8
|
+
ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging', PREPROD='Preprod' ]
|
9
9
|
REGIONS = [EU = 'EU', US = 'US', NA = 'NA', JP = 'JP' ]
|
10
|
-
MIN_Endpoints = {'Test': '140.0', 'Sandbox': '140.0', 'Production': '140.0', 'Performance': '140.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '140.0'}.freeze
|
10
|
+
MIN_Endpoints = {'Test': '140.0', 'Sandbox': '140.0', 'Production': '140.0', 'Performance': '140.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '140.0', 'Preprod': '140.0'}.freeze
|
11
11
|
XML_SAVE_OPTIONS = Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
|
12
12
|
USER_AGENT = "Zuora#{ENV['Z_APPLICATION_NAME']&.capitalize}/#{ENV['Z_APPLICATION_VERSION']&.delete('v')}"
|
13
13
|
|
@@ -207,7 +207,7 @@ module ZuoraAPI
|
|
207
207
|
end
|
208
208
|
|
209
209
|
def self.environments
|
210
|
-
%w(Sandbox Production Services Performance Staging Test)
|
210
|
+
%w(Sandbox Production Services Performance Staging Test Preprod)
|
211
211
|
end
|
212
212
|
|
213
213
|
def self.regions
|
@@ -220,7 +220,8 @@ module ZuoraAPI
|
|
220
220
|
"Performance" => "https://pt1.zuora.com/apps/services/a/",
|
221
221
|
"Services" => "https://services347.zuora.com/apps/services/a/",
|
222
222
|
"Staging" => "https://staging2.zuora.com/apps/services/a/",
|
223
|
-
"Test" => "https://test.zuora.com/apps/services/a/"
|
223
|
+
"Test" => "https://test.zuora.com/apps/services/a/",
|
224
|
+
"Preprod" => "https://preprod.zuora.com/apps/services/a/"},
|
224
225
|
"EU" => {"Sandbox" => "https://sandbox.eu.zuora.com/apps/services/a/",
|
225
226
|
"Production" => "https://eu.zuora.com/apps/services/a/",
|
226
227
|
"Performance" => "https://pt1.eu.zuora.com/apps/services/a/",
|
@@ -230,7 +231,8 @@ module ZuoraAPI
|
|
230
231
|
"Production" => "https://na.zuora.com/apps/services/a/",
|
231
232
|
"Performance" => "https://pt1.na.zuora.com/apps/services/a/",
|
232
233
|
"Services" => "https://services347.na.zuora.com/apps/services/a/",
|
233
|
-
"Test" => "https://test.zuora.com/apps/services/a/"
|
234
|
+
"Test" => "https://test.zuora.com/apps/services/a/",
|
235
|
+
"Preprod" => "https://preprod.zuora.com/apps/services/a/"},
|
234
236
|
"JP" => {"Sandbox" => "https://sandbox.ap.zuora.com/apps/services/a/",
|
235
237
|
"Production" => "https://ap.zuora.com/apps/services/a/",
|
236
238
|
"Test" => "https://test.ap.zuora.com/apps/services/a/"}
|
@@ -333,7 +335,7 @@ module ZuoraAPI
|
|
333
335
|
endpoint = "#{https}rest#{host}"
|
334
336
|
when 'Staging'
|
335
337
|
endpoint = "https://rest-staging2.zuora.com"
|
336
|
-
when '
|
338
|
+
when 'Preprod'
|
337
339
|
endpoint = "https://rest.preprod.zuora.com"
|
338
340
|
when 'Unknown'
|
339
341
|
raise "Environment unknown, returning passed in parameter unaltered"
|
@@ -898,6 +900,12 @@ module ZuoraAPI
|
|
898
900
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['message'], response) if ![200,201,202].include?(response.code)
|
899
901
|
end
|
900
902
|
|
903
|
+
if body.class == Hash && body['errors'].present?
|
904
|
+
if body['errors'].class == Array && body.dig('errors', 0).is_a?(Hash)
|
905
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['errors'][0].fetch("message", "No error message. Zuora API Error"), response)
|
906
|
+
end
|
907
|
+
end
|
908
|
+
|
901
909
|
self.errors_via_content_type(response: response, type: :json)
|
902
910
|
|
903
911
|
#All other errors
|
@@ -1477,6 +1485,13 @@ module ZuoraAPI
|
|
1477
1485
|
end
|
1478
1486
|
end
|
1479
1487
|
|
1488
|
+
rescue ZuoraAPI::Exceptions::FileDownloadError => ex
|
1489
|
+
if ex.message.match(/.*The current tenant does not have a file with id.*/)
|
1490
|
+
raise
|
1491
|
+
else
|
1492
|
+
Rails.logger.error("File Download Failed")
|
1493
|
+
raise
|
1494
|
+
end
|
1480
1495
|
rescue => ex
|
1481
1496
|
sleep(5)
|
1482
1497
|
if (retry_count -= 1) >= 0
|
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.
|
4
|
+
version: 1.12.1
|
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: 2024-10-
|
11
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|