zuora_api 1.6.0 → 1.6.01
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zuora_api/login.rb +1 -1
- data/lib/zuora_api/logins/basic.rb +6 -6
- data/lib/zuora_api/logins/oauth.rb +6 -6
- data/lib/zuora_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a3704d8a2da32233bde2e47764342828f824624
|
4
|
+
data.tar.gz: aef13756ce6b7c5c45faca02d7e3d65843908585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6151fe3e4351e2068b056491f28769052ab256d078336a78ee07308613c7e19df16c5b031aee58e217390f1445830dc0e76fa0010d98036e8eb53773e254eed2
|
7
|
+
data.tar.gz: 66aea06abf1d1b2e08d7861c62eddc8f3944e864198b8537225950a465ff46025cd6cfb596a9668ff9a83ec61b11e6832f950cbaafc1210a86fd4a5389881fdb
|
data/lib/zuora_api/login.rb
CHANGED
@@ -461,7 +461,7 @@ module ZuoraAPI
|
|
461
461
|
end
|
462
462
|
rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
|
463
463
|
if !(tries -= 1).zero? && z_session
|
464
|
-
Rails.logger.debug("Rest Call - Session Invalid")
|
464
|
+
Rails.logger.debug("Rest Call - Session Invalid #{session_type}")
|
465
465
|
self.new_session(auth_type: session_type)
|
466
466
|
retry
|
467
467
|
else
|
@@ -7,8 +7,10 @@ module ZuoraAPI
|
|
7
7
|
super
|
8
8
|
end
|
9
9
|
|
10
|
-
def new_session(auth_type: :basic, debug: false)
|
10
|
+
def new_session( auth_type: :basic, debug: false)
|
11
11
|
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Basic Login, does not support Authentication of Type: #{auth_type}") if auth_type != :basic
|
12
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Basic Login requires username and password to be set.") if auth_type == :basic && (self.password.blank? && self.username.blank?)
|
13
|
+
|
12
14
|
tries ||= 2
|
13
15
|
request = Nokogiri::XML::Builder.new do |xml|
|
14
16
|
xml['SOAP-ENV'].Envelope('xmlns:SOAP-ENV' =>"http://schemas.xmlsoap.org/soap/envelope/", 'xmlns:api' => "http://api.zuora.com/" ) do
|
@@ -81,11 +83,9 @@ module ZuoraAPI
|
|
81
83
|
end
|
82
84
|
else
|
83
85
|
#Username & password combo
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
self.current_session = retrieved_session
|
88
|
-
end
|
86
|
+
retrieved_session = @output_xml.xpath('//ns1:Session', 'ns1' =>'http://api.zuora.com/').text
|
87
|
+
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("No session found for api call.") if retrieved_session.blank?
|
88
|
+
self.current_session = retrieved_session
|
89
89
|
end
|
90
90
|
return self.status
|
91
91
|
rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
|
@@ -11,15 +11,15 @@ module ZuoraAPI
|
|
11
11
|
super
|
12
12
|
end
|
13
13
|
|
14
|
-
def new_session(auth_type: nil)
|
14
|
+
def new_session(raise_errors: false, auth_type: nil)
|
15
15
|
if auth_type == :bearer
|
16
|
-
|
16
|
+
get_bearer_token()
|
17
17
|
elsif auth_type == :basic
|
18
|
-
|
19
|
-
|
18
|
+
get_bearer_token() if self.oauth_expired?
|
19
|
+
get_z_session()
|
20
20
|
else
|
21
|
-
|
22
|
-
|
21
|
+
get_bearer_token()
|
22
|
+
get_z_session()
|
23
23
|
end
|
24
24
|
return self.status
|
25
25
|
end
|
data/lib/zuora_api/version.rb
CHANGED