zuora_api 1.12.0 → 1.12.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff929bd4b2376d0c7985de5e833e7ce2407b44caaa0ab495802b26f30615c38e
4
- data.tar.gz: 9abdf198ed41321ed56480bbadbb016fc76945106841152dbc030fb1c10318cd
3
+ metadata.gz: 5163d6aff2701a59e1178b7182c2333d2bacf2c371f6ef6589389ac743365c2c
4
+ data.tar.gz: 9d0cbbfd19126352c0465dcdf8c2d88c711c6bbfc0926ae70ce3242cd778512f
5
5
  SHA512:
6
- metadata.gz: 48506d21842612df46847fc3ec2ac35da63e25b68244102ed43dc1a749d704af5ec7735ee9727b0ed1dbf533f9f9c50ab00e0badf309c54089bb44afe278f51c
7
- data.tar.gz: e847be40cdd8d7b73d9850ab5e9c96e762f6cbcefa141c1fcc01737150e0a89bcfec32353933b2c472774493d614b625d1f0aa56f65886a604676f19092a7f2a
6
+ metadata.gz: fda0780f355916db3cb0b6ccd971ac39924eb85079251091ae6d2fe24be260516cf4932aa7ef211b5c14fd70b1315aa2d526fec868983dc0fb8c4a1e54255c62
7
+ data.tar.gz: 75dcc2bd753a710686f1b44b2ba0bb8a6dfb3984ed986430768081fbc9735701dd46a8f82483cdd81a22c36a26f16c64520082625e9d8e430329bb17b103a0a8
@@ -5,9 +5,9 @@ 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', PREPROD='Preprod' ]
8
+ ENVIRONMENTS = [TEST = 'Test', SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging', PREPROD='Preprod', QAD5='QAD5', QAD6='QAD6', QAD6='QAD7', QAD6='QAD8', QAD6='QAD9' ]
9
9
  REGIONS = [EU = 'EU', US = 'US', NA = 'NA', JP = 'JP' ]
10
- MIN_Endpoints = {'Test': '140.0', 'Sandbox': '140.0', 'Production': '140.0', 'Performance': '140.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '140.0', 'Preprod': '140.0'}.freeze
10
+ MIN_Endpoints = {'Test': '140.0', 'Sandbox': '140.0', 'Production': '140.0', 'Performance': '140.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '140.0', 'Preprod': '140.0', 'QAD5': '140.0', 'QAD6': '140.0', 'QAD7': '140.0', 'QAD8': '140.0', 'QAD9': '140.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
 
@@ -207,7 +207,7 @@ module ZuoraAPI
207
207
  end
208
208
 
209
209
  def self.environments
210
- %w(Sandbox Production Services Performance Staging Test Preprod)
210
+ %w(Sandbox Production Services Performance Staging Test Preprod QAD5 QAD6 QAD7 QAD8 QAD9)
211
211
  end
212
212
 
213
213
  def self.regions
@@ -221,7 +221,13 @@ module ZuoraAPI
221
221
  "Services" => "https://services347.zuora.com/apps/services/a/",
222
222
  "Staging" => "https://staging2.zuora.com/apps/services/a/",
223
223
  "Test" => "https://test.zuora.com/apps/services/a/",
224
- "Preprod" => "https://preprod.zuora.com/apps/services/a/"},
224
+ "Preprod" => "https://preprod.zuora.com/apps/services/a/",
225
+ "QAD5" => "https://app-5.qad.na.zuora.com/apps/services/a/",
226
+ "QAD6" => "https://app-6.qad.na.zuora.com/apps/services/a/",
227
+ "QAD7" => "https://app-7.qad.na.zuora.com/apps/services/a/",
228
+ "QAD8" => "https://app-8.qad.na.zuora.com/apps/services/a/",
229
+ "QAD9" => "https://app-9.qad.na.zuora.com/apps/services/a/",
230
+ },
225
231
  "EU" => {"Sandbox" => "https://sandbox.eu.zuora.com/apps/services/a/",
226
232
  "Production" => "https://eu.zuora.com/apps/services/a/",
227
233
  "Performance" => "https://pt1.eu.zuora.com/apps/services/a/",
@@ -232,7 +238,13 @@ module ZuoraAPI
232
238
  "Performance" => "https://pt1.na.zuora.com/apps/services/a/",
233
239
  "Services" => "https://services347.na.zuora.com/apps/services/a/",
234
240
  "Test" => "https://test.zuora.com/apps/services/a/",
235
- "Preprod" => "https://preprod.zuora.com/apps/services/a/"},
241
+ "Preprod" => "https://preprod.zuora.com/apps/services/a/",
242
+ "QAD5" => "https://app-5.qad.na.zuora.com/apps/services/a/",
243
+ "QAD6" => "https://app-6.qad.na.zuora.com/apps/services/a/",
244
+ "QAD7" => "https://app-7.qad.na.zuora.com/apps/services/a/",
245
+ "QAD8" => "https://app-8.qad.na.zuora.com/apps/services/a/",
246
+ "QAD9" => "https://app-9.qad.na.zuora.com/apps/services/a/",
247
+ },
236
248
  "JP" => {"Sandbox" => "https://sandbox.ap.zuora.com/apps/services/a/",
237
249
  "Production" => "https://ap.zuora.com/apps/services/a/",
238
250
  "Test" => "https://test.ap.zuora.com/apps/services/a/"}
