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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad2dd604b242b5d65a8afb816b288d305f9d9d5942978f8de6df804bda459671
4
- data.tar.gz: cbdade951b0e82426428e0d781dd7d13ca799213f46eaf9f3a7e20c74e6cda94
3
+ metadata.gz: ed037576dc60374785dbe40ce799c89c0fbfea3d20d7cda64af79f376ca0833c
4
+ data.tar.gz: c21e1539327e824eb594890f4516a0666fd2e83e34a380518cf87f91df4ba011
5
5
  SHA512:
6
- metadata.gz: '0918d218a85e19c04f16c7895ef9bea27a624d7d2f38b9c2680c3952bcd012a9ce02e52c76b803764dfc1ef775b7398fea762c99b004b03f5142a806c75c1e2c'
7
- data.tar.gz: 892681e94a90102d8423fa20b2a14becf74546169ed8791bbfb2f53da29ed1b6f0b4bbd49037830688b977169bb18bc6c4158b0339e18f58af4201ee893bbc3c
6
+ metadata.gz: 9203de072438ff869fb2fe7918863a9485fc07ccbb4803b47e24bb40b0b9cca87cc0aad3e1391898db0569adc72b7bbc179e57098e9da25f81c84dc216d8ca7f
7
+ data.tar.gz: 8c0ec94ac13435ebad812ad953e2263d832e91d733f109124af717da95991ae044b4a43c4d6d77c2f2a7bb35ec5b91b7c68259f3ab429840d43c095ff0ccaf0c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zuora_api (1.6.52)
4
+ zuora_api (1.6.53)
5
5
  httparty
6
6
  nokogiri
7
7
  railties (>= 4.1.0, < 5.2)
@@ -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 = (body["reasons"] || []).map {|error| error['message']}.compact
561
- codes_array = (body["reasons"] || []).map {|error| error['code']}.compact
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.info("Session expired. Starting new session.")
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
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.6.52"
2
+ VERSION = "1.6.53"
3
3
  end
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.52
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-22 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler