zuora_api 1.11.2 → 1.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zuora_api/login.rb +136 -33
- 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: 5a2690391a9d7bad276fb66fa2acaa3706687fd295ba4805c97a6002f88029f0
|
|
4
|
+
data.tar.gz: c2fc324283e85c202a17ac07ad75037edaec3b2eca54e36bc97b5fd64e7985ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d2e855b40b12dc10fc0f06843d4b960dd08beffe2d8df0b8236238df525d005d704b0d301780e4d1a46e7da8f2eaad5e0a7a9959fb2560be20045275acb0b17
|
|
7
|
+
data.tar.gz: 39f6a0bcd95f5021c59ce4a64c6ed9e7715d7f817237a42169f0a7fd0a71e49c542e556c18d201e80cab83f3b0e30c3ab3bce30a3950aea5e808ca4f9ae43c94
|
data/lib/zuora_api/login.rb
CHANGED
|
@@ -5,20 +5,36 @@ require 'zuora_api/exceptions'
|
|
|
5
5
|
|
|
6
6
|
module ZuoraAPI
|
|
7
7
|
class Login
|
|
8
|
-
ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging' ]
|
|
9
|
-
REGIONS = [EU = 'EU', US = 'US', NA = 'NA' ]
|
|
10
|
-
|
|
8
|
+
ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging', PREPROD='Preprod', QAD5='QAD5', QAD6='QAD6', QAD7='QAD7', QAD8='QAD8', QAD9='QAD9' ]
|
|
9
|
+
REGIONS = [EU = 'EU', US = 'US', NA = 'NA', JP = 'JP' ]
|
|
10
|
+
WSDL_VERSION = ENV['ZUORA_WSDL_VERSION'] || '155.0'
|
|
11
|
+
MIN_Endpoints = {
|
|
12
|
+
'Test': WSDL_VERSION,
|
|
13
|
+
'Sandbox': WSDL_VERSION,
|
|
14
|
+
'Production': WSDL_VERSION,
|
|
15
|
+
'Performance': WSDL_VERSION,
|
|
16
|
+
'Services': '96.0',
|
|
17
|
+
'Unknown': '96.0',
|
|
18
|
+
'Staging': WSDL_VERSION,
|
|
19
|
+
'Preprod': WSDL_VERSION,
|
|
20
|
+
'QAD5': WSDL_VERSION,
|
|
21
|
+
'QAD6': WSDL_VERSION,
|
|
22
|
+
'QAD7': WSDL_VERSION,
|
|
23
|
+
'QAD8': WSDL_VERSION,
|
|
24
|
+
'QAD9': WSDL_VERSION
|
|
25
|
+
}.freeze
|
|
11
26
|
XML_SAVE_OPTIONS = Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
|
|
12
27
|
USER_AGENT = "Zuora#{ENV['Z_APPLICATION_NAME']&.capitalize}/#{ENV['Z_APPLICATION_VERSION']&.delete('v')}"
|
|
13
28
|
|
|
14
29
|
CONNECTION_EXCEPTIONS = [
|
|
15
30
|
Net::OpenTimeout,
|
|
16
|
-
OpenSSL::SSL::SSLError,
|
|
17
|
-
Errno::ECONNREFUSED,
|
|
18
31
|
SocketError,
|
|
19
|
-
|
|
32
|
+
OpenSSL::SSL::SSLError,
|
|
33
|
+
Errno::ECONNREFUSED, #A remote host refused to allow the network connection
|
|
34
|
+
Errno::EINVAL, #Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function.
|
|
35
|
+
Errno::EHOSTUNREACH, #The remote host for a requested network connection is not reachable.
|
|
20
36
|
Errno::EADDRNOTAVAIL,
|
|
21
|
-
Errno::ETIMEDOUT,
|
|
37
|
+
Errno::ETIMEDOUT, #ETIMEDOUT A socket operation with a specified timeout received no response during the timeout period.
|
|
22
38
|
].freeze
|
|
23
39
|
|
|
24
40
|
CONNECTION_READ_EXCEPTIONS = [
|
|
@@ -145,13 +161,17 @@ module ZuoraAPI
|
|
|
145
161
|
"Staging" => "https://reporting-stg11.zan.svc.auw2.zuora.com/api/rest/v1/",
|
|
146
162
|
"Performance" => "https://zconnectpt1.zuora.com/api/rest/v1/",
|
|
147
163
|
"Services" => "https://reporting-svc08.svc.auw2.zuora.com/api/rest/v1/"},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
"EU" => {"Sandbox" => "https://zconnect.sandbox.eu.zuora.com/api/rest/v1/",
|
|
165
|
+
"Production" => "https://zconnect.eu.zuora.com/api/rest/v1/",
|
|
166
|
+
"Services"=> "https://reporting-sbx0000.sbx.aec1.zuora.com/api/rest/v1/",
|
|
167
|
+
"Test" => "https://zconnect-services0002.test.eu.zuora.com/api/rest/v1/"},
|
|
168
|
+
"NA" => {"Sandbox" => "https://zconnect.sandbox.na.zuora.com/api/rest/v1/",
|
|
169
|
+
"Production" => "https://zconnect.na.zuora.com/api/rest/v1/",
|
|
170
|
+
"Services"=> ""},
|
|
171
|
+
"JP" => {
|
|
172
|
+
"Production" => "https://zconnect-prod05.ap.zuora.com/api/rest/v1/",
|
|
173
|
+
"Test" => "https://zconnect-services0003.test.ap.zuora.com/api/rest/v1/"
|
|
174
|
+
}
|
|
155
175
|
}
|
|
156
176
|
return map[self.region][self.environment].insert(-1, path)
|
|
157
177
|
end
|
|
@@ -203,11 +223,11 @@ module ZuoraAPI
|
|
|
203
223
|
end
|
|
204
224
|
|
|
205
225
|
def self.environments
|
|
206
|
-
%w(Sandbox Production Services Performance Staging Test)
|
|
226
|
+
%w(Sandbox Production Services Performance Staging Test Preprod QAD5 QAD6 QAD7 QAD8 QAD9)
|
|
207
227
|
end
|
|
208
228
|
|
|
209
229
|
def self.regions
|
|
210
|
-
%w(US EU NA)
|
|
230
|
+
%w(US EU NA JP)
|
|
211
231
|
end
|
|
212
232
|
|
|
213
233
|
def self.endpoints
|
|
@@ -216,7 +236,14 @@ module ZuoraAPI
|
|
|
216
236
|
"Performance" => "https://pt1.zuora.com/apps/services/a/",
|
|
217
237
|
"Services" => "https://services347.zuora.com/apps/services/a/",
|
|
218
238
|
"Staging" => "https://staging2.zuora.com/apps/services/a/",
|
|
219
|
-
"Test" => "https://test.zuora.com/apps/services/a/"
|
|
239
|
+
"Test" => "https://test.zuora.com/apps/services/a/",
|
|
240
|
+
"Preprod" => "https://preprod.zuora.com/apps/services/a/",
|
|
241
|
+
"QAD5" => "https://app-5.qad.na.zuora.com/apps/services/a/",
|
|
242
|
+
"QAD6" => "https://app-6.qad.na.zuora.com/apps/services/a/",
|
|
243
|
+
"QAD7" => "https://app-7.qad.na.zuora.com/apps/services/a/",
|
|
244
|
+
"QAD8" => "https://app-8.qad.na.zuora.com/apps/services/a/",
|
|
245
|
+
"QAD9" => "https://app-9.qad.na.zuora.com/apps/services/a/",
|
|
246
|
+
},
|
|
220
247
|
"EU" => {"Sandbox" => "https://sandbox.eu.zuora.com/apps/services/a/",
|
|
221
248
|
"Production" => "https://eu.zuora.com/apps/services/a/",
|
|
222
249
|
"Performance" => "https://pt1.eu.zuora.com/apps/services/a/",
|
|
@@ -226,7 +253,17 @@ module ZuoraAPI
|
|
|
226
253
|
"Production" => "https://na.zuora.com/apps/services/a/",
|
|
227
254
|
"Performance" => "https://pt1.na.zuora.com/apps/services/a/",
|
|
228
255
|
"Services" => "https://services347.na.zuora.com/apps/services/a/",
|
|
229
|
-
"Test" => "https://test.zuora.com/apps/services/a/"
|
|
256
|
+
"Test" => "https://test.zuora.com/apps/services/a/",
|
|
257
|
+
"Preprod" => "https://preprod.zuora.com/apps/services/a/",
|
|
258
|
+
"QAD5" => "https://app-5.qad.na.zuora.com/apps/services/a/",
|
|
259
|
+
"QAD6" => "https://app-6.qad.na.zuora.com/apps/services/a/",
|
|
260
|
+
"QAD7" => "https://app-7.qad.na.zuora.com/apps/services/a/",
|
|
261
|
+
"QAD8" => "https://app-8.qad.na.zuora.com/apps/services/a/",
|
|
262
|
+
"QAD9" => "https://app-9.qad.na.zuora.com/apps/services/a/",
|
|
263
|
+
},
|
|
264
|
+
"JP" => {"Sandbox" => "https://sandbox.ap.zuora.com/apps/services/a/",
|
|
265
|
+
"Production" => "https://ap.zuora.com/apps/services/a/",
|
|
266
|
+
"Test" => "https://test.ap.zuora.com/apps/services/a/"}
|
|
230
267
|
}
|
|
231
268
|
end
|
|
232
269
|
|
|
@@ -248,6 +285,8 @@ module ZuoraAPI
|
|
|
248
285
|
self.region = "EU"
|
|
249
286
|
elsif /(?<=\.|\/|^)(na)(?=\.|\/|$)/ === self.hostname
|
|
250
287
|
self.region = "NA"
|
|
288
|
+
elsif /(?<=\.|\/|^)(ap)(?=\.|\/|$)/ === self.hostname
|
|
289
|
+
self.region = "JP"
|
|
251
290
|
else
|
|
252
291
|
self.region = "US"
|
|
253
292
|
end
|
|
@@ -262,6 +301,16 @@ module ZuoraAPI
|
|
|
262
301
|
case self.hostname
|
|
263
302
|
when /(?<=\.|\/|-|^)(apisandbox|sandbox)(?=\.|\/|-|$)/
|
|
264
303
|
self.environment = 'Sandbox'
|
|
304
|
+
when /(?<=\.|\/|-|^)(app-5\.qad)(?=\.|\/|-|$)/
|
|
305
|
+
self.environment = 'QAD5'
|
|
306
|
+
when /(?<=\.|\/|-|^)(app-6\.qad)(?=\.|\/|-|$)/
|
|
307
|
+
self.environment = 'QAD6'
|
|
308
|
+
when /(?<=\.|\/|-|^)(app-7\.qad)(?=\.|\/|-|$)/
|
|
309
|
+
self.environment = 'QAD7'
|
|
310
|
+
when /(?<=\.|\/|-|^)(app-8\.qad)(?=\.|\/|-|$)/
|
|
311
|
+
self.environment = 'QAD8'
|
|
312
|
+
when /(?<=\.|\/|-|^)(app-9\.qad)(?=\.|\/|-|$)/
|
|
313
|
+
self.environment = 'QAD9'
|
|
265
314
|
when /(?<=\.|\/|^)(service[\d]*|services[\d]*|ep-edge)(?=\.|\/|$)/
|
|
266
315
|
self.environment = 'Services'
|
|
267
316
|
when /(?<=\.|\/|-|^)(pt[\d]*)(?=\.|\/|-|$)/
|
|
@@ -270,8 +319,10 @@ module ZuoraAPI
|
|
|
270
319
|
self.environment = 'Staging'
|
|
271
320
|
when /(?<=\.|\/|^)(test)(?=\.|\/|$)/
|
|
272
321
|
self.environment = 'Test'
|
|
273
|
-
when /(?<=\.|\/|^)(www|api)(?=\.|\/|$)/, /(^|tls10\.|origin-www\.|zforsf\.|eu\.|na\.)(zuora\.com)/
|
|
322
|
+
when /(?<=\.|\/|^)(www|api)(?=\.|\/|$)/, /(^|tls10\.|origin-www\.|zforsf\.|eu\.|na\.|ap\.)(zuora\.com)/
|
|
274
323
|
self.environment = 'Production'
|
|
324
|
+
when /(?<=\.|\/|-|^)(preprod|preprod)(?=\.|\/|-|$)/
|
|
325
|
+
self.environment = 'Preprod'
|
|
275
326
|
else
|
|
276
327
|
self.environment = 'Unknown'
|
|
277
328
|
end
|
|
@@ -283,9 +334,10 @@ module ZuoraAPI
|
|
|
283
334
|
def update_zconnect_provider
|
|
284
335
|
update_region if self.region.blank?
|
|
285
336
|
update_environment if self.environment.blank?
|
|
286
|
-
mappings = {"US" => {"Sandbox" => "ZConnectSbx",
|
|
287
|
-
"NA" => {"Sandbox" => "ZConnectSbxNA", "Services" => "ZConnectSvcNA", "Production" => "ZConnectProdNA", "Performance" => "ZConnectPT1NA"},
|
|
337
|
+
mappings = {"US" => {"Sandbox" => "ZConnectSbx", "Services" => "ZConnectSvcUS", "Production" => "ZConnectProd", "Performance" => "ZConnectPT1", "Preprod" => "ZConnectPreprod", "Test" => "ZConnectTest", "Staging" => "ZConnectQA", "QAD5" => "ZConnectQA", "QAD6" => "ZConnectQA", "QAD7" => "ZConnectQA", "QAD8" => "ZConnectQA", "QAD9" => "ZConnectQA", "KubeSTG" => "ZConnectDev", "KubeDEV" => "ZConnectDev", "KubePROD" => "ZConnectDev"},
|
|
338
|
+
"NA" => {"Sandbox" => "ZConnectSbxNA", "Services" => "ZConnectSvcNA", "Production" => "ZConnectProdNA", "Performance" => "ZConnectPT1NA", "QAD5" => "ZConnectQA", "QAD6" => "ZConnectQA", "QAD7" => "ZConnectQA", "QAD8" => "ZConnectQA", "QAD9" => "ZConnectQA"},
|
|
288
339
|
"EU" => {"Sandbox" => "ZConnectSbxEU", "Services" => "ZConnectSvcEU", "Production" => "ZConnectProdEU", "Performance" => "ZConnectPT1EU", "Test" => "ZConnectTest"},
|
|
340
|
+
"JP" => {"Sandbox" => "ZConnectSbxAP", "Services" => "ZConnectSvcAP", "Production" => "ZConnectProdAP", "Performance" => "ZConnectPT1AP", "Test" => "ZConnectTest"},
|
|
289
341
|
"Unknown" => {"Unknown" => "Unknown"}}
|
|
290
342
|
self.zconnect_provider = mappings[self.region][self.environment]
|
|
291
343
|
end
|
|
@@ -303,7 +355,7 @@ module ZuoraAPI
|
|
|
303
355
|
def rest_endpoint(url="", domain=true, prefix='/v1/')
|
|
304
356
|
update_environment
|
|
305
357
|
endpoint = url
|
|
306
|
-
url_postfix = {"US" => ".", "EU" => ".eu.", "NA" => ".na."}[self.region]
|
|
358
|
+
url_postfix = {"US" => ".", "EU" => ".eu.", "NA" => ".na.", "JP" => ".ap."}[self.region]
|
|
307
359
|
|
|
308
360
|
case self.environment
|
|
309
361
|
when 'Test'
|
|
@@ -321,6 +373,18 @@ module ZuoraAPI
|
|
|
321
373
|
endpoint = "#{https}rest#{host}"
|
|
322
374
|
when 'Staging'
|
|
323
375
|
endpoint = "https://rest-staging2.zuora.com"
|
|
376
|
+
when 'Preprod'
|
|
377
|
+
endpoint = "https://rest.preprod.zuora.com"
|
|
378
|
+
when 'QAD5'
|
|
379
|
+
endpoint = "https://rest-5.qad.na.zuora.com"
|
|
380
|
+
when 'QAD6'
|
|
381
|
+
endpoint = "https://rest-6.qad.na.zuora.com"
|
|
382
|
+
when 'QAD7'
|
|
383
|
+
endpoint = "https://rest-7.qad.na.zuora.com"
|
|
384
|
+
when 'QAD8'
|
|
385
|
+
endpoint = "https://rest-8.qad.na.zuora.com"
|
|
386
|
+
when 'QAD9'
|
|
387
|
+
endpoint = "https://rest-9.qad.na.zuora.com"
|
|
324
388
|
when 'Unknown'
|
|
325
389
|
raise "Environment unknown, returning passed in parameter unaltered"
|
|
326
390
|
end
|
|
@@ -532,13 +596,21 @@ module ZuoraAPI
|
|
|
532
596
|
rescue => ex
|
|
533
597
|
raise ex
|
|
534
598
|
ensure
|
|
535
|
-
|
|
599
|
+
if defined?(ex)
|
|
600
|
+
if keyword_args[:log_error_requests]
|
|
601
|
+
self.error_logger(ex, **keyword_args)
|
|
602
|
+
else
|
|
603
|
+
self.error_logger(ex)
|
|
604
|
+
end
|
|
605
|
+
end
|
|
536
606
|
end
|
|
537
607
|
|
|
538
|
-
def error_logger(ex)
|
|
608
|
+
def error_logger(ex, **args)
|
|
539
609
|
return unless Rails.logger.is_a? Ougai::Logger
|
|
540
610
|
|
|
541
611
|
exception_args = Rails.logger.with_fields.merge(self.exception_args(ex))
|
|
612
|
+
exception_args.merge!(**args) if args[:log_error_requests]
|
|
613
|
+
|
|
542
614
|
case ex
|
|
543
615
|
when ZuoraAPI::Exceptions::ZuoraAPIUnkownError, ZuoraAPI::Exceptions::ZuoraDataIntegrity
|
|
544
616
|
Rails.logger.error('Zuora Unknown/Integrity Error', ex, exception_args)
|
|
@@ -548,9 +620,10 @@ module ZuoraAPI
|
|
|
548
620
|
Rails.logger.info('Zuora APILimit Reached', ex, exception_args)
|
|
549
621
|
end
|
|
550
622
|
when *(ZuoraAPI::Login::ZUORA_API_ERRORS-ZuoraAPI::Login::ZUORA_SERVER_ERRORS)
|
|
551
|
-
|
|
623
|
+
Rails.logger.error('Zuora API Error', ex, exception_args) if args[:log_error_requests]
|
|
552
624
|
when *ZuoraAPI::Login::ZUORA_SERVER_ERRORS
|
|
553
625
|
Rails.logger.error('Zuora Server Error', ex, exception_args)
|
|
626
|
+
else
|
|
554
627
|
end
|
|
555
628
|
end
|
|
556
629
|
|
|
@@ -659,6 +732,8 @@ module ZuoraAPI
|
|
|
659
732
|
if new_message.present?
|
|
660
733
|
if new_message.include?("The query exceeded maximum processing time")
|
|
661
734
|
error, message = ['TRANSACTION_FAILED', new_message.concat(" Please see KC for the Max Timeout Specification https://community.zuora.com/t5/Release-Notifications/Upcoming-Change-for-AQuA-and-Data-Source-Export-January-2021/ba-p/35024")]
|
|
735
|
+
elsif new_message.include?("There is no field named")
|
|
736
|
+
error, message = ['TRANSACTION_FAILED', new_message]
|
|
662
737
|
else
|
|
663
738
|
error, message = ['UNEXPECTED_ERROR', new_message]
|
|
664
739
|
end
|
|
@@ -765,7 +840,7 @@ module ZuoraAPI
|
|
|
765
840
|
if body['path'] == '/oauth/token'
|
|
766
841
|
if body['status'] == 403 && response.code == 403
|
|
767
842
|
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Forbidden", response)
|
|
768
|
-
elsif body['status'] == 400 && response.code == 400
|
|
843
|
+
elsif body['status'] == 400 && response.code == 400
|
|
769
844
|
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Invalid Oauth Client Id", response)
|
|
770
845
|
end
|
|
771
846
|
end
|
|
@@ -842,7 +917,7 @@ module ZuoraAPI
|
|
|
842
917
|
end
|
|
843
918
|
|
|
844
919
|
#Zuora REST Actions error (Create, Update, Delete, Amend)
|
|
845
|
-
if body.class == Array
|
|
920
|
+
if body.class == Array && !body.compact.blank?
|
|
846
921
|
all_errors = body.select {|obj| !obj['Success'] || !obj['success'] }.map {|obj| obj['Errors'] || obj['errors'] }.compact
|
|
847
922
|
all_success = body.select {|obj| obj['Success'] || obj['success']}.compact
|
|
848
923
|
|
|
@@ -864,14 +939,30 @@ module ZuoraAPI
|
|
|
864
939
|
end
|
|
865
940
|
|
|
866
941
|
if body.class == Hash && body['message'].present?
|
|
942
|
+
|
|
943
|
+
if body['message'] && body['code'].present?
|
|
944
|
+
raise_errors_helper(error: body['code'], message: body['message'], raise_final: false)
|
|
945
|
+
end
|
|
946
|
+
|
|
867
947
|
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)
|
|
948
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['message'], response) if ![200,201,202].include?(response.code)
|
|
949
|
+
end
|
|
950
|
+
|
|
951
|
+
if body.class == Hash && body['errors'].present?
|
|
952
|
+
if body['errors'].class == Array && body.dig('errors', 0).is_a?(Hash)
|
|
953
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['errors'][0].fetch("message", "No error message. Zuora API Error"), response)
|
|
954
|
+
end
|
|
869
955
|
end
|
|
870
956
|
|
|
871
957
|
self.errors_via_content_type(response: response, type: :json)
|
|
872
958
|
|
|
873
959
|
#All other errors
|
|
874
|
-
|
|
960
|
+
if ![200,201,202].include?(response.code)
|
|
961
|
+
if body == [nil]
|
|
962
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new('No error message. Invalid API request', response)
|
|
963
|
+
end
|
|
964
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new(response.body, response)
|
|
965
|
+
end
|
|
875
966
|
end
|
|
876
967
|
end
|
|
877
968
|
|
|
@@ -953,7 +1044,7 @@ module ZuoraAPI
|
|
|
953
1044
|
return error, success, message
|
|
954
1045
|
end
|
|
955
1046
|
|
|
956
|
-
def raise_errors_helper(error: nil, message: nil, response: nil, errors: [], success: [])
|
|
1047
|
+
def raise_errors_helper(error: nil, message: nil, response: nil, errors: [], success: [], raise_final: true)
|
|
957
1048
|
case error
|
|
958
1049
|
when /.*INVALID_SESSION/
|
|
959
1050
|
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new(message, response, errors, success)
|
|
@@ -997,7 +1088,7 @@ module ZuoraAPI
|
|
|
997
1088
|
end
|
|
998
1089
|
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(message, response, errors, success)
|
|
999
1090
|
else
|
|
1000
|
-
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Z:#{error}::#{message}", response, errors, success)
|
|
1091
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Z:#{error}::#{message}", response, errors, success) if raise_final
|
|
1001
1092
|
end
|
|
1002
1093
|
end
|
|
1003
1094
|
|
|
@@ -1261,7 +1352,13 @@ module ZuoraAPI
|
|
|
1261
1352
|
rescue => ex
|
|
1262
1353
|
raise ex
|
|
1263
1354
|
ensure
|
|
1264
|
-
|
|
1355
|
+
if defined?(ex)
|
|
1356
|
+
if keyword_args[:log_error_requests]
|
|
1357
|
+
self.error_logger(ex, **keyword_args)
|
|
1358
|
+
else
|
|
1359
|
+
self.error_logger(ex)
|
|
1360
|
+
end
|
|
1361
|
+
end
|
|
1265
1362
|
end
|
|
1266
1363
|
|
|
1267
1364
|
def update_create_tenant
|
|
@@ -1341,7 +1438,6 @@ module ZuoraAPI
|
|
|
1341
1438
|
status_code = response.code if response
|
|
1342
1439
|
case response
|
|
1343
1440
|
when Net::HTTPOK
|
|
1344
|
-
Rails.logger.warn("Headers: #{response.to_hash.to_s}")
|
|
1345
1441
|
if output_file_name.present?
|
|
1346
1442
|
file_ending ||= output_file_name.end_with?(".csv.zip") ? ".csv.zip" : File.extname(output_file_name)
|
|
1347
1443
|
filename ||= File.basename(output_file_name, file_ending)
|
|
@@ -1437,6 +1533,13 @@ module ZuoraAPI
|
|
|
1437
1533
|
end
|
|
1438
1534
|
end
|
|
1439
1535
|
|
|
1536
|
+
rescue ZuoraAPI::Exceptions::FileDownloadError => ex
|
|
1537
|
+
if ex.message.match(/.*The current tenant does not have a file with id.*/)
|
|
1538
|
+
raise
|
|
1539
|
+
else
|
|
1540
|
+
Rails.logger.error("File Download Failed")
|
|
1541
|
+
raise
|
|
1542
|
+
end
|
|
1440
1543
|
rescue => ex
|
|
1441
1544
|
sleep(5)
|
|
1442
1545
|
if (retry_count -= 1) >= 0
|
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.
|
|
4
|
+
version: 1.12.8
|
|
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:
|
|
11
|
+
date: 2026-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|