@@ -273,6 +285,16 @@ module ZuoraAPI
273
285
  case self.hostname
274
286
  when /(?<=\.|\/|-|^)(apisandbox|sandbox)(?=\.|\/|-|$)/
275
287
  self.environment = 'Sandbox'
288
+ when /(?<=\.|\/|-|^)(app-5\.qad)(?=\.|\/|-|$)/
289
+ self.environment = 'QAD5'
290
+ when /(?<=\.|\/|-|^)(app-6\.qad)(?=\.|\/|-|$)/
291
+ self.environment = 'QAD6'
292
+ when /(?<=\.|\/|-|^)(app-7\.qad)(?=\.|\/|-|$)/
293
+ self.environment = 'QAD7'
294
+ when /(?<=\.|\/|-|^)(app-8\.qad)(?=\.|\/|-|$)/
295
+ self.environment = 'QAD8'
296
+ when /(?<=\.|\/|-|^)(app-9\.qad)(?=\.|\/|-|$)/
297
+ self.environment = 'QAD9'
276
298
  when /(?<=\.|\/|^)(service[\d]*|services[\d]*|ep-edge)(?=\.|\/|$)/
277
299
  self.environment = 'Services'
278
300
  when /(?<=\.|\/|-|^)(pt[\d]*)(?=\.|\/|-|$)/
@@ -296,8 +318,8 @@ module ZuoraAPI
296
318
  def update_zconnect_provider
297
319
  update_region if self.region.blank?
298
320
  update_environment if self.environment.blank?
299
- mappings = {"US" => {"Sandbox" => "ZConnectSbx", "Services" => "ZConnectSvcUS", "Production" => "ZConnectProd", "Performance" => "ZConnectPT1", "Preprod" => "ZConnectPreprod", "Test" => "ZConnectTest", "Staging" => "ZConnectQA", "KubeSTG" => "ZConnectDev", "KubeDEV" => "ZConnectDev", "KubePROD" => "ZConnectDev"},
300
- "NA" => {"Sandbox" => "ZConnectSbxNA", "Services" => "ZConnectSvcNA", "Production" => "ZConnectProdNA", "Performance" => "ZConnectPT1NA"},
321
+ 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"},
322
+ "NA" => {"Sandbox" => "ZConnectSbxNA", "Services" => "ZConnectSvcNA", "Production" => "ZConnectProdNA", "Performance" => "ZConnectPT1NA", "QAD5" => "ZConnectQA", "QAD6" => "ZConnectQA", "QAD7" => "ZConnectQA", "QAD8" => "ZConnectQA", "QAD9" => "ZConnectQA"},
301
323
  "EU" => {"Sandbox" => "ZConnectSbxEU", "Services" => "ZConnectSvcEU", "Production" => "ZConnectProdEU", "Performance" => "ZConnectPT1EU", "Test" => "ZConnectTest"},
302
324
  "JP" => {"Sandbox" => "ZConnectSbxAP", "Services" => "ZConnectSvcAP", "Production" => "ZConnectProdAP", "Performance" => "ZConnectPT1AP", "Test" => "ZConnectTest"},
303
325
  "Unknown" => {"Unknown" => "Unknown"}}
@@ -337,6 +359,16 @@ module ZuoraAPI
337
359
  endpoint = "https://rest-staging2.zuora.com"
338
360
  when 'Preprod'
339
361
  endpoint = "https://rest.preprod.zuora.com"
362
+ when 'QAD5'
363
+ endpoint = "https://rest-5.qad.na.zuora.com"
364
+ when 'QAD6'
365
+ endpoint = "https://rest-6.qad.na.zuora.com"
366
+ when 'QAD7'
367
+ endpoint = "https://rest-7.qad.na.zuora.com"
368
+ when 'QAD8'
369
+ endpoint = "https://rest-8.qad.na.zuora.com"
370
+ when 'QAD9'
371
+ endpoint = "https://rest-9.qad.na.zuora.com"
340
372
  when 'Unknown'
341
373
  raise "Environment unknown, returning passed in parameter unaltered"
342
374
  end
@@ -900,6 +932,12 @@ module ZuoraAPI
900
932
  raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['message'], response) if ![200,201,202].include?(response.code)
901
933
  end
902
934
 
935
+ if body.class == Hash && body['errors'].present?
936
+ if body['errors'].class == Array && body.dig('errors', 0).is_a?(Hash)
937
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['errors'][0].fetch("message", "No error message. Zuora API Error"), response)
938
+ end
939
+ end
940
+
903
941
  self.errors_via_content_type(response: response, type: :json)
904
942
 
905
943
  #All other errors
@@ -1479,6 +1517,13 @@ module ZuoraAPI
1479
1517
  end
1480
1518
  end
1481
1519
 
1520
+ rescue ZuoraAPI::Exceptions::FileDownloadError => ex
1521
+ if ex.message.match(/.*The current tenant does not have a file with id.*/)
1522
+ raise
1523
+ else
1524
+ Rails.logger.error("File Download Failed")
1525
+ raise
1526
+ end
1482
1527
  rescue => ex
1483
1528
  sleep(5)
1484
1529
  if (retry_count -= 1) >= 0
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.12.0"
2
+ VERSION = "1.12.2"
3
3
  end
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.12.0
4
+ version: 1.12.2
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: 2024-10-28 00:00:00.000000000 Z
11
+ date: 2024-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler