zuora_api 1.3.0c → 1.3.0
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 +27 -2
- data/lib/zuora_api/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9903d7512c8ab1579f3a3023b6a04b1266b0d5b1
|
4
|
+
data.tar.gz: fe68ba31a76819854619b8745a1d4dfbf6a057c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd70085fd46f1142e783d8e237df7fc9ffee198cb79e57eaecace79fc706326f8ef214d9993cbb9fe78557beb6341b95a75f6591eaae25611cc48634cb15df61
|
7
|
+
data.tar.gz: e07f8e2799a4de885de156e045f89d0694d92c0794c1393f92cef94262be1b672287b90b632417865b559ab1bd3450513b89738f0af75c052c0c923729d273e4
|
data/lib/zuora_api/login.rb
CHANGED
@@ -77,8 +77,7 @@ module ZuoraAPI
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def fileURL
|
80
|
-
return self.url.split(".com").first.concat("
|
81
|
-
/apps/api/file/")
|
80
|
+
return self.url.split(".com").first.concat(".com/apps/api/file/")
|
82
81
|
end
|
83
82
|
|
84
83
|
def dateFormat
|
@@ -366,6 +365,32 @@ module ZuoraAPI
|
|
366
365
|
return self
|
367
366
|
end
|
368
367
|
|
368
|
+
def get_catalog
|
369
|
+
products, response = [{}, {'nextPage' => self.rest_endpoint('catalog/products?pageSize=40') }]
|
370
|
+
while !response["nextPage"].blank?
|
371
|
+
url = self.rest_endpoint(response["nextPage"].split('/v1/').last)
|
372
|
+
Rails.logger.debug("Fetch Catalog URL #{url}")
|
373
|
+
output_json, response = self.rest_call(:debug => false, :url => url)
|
374
|
+
if !output_json['success'] =~ (/(true|t|yes|y|1)$/i) || output_json['success'].class != TrueClass
|
375
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new("Error Getting Catalog: #{output_json}")
|
376
|
+
end
|
377
|
+
output_json["products"].each do |product|
|
378
|
+
rateplans = {}
|
379
|
+
product["productRatePlans"].each do |rateplan|
|
380
|
+
charges = {}
|
381
|
+
rateplan["productRatePlanCharges"].each do |charge|
|
382
|
+
charges[charge["id"]] = charge.merge({"productId" => product["id"], "productName" => product["name"], "productRatePlanId" => rateplan["id"], "productRatePlanName" => rateplan["name"] })
|
383
|
+
end
|
384
|
+
rateplan["productRatePlanCharges"] = charges
|
385
|
+
rateplans[rateplan["id"]] = rateplan.merge({"productId" => product["id"], "productName" => product["name"]})
|
386
|
+
end
|
387
|
+
product["productRatePlans"] = rateplans
|
388
|
+
products[product['id']] = product
|
389
|
+
end
|
390
|
+
end
|
391
|
+
return products
|
392
|
+
end
|
393
|
+
|
369
394
|
def get_file(file_name: nil, url: nil, headers: {}, count: 3, file_type: "zip")
|
370
395
|
begin
|
371
396
|
uri = URI.parse(url)
|
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: 1.3.
|
4
|
+
version: 1.3.0
|
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: 2017-05-
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,9 +150,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
|
-
- - "
|
153
|
+
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
version:
|
155
|
+
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
158
|
rubygems_version: 2.5.1
|