zuora_api 1.7.63 → 1.7.64

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88e37565531ff8c2754161d3f80ca9a85595ba7ae8edf3b8197f5725befc380d
4
- data.tar.gz: f772100edddb68b366a278b5495be155e31ca02a5bfdbbad4bd9e4c61b892f11
3
+ metadata.gz: 340446bc0ceb955e7c27ed8460d8752f9e1a7183b00cfce6e5c6d8bec906aa1c
4
+ data.tar.gz: 74f68adcdc9e0b5e83bf586149b38b66b692bdc50a9554172b3f7ba03c36c7d2
5
5
  SHA512:
6
- metadata.gz: e5e6696b9959dab076dae74897fe2740e097d4000362c090b4598be754fab34bcbd07b84d1c05bdd46f2f7d2549bf5ad34538ad42bfcbb8c26f0f959c7e43a08
7
- data.tar.gz: fa8b457a3dd8628cf580d29bb2181da3213ca40a2f707693ac8e5647d458766dc01e1c8c1e98cac9b548e0883f6e00c9c9feafa5a04ee930a01208f28aa957f1
6
+ metadata.gz: e33bb4f39c96629690aa3606e1b768af0390c484126db0828af456122b0b3dac78fc4e6d453a3f8631a3147eba89b031e00993130e355f394dfe20a655713f48
7
+ data.tar.gz: cf81fe9fc35668007a47bdf2c06195f409e6af0f8b60c181baea4f45db29b9860aca9827b7096c6d584ddc51328d9724ec56df2746f4aeb0496150404c0b5990
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zuora_api (1.7.63)
4
+ zuora_api (1.7.64)
5
5
  httparty
6
6
  nokogiri
7
7
  railties (>= 4.1.0, < 6)
@@ -201,7 +201,7 @@ module ZuoraAPI
201
201
  "Production" => "https://zconnect.na.zuora.com/api/rest/v1/",
202
202
  "Services"=> ""}
203
203
  }
204
- return map[zuora_client.region][zuora_client.environment].insert(-1, path)
204
+ return map[self.region][self.environment].insert(-1, path)
205
205
  end
206
206
 
207
207
  # There are two ways to call this method. The first way is best.
@@ -656,14 +656,15 @@ module ZuoraAPI
656
656
  raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body.dig('message'), response) if body.dig('message').present?
657
657
  end
658
658
  when /^\/api\/rest\/v1\/reports.*/ #Reporting Paths
659
- if body.dig('message') == "com.zuora.rest.RestUsageException: The user does not have permissions for this API."
660
- raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body.dig('message'), response)
659
+ reporting_message = response.parsed_response.dig("ZanResponse", "response", "message") || body.dig("message")
660
+ if reporting_message&.include?("com.zuora.rest.RestUsageException: The user does not have permissions for this API.")
661
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new(reporting_message, response)
662
+ elsif reporting_message&.include?("500 Internal Server Error")
663
+ raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Internal Server Error. The Reporting API is down. Contact Support.")
661
664
  end
662
665
  case match_string
663
- when /^GET::400::\/api\/rest\/v1\/reports\/([a-zA-Z0-9\-_]+)\/report-details$/ # Get report, capture of the id is present if needed in future error responses.
664
- if response.parsed_response.dig("ZanResponse", "response", "message").present?
665
- raise ZuoraAPI::Exceptions::ZuoraAPIError.new(response.parsed_response.dig("ZanResponse", "response", "message"), response)
666
- end
666
+ when /^GET::400::\/api\/rest\/v1\/reports\/([a-zA-Z0-9\-_]+)\/report-details$/ # Get report, capture of the id is present if needed in future error responses.
667
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new(reporting_message, response) if reporting_message.present?
667
668
  end
668
669
  end
669
670
 
@@ -1010,14 +1011,17 @@ module ZuoraAPI
1010
1011
  )
1011
1012
  tries ||= 2
1012
1013
 
1013
- if self.entity_id.present?
1014
- headers["Zuora-Entity-Ids"] = self.entity_id if headers.dig("Zuora-Entity-Ids").nil?
1015
- headers.delete_if { |key, value| ["entityId", "entityName"].include?(key.to_s) }
1016
- end
1017
-
1018
1014
  raise "Method not supported, supported methods include: :get, :post, :put, :delete, :patch, :head, :options" if ![:get, :post, :put, :delete, :patch, :head, :options].include?(method)
1019
1015
 
1020
- authentication_headers = z_session ? {"Authorization" => self.get_session(prefix: true, auth_type: session_type) } : {}
1016
+ authentication_headers = {}
1017
+ if z_session
1018
+ authentication_headers = {"Authorization" => self.get_session(prefix: true, auth_type: session_type) }
1019
+ if self.entity_id.present?
1020
+ authentication_headers["Zuora-Entity-Ids"] = self.entity_id if headers.dig("Zuora-Entity-Ids").nil?
1021
+ authentication_headers.delete_if { |key, value| ["entityId", "entityName"].include?(key.to_s) }
1022
+ end
1023
+ end
1024
+
1021
1025
  modified_headers = {'Content-Type' => "application/json; charset=utf-8"}.merge(authentication_headers).merge(headers)
1022
1026
 
1023
1027
  begin
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.7.63"
2
+ VERSION = "1.7.64"
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.7.63
4
+ version: 1.7.64
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: 2020-04-21 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler