zuora_api 1.6.52 → 1.6.53
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/Gemfile.lock +1 -1
- data/lib/zuora_api/login.rb +8 -5
- data/lib/zuora_api/logins/oauth.rb +2 -2
- 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: ed037576dc60374785dbe40ce799c89c0fbfea3d20d7cda64af79f376ca0833c
|
|
4
|
+
data.tar.gz: c21e1539327e824eb594890f4516a0666fd2e83e34a380518cf87f91df4ba011
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9203de072438ff869fb2fe7918863a9485fc07ccbb4803b47e24bb40b0b9cca87cc0aad3e1391898db0569adc72b7bbc179e57098e9da25f81c84dc216d8ca7f
|
|
7
|
+
data.tar.gz: 8c0ec94ac13435ebad812ad953e2263d832e91d733f109124af717da95991ae044b4a43c4d6d77c2f2a7bb35ec5b91b7c68259f3ab429840d43c095ff0ccaf0c
|
data/Gemfile.lock
CHANGED
data/lib/zuora_api/login.rb
CHANGED
|
@@ -377,7 +377,7 @@ module ZuoraAPI
|
|
|
377
377
|
if self.bearer_token.blank? || self.oauth_expired?
|
|
378
378
|
self.new_session(auth_type: :bearer)
|
|
379
379
|
end
|
|
380
|
-
self.get_z_session
|
|
380
|
+
self.get_z_session if self.status == 'Active'
|
|
381
381
|
when 'ZuoraAPI::Basic'
|
|
382
382
|
self.new_session(auth_type: :basic)
|
|
383
383
|
else
|
|
@@ -557,8 +557,10 @@ module ZuoraAPI
|
|
|
557
557
|
when :JSON
|
|
558
558
|
body = body.dig("results").present? ? body["results"] : body if body.class == Hash
|
|
559
559
|
if body.class == Hash && (!body["success"] || !body["Success"] || response.code != 200)
|
|
560
|
-
messages_array = (
|
|
561
|
-
|
|
560
|
+
messages_array = body.fetch("reasons", []).map {|error| error['message']}.compact
|
|
561
|
+
messages_array = messages_array.push(body.dig("error", 'message')).compact if body.dig('error').class == Hash
|
|
562
|
+
codes_array = body.fetch("reasons", []).map {|error| error['code']}.compact
|
|
563
|
+
codes_array = codes_array.push(body.dig("error", 'code')).compact if body.dig('error').class == Hash
|
|
562
564
|
|
|
563
565
|
if body['message'] == "No bearer token" && response.code == 400
|
|
564
566
|
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Authentication type is not supported by this Login", response)
|
|
@@ -745,11 +747,12 @@ module ZuoraAPI
|
|
|
745
747
|
raise ex
|
|
746
748
|
end
|
|
747
749
|
rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
|
|
748
|
-
if !(tries -= 1).zero?
|
|
749
|
-
Rails.logger.
|
|
750
|
+
if !(tries -= 1).zero? && self.status == 'Active'
|
|
751
|
+
Rails.logger.debug("Session expired. Starting new session.")
|
|
750
752
|
self.new_session
|
|
751
753
|
retry
|
|
752
754
|
else
|
|
755
|
+
Rails.logger.error("Session expired. Starting new session.")
|
|
753
756
|
raise ex
|
|
754
757
|
end
|
|
755
758
|
rescue => ex
|
|
@@ -16,10 +16,10 @@ module ZuoraAPI
|
|
|
16
16
|
get_bearer_token()
|
|
17
17
|
elsif auth_type == :basic
|
|
18
18
|
get_bearer_token() if self.oauth_expired?
|
|
19
|
-
get_z_session()
|
|
19
|
+
get_z_session() if self.status == 'Active'
|
|
20
20
|
else
|
|
21
21
|
get_bearer_token()
|
|
22
|
-
get_z_session()
|
|
22
|
+
get_z_session() if self.status == 'Active'
|
|
23
23
|
end
|
|
24
24
|
return self.status
|
|
25
25
|
end
|
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.6.
|
|
4
|
+
version: 1.6.53
|
|
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: 2019-07-
|
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|