zuora_api 1.10.8 → 1.11.0.pre.a
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/exceptions.rb +1 -0
- data/lib/zuora_api/login.rb +17 -5
- data/lib/zuora_api/version.rb +1 -1
- metadata +4 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff08798c60e2f0837fe659a9fb52dba600fd0476a232b7f9f1fb8025e8c82aa2
|
4
|
+
data.tar.gz: 523e31b45d3293be566921a5b629ea5a09e035b42b4da0ff8d042fd5da1d122d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c4ee8a3198891e1606d5f2eecc25eddce3c762268b3d6e160a5fbdccb177bc3356ca0d68a43ee8b7f0cb2b557ac6d6096a6ee424657ecd0e0b4913e48ad874c
|
7
|
+
data.tar.gz: eb8aa1328c10292f4a0a00f630345d42cc5b62f329a00fd11838afafb6af1a3f52ee5e1bcdd84dd596c042004253977079bb57f7fe9a2dff49fc1c7ba638c8d6
|
data/lib/zuora_api/exceptions.rb
CHANGED
@@ -112,6 +112,7 @@ module ZuoraAPI
|
|
112
112
|
class ZuoraAPIRequestLimit < Error
|
113
113
|
attr_reader :code, :response
|
114
114
|
attr_writer :default_message
|
115
|
+
attr_accessor :logged
|
115
116
|
|
116
117
|
def initialize(message = nil,response=nil, errors = [], successes = [], *args)
|
117
118
|
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
data/lib/zuora_api/login.rb
CHANGED
@@ -7,7 +7,7 @@ module ZuoraAPI
|
|
7
7
|
class Login
|
8
8
|
ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging' ]
|
9
9
|
REGIONS = [EU = 'EU', US = 'US', NA = 'NA' ]
|
10
|
-
MIN_Endpoints = {'Test': '
|
10
|
+
MIN_Endpoints = {'Test': '120.0', 'Sandbox': '120.0', 'Production': '120.0', 'Performance': '120.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '121.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
|
|
@@ -225,7 +225,8 @@ module ZuoraAPI
|
|
225
225
|
"NA" => {"Sandbox" => "https://sandbox.na.zuora.com/apps/services/a/",
|
226
226
|
"Production" => "https://na.zuora.com/apps/services/a/",
|
227
227
|
"Performance" => "https://pt1.na.zuora.com/apps/services/a/",
|
228
|
-
"Services" => "https://services347.na.zuora.com/apps/services/a/"
|
228
|
+
"Services" => "https://services347.na.zuora.com/apps/services/a/",
|
229
|
+
"Test" => "https://test.zuora.com/apps/services/a/"}
|
229
230
|
}
|
230
231
|
end
|
231
232
|
|
@@ -542,7 +543,10 @@ module ZuoraAPI
|
|
542
543
|
when ZuoraAPI::Exceptions::ZuoraAPIUnkownError, ZuoraAPI::Exceptions::ZuoraDataIntegrity
|
543
544
|
Rails.logger.error('Zuora Unknown/Integrity Error', ex, exception_args)
|
544
545
|
when ZuoraAPI::Exceptions::ZuoraAPIRequestLimit
|
545
|
-
|
546
|
+
if ex.logged.nil? || !ex.logged
|
547
|
+
ex.logged = true
|
548
|
+
Rails.logger.info('Zuora APILimit Reached', ex, exception_args)
|
549
|
+
end
|
546
550
|
when *(ZuoraAPI::Login::ZUORA_API_ERRORS-ZuoraAPI::Login::ZUORA_SERVER_ERRORS)
|
547
551
|
#Rails.logger.debug('Zuora API Error', ex, self.exception_args(ex))
|
548
552
|
when *ZuoraAPI::Login::ZUORA_SERVER_ERRORS
|
@@ -652,8 +656,15 @@ module ZuoraAPI
|
|
652
656
|
error = 'UNEXPECTED_ERROR'
|
653
657
|
if message.present?
|
654
658
|
identifier, new_message = message.scan(/^([\w\d]{16})\: (.*)/).first
|
655
|
-
|
656
|
-
|
659
|
+
if new_message.present?
|
660
|
+
if new_message.include?("The query exceeded maximum processing time")
|
661
|
+
error, message = ['TRANSACTION_FAILED', new_message.concat(" Please see KC for the Max Timeout Specification https://community.zuora.com/t5/Release-Notifications/Upcoming-Change-for-AQuA-and-Data-Source-Export-January-2021/ba-p/35024")]
|
662
|
+
else
|
663
|
+
error, message = ['UNEXPECTED_ERROR', new_message]
|
664
|
+
end
|
665
|
+
else
|
666
|
+
error, message = ['UNEXPECTED_ERROR', message]
|
667
|
+
end
|
657
668
|
else
|
658
669
|
message = 'Export failed due to unknown reason. Consult api logs.'
|
659
670
|
end
|
@@ -685,6 +696,7 @@ module ZuoraAPI
|
|
685
696
|
if body.dig('data', "errorCode") == "LINK_10000005"
|
686
697
|
raise ZuoraAPI::Exceptions::ZuoraAPITemporaryError.new(body.dig('data', "errorMessage"), response)
|
687
698
|
elsif (body.dig('data', "errorMessage").present? || body.dig('data', "queryStatus") == "failed")
|
699
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIUnkownError.new("Data query failed for unknown reasons. No error message.", response) if body.dig('data', "errorMessage").blank?
|
688
700
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body.dig('data', "errorMessage"), response)
|
689
701
|
end
|
690
702
|
when /^GET::404::\/query\/jobs\/([a-zA-Z0-9\-_]+)$/ #Get DQ job not found, capture of the id is present if needed in future error responses.
|
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.11.0.pre.a
|
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: 2022-
|
11
|
+
date: 2022-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -171,9 +171,6 @@ dependencies:
|
|
171
171
|
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: 4.1.0
|
174
|
-
- - "<"
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: '6.2'
|
177
174
|
type: :runtime
|
178
175
|
prerelease: false
|
179
176
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -181,9 +178,6 @@ dependencies:
|
|
181
178
|
- - ">="
|
182
179
|
- !ruby/object:Gem::Version
|
183
180
|
version: 4.1.0
|
184
|
-
- - "<"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '6.2'
|
187
181
|
description: Gem that provides easy integration to Zuora
|
188
182
|
email:
|
189
183
|
- connect@zuora.com
|
@@ -215,9 +209,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
209
|
version: '0'
|
216
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
211
|
requirements:
|
218
|
-
- - "
|
212
|
+
- - ">"
|
219
213
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
214
|
+
version: 1.3.1
|
221
215
|
requirements: []
|
222
216
|
rubygems_version: 3.3.7
|
223
217
|
signing_key:
|