zuora_api 1.7.43 → 1.7.44
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 +16 -15
- data/lib/zuora_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c41d6dd1dbd9a4295b5bc51d4fce6d12f3f754d6078c2e07cf2da30da7c0968
|
4
|
+
data.tar.gz: eb505fe8a19eaa9f62f0ffad34fc00b3da4a12fbc8d61a030c24aebbc4a604cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d139d75ee71fe6e3aedc9cac00744530b991e1c413f45102abdb8ac2d2eba48e462e9cf243b8a1994cba08c66efae147182d4fd05a547344c08cd88b890b23
|
7
|
+
data.tar.gz: e33f029050a4b8b91f5b076b1e509d4f7a5cb2edb8751b17cc639ae0a0ee4c5034250fa280b63e514c043cc4e9caecfc511fdf51ce7a5a3da2ecde48531279b2
|
data/lib/zuora_api/login.rb
CHANGED
@@ -926,15 +926,20 @@ module ZuoraAPI
|
|
926
926
|
authentication_headers = z_session ? {"Authorization" => self.get_session(prefix: true, auth_type: session_type) } : {}
|
927
927
|
modified_headers = {'Content-Type' => "application/json; charset=utf-8"}.merge(authentication_headers).merge(headers)
|
928
928
|
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
929
|
+
begin
|
930
|
+
response = HTTParty::Request.new(
|
931
|
+
"Net::HTTP::#{method.to_s.capitalize}".constantize,
|
932
|
+
url,
|
933
|
+
body: body,
|
934
|
+
headers: modified_headers,
|
935
|
+
timeout: timeout,
|
936
|
+
multipart: multipart,
|
937
|
+
stream_body: stream_body
|
938
|
+
).perform(&block)
|
939
|
+
rescue
|
940
|
+
rewind_files(body) if multipart
|
941
|
+
raise
|
942
|
+
end
|
938
943
|
|
939
944
|
Rails.logger.debug("Response Code: #{response.code}") if debug
|
940
945
|
begin
|
@@ -947,7 +952,8 @@ module ZuoraAPI
|
|
947
952
|
raise_errors(type: :JSON, body: output_json, response: response)
|
948
953
|
rescue ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError => ex
|
949
954
|
if self.class.to_s == 'ZuoraAPI::Oauth' && ex.message.include?("Authentication type is not supported by this Login")
|
950
|
-
|
955
|
+
session_type = :bearer
|
956
|
+
retry
|
951
957
|
else
|
952
958
|
Rails.logger.debug("Rest Call - Session Bad Auth type")
|
953
959
|
raise ex
|
@@ -963,8 +969,6 @@ module ZuoraAPI
|
|
963
969
|
return [output_json, ex.response]
|
964
970
|
end
|
965
971
|
|
966
|
-
rewind_files(body) if multipart
|
967
|
-
|
968
972
|
retry
|
969
973
|
else
|
970
974
|
if errors.include?(ex.class)
|
@@ -990,7 +994,6 @@ module ZuoraAPI
|
|
990
994
|
|
991
995
|
tries -= 1
|
992
996
|
sleep(self.timeout_sleep)
|
993
|
-
rewind_files(body) if multipart
|
994
997
|
retry
|
995
998
|
rescue *CONNECTION_READ_EXCEPTIONS => ex
|
996
999
|
if tries.zero?
|
@@ -1001,11 +1004,9 @@ module ZuoraAPI
|
|
1001
1004
|
tries -= 1
|
1002
1005
|
|
1003
1006
|
if ex.is_a?(Errno::ECONNRESET) && ex.message.include?('SSL_connect')
|
1004
|
-
rewind_files(body) if multipart
|
1005
1007
|
retry
|
1006
1008
|
elsif timeout_retry
|
1007
1009
|
sleep(self.timeout_sleep)
|
1008
|
-
rewind_files(body) if multipart
|
1009
1010
|
retry
|
1010
1011
|
else
|
1011
1012
|
Rails.logger.info("Rest Call - #{ex.class} Timed out will retry after 5 seconds")
|
data/lib/zuora_api/version.rb
CHANGED