zuora_api 0.2.7.6.2 → 0.2.7.6.5

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
  SHA1:
3
- metadata.gz: 3d6c95bd97b1097d97abd832a65fa12cc3fe9705
4
- data.tar.gz: 3195b3580e5d4b6ff89df0b75c67c7121d4154eb
3
+ metadata.gz: 1c71e0318ded88fd9ccf75579553100d7aca9776
4
+ data.tar.gz: 9a6ca73fa57b27c775c4eada2338ea9e14c94d4d
5
5
  SHA512:
6
- metadata.gz: 26d12674e9ab5b07c4421237acce8f6339a84a7c4a2eed0532be7633676770f65e7a9d9048adbc54d7ea2dda019668290c6c00076ea0f7549604be97f56a3838
7
- data.tar.gz: d5288f56efe0c1c421fee882b2360dbfc542f8af1516024f0b9394f70f654270c999f4159e5275193c129951d28c54bdc7597b4e1689f5352798696e3a6d93d0
6
+ metadata.gz: e2bab74f3712de8f6bd9add33bc3e99aaf158cc68f90a5fd7a24348edc10f7f31619b318ab2d4cae7e8a4b091b5a0e8bfdbd5296e7c43047b60c59dbfde1c59a
7
+ data.tar.gz: 92e8d1a36ff9e6ecfd6e78c6513a005a4aed1fb92f37274ec577f3ce711d70ce0fc1221ef69482f4a9b5eadf00931945163fb92cb270885b0a0e7d584586ac6b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zuora_api (0.2.7.6.2)
4
+ zuora_api (0.2.7.6.5)
5
5
  httparty
6
6
  nokogiri (~> 1.6.8)
7
7
  railties (>= 4.1.0, < 5.1)
@@ -264,12 +264,20 @@ module ZuoraAPI
264
264
  tries ||= 2
265
265
  raise "Method not supported, supported methods include: :get, :post, :put, :delete, :patch, :head, :options" if ![:get, :post, :put, :delete, :patch, :head, :options].include?(method)
266
266
  response = HTTParty::Request.new("Net::HTTP::#{method.to_s.capitalize}".constantize, url, body: body, headers: {'Content-Type' => "application/json; charset=utf-8", "Authorization" => "ZSession #{self.get_session}"}.merge(headers)).perform
267
- raise "#{response.code}::#{response.message}" if !response.success?
268
267
  Rails.logger.debug('Connect') { response.code} if debug
269
268
  output_json = JSON.parse(response.body)
270
269
  Rails.logger.debug('Connect') {"Response JSON: #{output_json}"} if debug
271
- raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("#{output_json["reasons"][0]["message"]}") if !output_json["success"] && response.code != 200 && output_json["reasons"][0]["code"] == 90000011
272
- raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{output_json["reasons"][0]["code"]}::#{output_json["reasons"][0]["message"]}") if (!output_json["success"] && !output_json["done"]) || response.code != 200
270
+
271
+ #Zuora Regular REST API Unauthorized
272
+ raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("#{output_json["reasons"][0]["message"]}") if (!output_json["success"] && !output_json["reasons"].blank? && output_json["reasons"] == Array && output_json["reasons"][0]["code"] == 90000011 && response.code == 401)
273
+ #Zuora AQuA Unauthorized
274
+ raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Unauthorized") if response.code == 401
275
+ #Zuora REST Query Errors
276
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{output_json["faultcode"]}::#{output_json["faultstring"]}") if !output_json["faultcode"].blank?
277
+ #Zuora REST actions error
278
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{output_json["Errors"][0]["Code"]}::#{output_json["Errors"][0]["Message"]}") if output_json.class != Array && !output_json["Success"] && output_json["Errors"]
279
+ #Zuora All Other API Errors
280
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new("#{response.message}") if response.code != 200
273
281
  rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
274
282
  if !(tries -= 1).zero?
275
283
  Rails.logger.debug {"Session Invalid"}
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "0.2.7.6.2"
2
+ VERSION = "0.2.7.6.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7.6.2
4
+ version: 0.2.7.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group