zuora_api 0.2.4.6 → 0.2.5.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 +16 -13
- 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: e01e3f51fbb499c9b26cfb6ae57b9cf7dc89eab2
|
4
|
+
data.tar.gz: d9d6aa6a9ff16802b9a74e549ceebda47ae751a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf77c3ab0d4721ec880e062907c8fb6bb53bfaf29df90d483d7805ed48f3ba69536a203c8b8b6abbffa87839c801d56e26291543bf2e9dd365d0ed4bdc47f2a7
|
7
|
+
data.tar.gz: e8d1a461201d4c680fd960524edfe51ee92660dcb025e633148b4edc042f6243d05b8db6dcc46f8650e35c3ec14decc62dd0cad3045accf6779356ef78fccfbb
|
data/lib/zuora_api/login.rb
CHANGED
@@ -4,17 +4,20 @@ module ZuoraAPI
|
|
4
4
|
class Login
|
5
5
|
ENVIRONMENTS = [SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown' ]
|
6
6
|
|
7
|
-
attr_accessor :username, :password, :url, :wsdl_number, :status, :current_session, :environment, :status, :errors, :current_error, :user_info, :tenant_id, :tenant_name
|
7
|
+
attr_accessor :username, :password, :url, :wsdl_number, :status, :current_session, :environment, :status, :errors, :current_error, :user_info, :tenant_id, :tenant_name, :entity_id
|
8
|
+
|
9
|
+
def initialize(username: nil, password: nil, url: nil, entity_id: nil, session: nil, **keyword_args)
|
10
|
+
@username = username
|
11
|
+
@password = password
|
12
|
+
@url = url
|
13
|
+
@entity_id = entity_id
|
14
|
+
@current_session = session
|
15
|
+
@errors = Hash.new
|
16
|
+
@status = "Active"
|
17
|
+
@user_info = Hash.new
|
18
|
+
self.update_environment
|
19
|
+
end
|
8
20
|
|
9
|
-
def initialize(username,password,url)
|
10
|
-
@username = username
|
11
|
-
@password = password
|
12
|
-
@errors = Hash.new
|
13
|
-
@user_info = Hash.new
|
14
|
-
@url = url
|
15
|
-
self.new_session
|
16
|
-
self.update_environment
|
17
|
-
end
|
18
21
|
|
19
22
|
def self.environments
|
20
23
|
%w(Sandbox Production Services Performance)
|
@@ -244,12 +247,12 @@ module ZuoraAPI
|
|
244
247
|
|
245
248
|
def rest_call(method: :get, body: {}, url: rest_endpoint("catalog/products?pageSize=4") , **keyword_args)
|
246
249
|
tries ||= 2
|
247
|
-
|
248
|
-
response = HTTParty.
|
250
|
+
raise "Method not supported, supported methods include: :get, :post, :put, :delete, :patch, :head, :options" if ![:get, :post, :put, :delete, :patch, :head, :options].include?(method)
|
251
|
+
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
|
249
252
|
raise "#{response.code}::#{response.return_code}" if !response.success?
|
250
253
|
output_json = JSON.parse(response.body)
|
251
254
|
Rails.logger.debug('Connect') {"Response JSON: #{output_json}"}
|
252
|
-
raise "#{output_json["reasons"][0]["code"]}::#{output_json["reasons"][0]["message"]}" if !output_json["success"]
|
255
|
+
raise "#{output_json["reasons"][0]["code"]}::#{output_json["reasons"][0]["message"]}" if !output_json["success"]
|
253
256
|
rescue => ex
|
254
257
|
if !(tries -= 1).zero?
|
255
258
|
case ex.to_s.split("::")[0]
|
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.
|
4
|
+
version: 0.2.5.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: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|