zuora_api 0.2.7.0 → 0.2.7.1

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
  SHA1:
3
- metadata.gz: 316da6cfc7bdfda2eb32301749d6830dfc6337f7
4
- data.tar.gz: 379d5933b1615b2985bc09c3c24e618fb73878c5
3
+ metadata.gz: 4e861be8997030565b43cf09a909a0daf0e54fb3
4
+ data.tar.gz: e26feda4866af5ed05a6ea487b027c99b9558c7a
5
5
  SHA512:
6
- metadata.gz: 8fa52339742bf21b6364c8123cf4534da30d4d13788479594a9acc15f7b306579ba19984453c8f808918c2a86dae57db4645534d3d63f94e625b86207e170114
7
- data.tar.gz: 905294c50b5222b17874c505acfbcc7e69730a97c91b3aaab9ff4d1a8ec7430b6664f696bb377d22fcc8e641b263a4e8e87c9a0b94214276aa031f2233fe26ef
6
+ metadata.gz: bd903fb7babf044e18581ea1c8b6449bad68bb60af1cb2b2e6324c32f0884fb3b12eae5f64ea974a3a45df7bacfe068fbcacb76c73a01ebacc3e1011a3e68f3d
7
+ data.tar.gz: ff98abec36239a83a5769bd2afbf1b51857327824fcb8608eaa7538cd3bf26fa75277fc6dc57127b32d6db05fd821ea092868096db48569242d3c26805257ae7
@@ -48,6 +48,16 @@ module ZuoraAPI
48
48
  end
49
49
  end
50
50
 
51
+ def aqua_endpoint(url="")
52
+ if self.environment == 'Sandbox'
53
+ return "https://apisandbox.zuora.com/apps/api/".concat(url)
54
+ elsif self.environment == 'Production'
55
+ return "https://zuora.com/apps/api/".concat(url)
56
+ else self.environment == 'Unknown'
57
+ return url
58
+ end
59
+ end
60
+
51
61
  def rest_endpoint(url="")
52
62
  if self.environment == 'Sandbox'
53
63
  return "https://rest.apisandbox.zuora.com/v1/".concat(url)
@@ -255,6 +265,31 @@ module ZuoraAPI
255
265
  return des_hash
256
266
  end
257
267
 
268
+ def rest_call_full(method: :get, body: {}, url: rest_endpoint("catalog/products?pageSize=4") , **keyword_args)
269
+ begin
270
+ tries ||= 2
271
+ raise "Method not supported, supported methods include: :get, :post, :put, :delete, :patch, :head, :options" if ![:get, :post, :put, :delete, :patch, :head, :options].include?(method)
272
+ 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
273
+ raise "#{response.code}::#{response.return_code}" if !response.success?
274
+ output_json = JSON.parse(response.body)
275
+ Rails.logger.debug('Connect') {"Response JSON: #{output_json}"}
276
+ rescue => ex
277
+ if !(tries -= 1).zero?
278
+ case ex.to_s.split("::")[0]
279
+ when "90000011"
280
+ Rails.logger.debug {"Session Invalid"}
281
+ self.new_session
282
+ retry
283
+ else
284
+ raise ex
285
+ end
286
+ else
287
+ raise ex
288
+ end
289
+ end
290
+ return output_json
291
+ end
292
+
258
293
  def rest_call(method: :get, body: {},headers: {}, url: rest_endpoint("catalog/products?pageSize=4") , debug: true, **keyword_args)
259
294
  tries ||= 2
260
295
  raise "Method not supported, supported methods include: :get, :post, :put, :delete, :patch, :head, :options" if ![:get, :post, :put, :delete, :patch, :head, :options].include?(method)
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "0.2.7.0"
2
+ VERSION = "0.2.7.1"
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: 0.2.7.0
4
+ version: 0.2.7.1
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-18 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler