zuora_api 1.7.50 → 1.7.51
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 +29 -5
- data/lib/zuora_api/logins/oauth.rb +1 -1
- data/lib/zuora_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cd2aa521463a9f52d88dc5a6ccc895b87e18fdc03994f73a2d9a015d83faa3e
|
4
|
+
data.tar.gz: 5645ed96e0f8e29f56bff92f07b026cddb4a3157740044dd34715803ca8f38e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a362242619d917e955f2133d986e8367d04924d1f3bae69d9c924a34c8e53ad395fa0f2c0aee1239ba9a096d473004757a197f0a71f3874b2599b759d31110c
|
7
|
+
data.tar.gz: b2829f5a1decf1f840916ce986589142b1e0bd0ddf69f8795af1d3f715cdf21afa56067e053ad6379ca790a6ba2094a430d97e8e71ea6c9fe7ebedf1077f834b
|
data/lib/zuora_api/login.rb
CHANGED
@@ -571,6 +571,9 @@ module ZuoraAPI
|
|
571
571
|
end
|
572
572
|
|
573
573
|
def raise_errors(type: :SOAP, body: nil, response: nil)
|
574
|
+
request = response.request
|
575
|
+
match_string = "#{request.http_method.to_s.split("Net::HTTP::").last.upcase}::#{response.code}::#{request.path.path}"
|
576
|
+
|
574
577
|
if [502,503].include?(response.code)
|
575
578
|
raise ZuoraAPI::Exceptions::ZuoraAPIConnectionTimeout.new("Received #{response.code} from #{response.request.uri}", response)
|
576
579
|
end
|
@@ -581,6 +584,18 @@ module ZuoraAPI
|
|
581
584
|
raise ZuoraAPI::Exceptions::ZuoraAPIReadTimeout.new("Received 504 from #{response.request.uri}", response)
|
582
585
|
when 429
|
583
586
|
raise ZuoraAPI::Exceptions::ZuoraAPIRequestLimit.new("The total number of concurrent requests has exceeded the limit allowed by the system. Please resubmit your request later.", response)
|
587
|
+
when 401
|
588
|
+
|
589
|
+
else
|
590
|
+
if body.class == Hash
|
591
|
+
case response.request.path.path
|
592
|
+
when /^\/v1\/connections$/
|
593
|
+
response_headers = response.headers.to_h
|
594
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Missing cookies for authentication call", response) if response_headers['set-cookie'].blank?
|
595
|
+
z_session_cookie = response_headers.fetch('set-cookie', []).select{|x| x.match(/^ZSession=.*/) }.first
|
596
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Missing ZSession cookie for authentication call", response) if z_session_cookie.blank?
|
597
|
+
end
|
598
|
+
end
|
584
599
|
end
|
585
600
|
|
586
601
|
case type
|
@@ -619,15 +634,24 @@ module ZuoraAPI
|
|
619
634
|
end
|
620
635
|
end
|
621
636
|
|
622
|
-
if
|
637
|
+
if (response.code == 400 && response.headers.fetch('content-type', []).include?('text/html'))
|
623
638
|
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(response.body, response)
|
639
|
+
elsif response.code == 500
|
640
|
+
if response.headers.fetch('content-type', []).include?('application/json')
|
641
|
+
begin
|
642
|
+
output_json = JSON.parse(response.body)
|
643
|
+
self.raise_errors(type: :JSON, body: output_json, response: response)
|
644
|
+
rescue JSON::ParserError => ex
|
645
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(response.body, response)
|
646
|
+
end
|
647
|
+
else
|
648
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(response.body, response)
|
649
|
+
end
|
624
650
|
end
|
625
651
|
|
626
652
|
when :JSON
|
627
653
|
if body.class == Hash
|
628
|
-
request
|
629
|
-
match_string = "#{request.http_method.to_s.split("Net::HTTP::").last.upcase}::#{response.code}::#{request.path.path}"
|
630
|
-
case response.request.path.path
|
654
|
+
case request.path.path
|
631
655
|
when /^\/query\/jobs.*/ #DataQuery Paths
|
632
656
|
case match_string
|
633
657
|
when /^GET::200::\/query\/jobs\/([a-zA-Z0-9\-_]*)$/ #Get DQ job
|
@@ -843,7 +867,7 @@ module ZuoraAPI
|
|
843
867
|
raise ZuoraAPI::Exceptions::ZuoraAPIUnkownError.new(message, response, errors, success)
|
844
868
|
end
|
845
869
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(message, response, errors, success)
|
846
|
-
when /invalid/, /INVALID_ID/, /MAX_RECORDS_EXCEEDED/, /INVALID_FIELD/, /MALFORMED_QUERY/, /NO_PERMISSION/, /PDF_QUERY_ERROR/, /MISSING_REQUIRED_VALUE/, /INVALID_TYPE/, /TRANSACTION_FAILED/, /API_DISABLED/, /CANNOT_DELETE/, /ACCOUNTING_PERIOD_CLOSED/
|
870
|
+
when /invalid/, /REQUEST_REJECTED/, /INVALID_ID/, /MAX_RECORDS_EXCEEDED/, /INVALID_FIELD/, /MALFORMED_QUERY/, /NO_PERMISSION/, /PDF_QUERY_ERROR/, /MISSING_REQUIRED_VALUE/, /INVALID_TYPE/, /TRANSACTION_FAILED/, /API_DISABLED/, /CANNOT_DELETE/, /ACCOUNTING_PERIOD_CLOSED/
|
847
871
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(message, response, errors, success)
|
848
872
|
when /.*UNEXPECTED_ERROR/
|
849
873
|
raise ZuoraAPI::Exceptions::ZuoraUnexpectedError.new(message, response, errors, success)
|
@@ -11,7 +11,7 @@ module ZuoraAPI
|
|
11
11
|
super
|
12
12
|
end
|
13
13
|
|
14
|
-
def new_session(
|
14
|
+
def new_session(auth_type: nil, zuora_track_id: nil)
|
15
15
|
if auth_type == :bearer
|
16
16
|
get_bearer_token(zuora_track_id: zuora_track_id)
|
17
17
|
elsif auth_type == :basic
|
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.7.
|
4
|
+
version: 1.7.51
|
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: 2020-02-
|
11
|
+
date: 2020-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|