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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65fac01cabaf327d7cf9b15fbce13cfb784ecc28
4
- data.tar.gz: 3d02d5242b1800403685ef3408891337de774f98
3
+ metadata.gz: 8a3704d8a2da32233bde2e47764342828f824624
4
+ data.tar.gz: aef13756ce6b7c5c45faca02d7e3d65843908585
5
5
  SHA512:
6
- metadata.gz: cb9dc6f29b775a6174470fd1c122da7951ba05a5b43a700cd23001e2b584654d337e2b5489b900f158d9a1ddab7d4eb3efc7ac02139df7925e410e81647159f8
7
- data.tar.gz: e9f520c636e4c6f7b2a51088af86bd916fd6191102e4f555f16c2bc9af97f70a379af42cc067d5fd2a7a02a09efdc42a7ede6408560e66df11795ae168bb0bb3
6
+ metadata.gz: 6151fe3e4351e2068b056491f28769052ab256d078336a78ee07308613c7e19df16c5b031aee58e217390f1445830dc0e76fa0010d98036e8eb53773e254eed2
7
+ data.tar.gz: 66aea06abf1d1b2e08d7861c62eddc8f3944e864198b8537225950a465ff46025cd6cfb596a9668ff9a83ec61b11e6832f950cbaafc1210a86fd4a5389881fdb
@@ -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
- if (self.password.present? && self.username.present?)
85
- retrieved_session = @output_xml.xpath('//ns1:Session', 'ns1' =>'http://api.zuora.com/').text
86
- raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("No session found for api call.") if retrieved_session.blank?
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
- get_bearer_token()
16
+ get_bearer_token()
17
17
  elsif auth_type == :basic
18
- get_bearer_token() if self.oauth_expired?
19
- get_z_session()
18
+ get_bearer_token() if self.oauth_expired?
19
+ get_z_session()
20
20
  else
21
- get_bearer_token()
22
- get_z_session()
21
+ get_bearer_token()
22
+ get_z_session()
23
23
  end
24
24
  return self.status
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.01"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.01
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group