zuora_api 0.2.7.2 → 0.2.7.3
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/lib/zuora_api/login.rb +15 -42
- data/lib/zuora_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc1c0c19c6ed01080a6716636227a5704c30056
|
4
|
+
data.tar.gz: 36d2997dd12f6ddaff27deccf3aa0150ea796e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e2f67e8fbad28fc13983060f0575f34051f99a093826dc12f0bbd27526b128aef3b16aa3823cafbf427953f47f3bd8c252d5d3e8afbe746e93a25087690528e
|
7
|
+
data.tar.gz: 5c22ff75f2454c8d882ebddf2916b2bdc6c5142caa86b5321989a79e00535907a32e21e8eb61db45c52aba1afd547ba30340ca3da17e48e8d046e2ff66f88f34
|
data/lib/zuora_api/login.rb
CHANGED
@@ -260,31 +260,6 @@ module ZuoraAPI
|
|
260
260
|
return des_hash
|
261
261
|
end
|
262
262
|
|
263
|
-
def rest_call_full(method: :get, body: {}, url: rest_endpoint("catalog/products?pageSize=4") , **keyword_args)
|
264
|
-
begin
|
265
|
-
tries ||= 2
|
266
|
-
raise "Method not supported, supported methods include: :get, :post, :put, :delete, :patch, :head, :options" if ![:get, :post, :put, :delete, :patch, :head, :options].include?(method)
|
267
|
-
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}"}).perform
|
268
|
-
raise "#{response.code}::#{response.return_code}" if !response.success?
|
269
|
-
output_json = JSON.parse(response.body)
|
270
|
-
Rails.logger.debug('Connect') {"Response JSON: #{output_json}"}
|
271
|
-
rescue => ex
|
272
|
-
if !(tries -= 1).zero?
|
273
|
-
case ex.to_s.split("::")[0]
|
274
|
-
when "90000011"
|
275
|
-
Rails.logger.debug {"Session Invalid"}
|
276
|
-
self.new_session
|
277
|
-
retry
|
278
|
-
else
|
279
|
-
raise ex
|
280
|
-
end
|
281
|
-
else
|
282
|
-
raise ex
|
283
|
-
end
|
284
|
-
end
|
285
|
-
return output_json
|
286
|
-
end
|
287
|
-
|
288
263
|
def rest_call(method: :get, body: {},headers: {}, url: rest_endpoint("catalog/products?pageSize=4") , debug: true, **keyword_args)
|
289
264
|
tries ||= 2
|
290
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)
|
@@ -293,28 +268,26 @@ module ZuoraAPI
|
|
293
268
|
Rails.logger.debug('Connect') { response.code} if debug
|
294
269
|
output_json = JSON.parse(response.body)
|
295
270
|
Rails.logger.debug('Connect') {"Response JSON: #{output_json}"} if debug
|
296
|
-
raise "#{output_json["reasons"][0]["
|
297
|
-
|
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"] || response.code != 200
|
273
|
+
rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
|
298
274
|
if !(tries -= 1).zero?
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
else
|
308
|
-
return output_json, response
|
309
|
-
end
|
310
|
-
end
|
311
|
-
elsif debug
|
275
|
+
Rails.logger.debug {"Session Invalid"}
|
276
|
+
self.new_session
|
277
|
+
retry
|
278
|
+
else
|
279
|
+
raise ex
|
280
|
+
end
|
281
|
+
rescue ZuoraAPI::Exceptions::ZuoraAPIError => ex
|
282
|
+
if debug
|
312
283
|
raise ex
|
313
284
|
else
|
314
|
-
return output_json, response
|
285
|
+
return [output_json, response]
|
315
286
|
end
|
287
|
+
rescue => ex
|
288
|
+
raise ex
|
316
289
|
else
|
317
|
-
return output_json, response
|
290
|
+
return [output_json, response]
|
318
291
|
end
|
319
292
|
|
320
293
|
def update_create_tenant
|
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: 0.2.7.
|
4
|
+
version: 0.2.7.3
|
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: 2016-11-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|