zuora_api 1.6.05 → 1.6.06
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/Gemfile.lock +1 -1
- data/lib/zuora_api/login.rb +9 -6
- 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: 8cb1e32a82e7c3fd01dcf3d215c3d617cec5756e
|
4
|
+
data.tar.gz: 1b14fa9ca4eefdb274416462e40ec7f5e63be874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a36436cb1fbf7c2ae7a5bb5ac35e701c5c4db88fadf40834054badf144a08ad40a5c6799f2834dd18ff4226315884424ae561d10aae1403689c8ee03ad196ab
|
7
|
+
data.tar.gz: 3973c49d3245e87bd2fa58ae80536bcbce47fa3ad8fb58d383e57984087fb8e4a286f86481db6b447bb8b6daa37381d7c524ac813bdb33236a1e0b76fa40ad89
|
data/Gemfile.lock
CHANGED
data/lib/zuora_api/login.rb
CHANGED
@@ -392,7 +392,7 @@ module ZuoraAPI
|
|
392
392
|
headers = !self.entity_id.blank? ? {"entityId" => self.entity_id, 'Content-Type' => "text/xml; charset=utf-8"} : {'Content-Type' => "text/xml; charset=utf-8"}
|
393
393
|
response = HTTParty.get(url, headers: {"Authorization" => self.get_session(prefix: true, auth_type: :basic)}.merge(headers), :timeout => 120)
|
394
394
|
|
395
|
-
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Session Expired") if response.code
|
395
|
+
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Session Expired") if response.code == 401
|
396
396
|
output_xml = Nokogiri::XML(response.body)
|
397
397
|
des_hash = Hash.new
|
398
398
|
if object == nil
|
@@ -549,7 +549,7 @@ module ZuoraAPI
|
|
549
549
|
return products, catalog_map
|
550
550
|
end
|
551
551
|
|
552
|
-
def get_file(url: nil, headers: {}, count: 3, z_session: true, tempfile: true, file_path: defined?(Rails.root.join('tmp')) ? Rails.root.join('tmp') : Pathname.new(Dir.pwd), timeout_retries: 2, timeout: 120, **execute_params)
|
552
|
+
def get_file(url: nil, headers: {}, count: 3, z_session: true, tempfile: true, file_path: defined?(Rails.root.join('tmp')) ? Rails.root.join('tmp') : Pathname.new(Dir.pwd), timeout_retries: 2, timeout: 120, session_type: :basic, **execute_params)
|
553
553
|
raise "file_path must be of class Pathname" if file_path.class != Pathname
|
554
554
|
|
555
555
|
#Make sure directory exists
|
@@ -562,7 +562,7 @@ module ZuoraAPI
|
|
562
562
|
http = Net::HTTP.new(uri.host, uri.port)
|
563
563
|
http.read_timeout = timeout #Seconds
|
564
564
|
http.use_ssl = true if uri.scheme.downcase == 'https'
|
565
|
-
headers = headers.merge({"Authorization" => self.get_session(prefix: true)}) if z_session
|
565
|
+
headers = headers.merge({"Authorization" => self.get_session(prefix: true, auth_type: session_type)}) if z_session
|
566
566
|
|
567
567
|
response_save = nil
|
568
568
|
http.request_get(uri.path, headers) do |response|
|
@@ -575,9 +575,13 @@ module ZuoraAPI
|
|
575
575
|
raise response
|
576
576
|
|
577
577
|
when Net::HTTPUnauthorized
|
578
|
-
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new(self.current_error) if count <= 0
|
579
578
|
Rails.logger.fatal("Unauthorized: Retry")
|
580
|
-
|
579
|
+
if z_session
|
580
|
+
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new(self.current_error) if count <= 0
|
581
|
+
self.new_session
|
582
|
+
else
|
583
|
+
raise if count <= 0
|
584
|
+
end
|
581
585
|
return get_file(:url => url, :headers => headers, :count => count - 1, :z_session => z_session, :tempfile => tempfile, :file_path => file_path, :timeout_retries => timeout_retries, :timeout => timeout)
|
582
586
|
|
583
587
|
when Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError
|
@@ -585,7 +589,6 @@ module ZuoraAPI
|
|
585
589
|
return get_file(:url => url, :headers => headers, :count => count, :z_session => z_session, :tempfile => tempfile, :file_path => file_path, :timeout_retries => timeout_retries - 1, :timeout => timeout)
|
586
590
|
|
587
591
|
when Net::HTTPClientError
|
588
|
-
Rails.logger.fatal("Login: #{self.username} Export")
|
589
592
|
raise response
|
590
593
|
|
591
594
|
when Net::HTTPOK
|
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.6.
|
4
|
+
version: 1.6.06
|
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: 2018-09-
|
11
|
+
date: 2018-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|