zuora_api 1.11.4 → 1.11.6
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 +22 -7
- 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: cbfa87e1d769f23011adcba219693a3275183a2d8fa69d5e3b7c60df0d4d1c5d
|
4
|
+
data.tar.gz: 6a5b18c174109167cc4cc733252a467f8f9fe5a258b0af1179338ab77627ad35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6be558343d40f15f478f3ce1f854a6a43fd8ebf5767c86396b32bb5b906016e022fe9dc0a34db107a50f082be683d4453d22a2bbd086f139a5649f32430b1b1
|
7
|
+
data.tar.gz: 85feb31d98bdd983b75645d42df6ca12b2aeebb105ca7a4b55c386794d64d2fcbc1c4bdd5d0db5d75b7f41c8c9268da63c30aba6a2dd4cb37d735d69d2e38949
|
data/lib/zuora_api/login.rb
CHANGED
@@ -7,7 +7,7 @@ module ZuoraAPI
|
|
7
7
|
class Login
|
8
8
|
ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging' ]
|
9
9
|
REGIONS = [EU = 'EU', US = 'US', NA = 'NA' ]
|
10
|
-
MIN_Endpoints = {'Test': '
|
10
|
+
MIN_Endpoints = {'Test': '133.0', 'Sandbox': '133.0', 'Production': '133.0', 'Performance': '133.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '133.0'}.freeze
|
11
11
|
XML_SAVE_OPTIONS = Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
|
12
12
|
USER_AGENT = "Zuora#{ENV['Z_APPLICATION_NAME']&.capitalize}/#{ENV['Z_APPLICATION_VERSION']&.delete('v')}"
|
13
13
|
|
@@ -532,13 +532,21 @@ module ZuoraAPI
|
|
532
532
|
rescue => ex
|
533
533
|
raise ex
|
534
534
|
ensure
|
535
|
-
|
535
|
+
if defined?(ex)
|
536
|
+
if keyword_args[:log_error_requests]
|
537
|
+
self.error_logger(ex, **keyword_args)
|
538
|
+
else
|
539
|
+
self.error_logger(ex)
|
540
|
+
end
|
541
|
+
end
|
536
542
|
end
|
537
543
|
|
538
|
-
def error_logger(ex)
|
544
|
+
def error_logger(ex, **args)
|
539
545
|
return unless Rails.logger.is_a? Ougai::Logger
|
540
546
|
|
541
547
|
exception_args = Rails.logger.with_fields.merge(self.exception_args(ex))
|
548
|
+
exception_args.merge!(**args) if args[:log_error_requests]
|
549
|
+
|
542
550
|
case ex
|
543
551
|
when ZuoraAPI::Exceptions::ZuoraAPIUnkownError, ZuoraAPI::Exceptions::ZuoraDataIntegrity
|
544
552
|
Rails.logger.error('Zuora Unknown/Integrity Error', ex, exception_args)
|
@@ -548,9 +556,10 @@ module ZuoraAPI
|
|
548
556
|
Rails.logger.info('Zuora APILimit Reached', ex, exception_args)
|
549
557
|
end
|
550
558
|
when *(ZuoraAPI::Login::ZUORA_API_ERRORS-ZuoraAPI::Login::ZUORA_SERVER_ERRORS)
|
551
|
-
|
559
|
+
Rails.logger.error('Zuora API Error', ex, exception_args) if args[:log_error_requests]
|
552
560
|
when *ZuoraAPI::Login::ZUORA_SERVER_ERRORS
|
553
561
|
Rails.logger.error('Zuora Server Error', ex, exception_args)
|
562
|
+
else
|
554
563
|
end
|
555
564
|
end
|
556
565
|
|
@@ -865,13 +874,13 @@ module ZuoraAPI
|
|
865
874
|
|
866
875
|
if body.class == Hash && body['message'].present?
|
867
876
|
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(body['message'], response) if response.code == 500
|
868
|
-
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['message'], response) if ![200,201].include?(response.code)
|
877
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['message'], response) if ![200,201,202].include?(response.code)
|
869
878
|
end
|
870
879
|
|
871
880
|
self.errors_via_content_type(response: response, type: :json)
|
872
881
|
|
873
882
|
#All other errors
|
874
|
-
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(response.body, response) if ![200,201].include?(response.code)
|
883
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(response.body, response) if ![200,201,202].include?(response.code)
|
875
884
|
end
|
876
885
|
end
|
877
886
|
|
@@ -1261,7 +1270,13 @@ module ZuoraAPI
|
|
1261
1270
|
rescue => ex
|
1262
1271
|
raise ex
|
1263
1272
|
ensure
|
1264
|
-
|
1273
|
+
if defined?(ex)
|
1274
|
+
if keyword_args[:log_error_requests]
|
1275
|
+
self.error_logger(ex, **keyword_args)
|
1276
|
+
else
|
1277
|
+
self.error_logger(ex)
|
1278
|
+
end
|
1279
|
+
end
|
1265
1280
|
end
|
1266
1281
|
|
1267
1282
|
def update_create_tenant
|
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.11.
|
4
|
+
version: 1.11.6
|
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: 2023-
|
11
|
+
date: 2023-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|