zuora_api 1.7.7a → 1.7.7b

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: 2697794114e89b4d76001a4746c1148229aeada880a18ab2cd3a97673549d2c6
4
- data.tar.gz: 7a66c8c6b0d604bc9d1229424ecca8a557c6c36a84304049970988cbf7e6c771
3
+ metadata.gz: c46e7acaf400f6e50f9cc5bb7db90ed4a73833537a4f2503e39521000d554dd0
4
+ data.tar.gz: 27e4ff813dbe248d4c0c30c60fbf638c5e6a8b3673a761ca334064edea51db61
5
5
  SHA512:
6
- metadata.gz: d7a8ae407cd8d86a1249b404ef27be7ee13e13e8f620ec7cda03d84db3c17c077ead6cbf8f90d6bb8be66fb5594d90adf7184e707a7ac1f1639b84434868fe4f
7
- data.tar.gz: b9732ae7b0397cc983e87e3459f80fa013c81170f2fd1fec15256a51e79e6722eeac58dcda457eb7d4ec323cbe5efd869094f3abbc29124e737d95689d4150a1
6
+ metadata.gz: cf6026c2ab190b8aee2383acf207b76e37a100681586c1552fe63575e2b4965628f69b6c9d6c0c6167c7d63683a3a20a7b72560f3d7c22a6460d273e08f1c7c6
7
+ data.tar.gz: 3be94a32382beef293d67bc99434a626a99e26b905fcf867a9fa28c7fea56ca0ed3d0a6439a6e542c4eca58cae6f905b3580777138299e9cbafc91b5ad77e8e5
@@ -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_Endpoint = '96.0'
10
+ MIN_Endpoints = {'Test': '105.0', 'Sandbox': '105.0', 'Production': '105.0', 'Preformance': '105.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '105.0'}.freeze
11
11
  XML_SAVE_OPTIONS = Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
12
12
 
13
13
  CONNECTION_EXCEPTIONS = [
@@ -50,10 +50,12 @@ module ZuoraAPI
50
50
  raise "URL is nil or empty, but URL is required" if url.nil? || url.empty?
51
51
  # raise "URL is improper. URL must contain zuora.com, zuora.eu, or zuora.na" if /zuora.com|zuora.eu|zuora.na/ === url
52
52
  self.hostname = /(?<=https:\/\/|http:\/\/)(.*?)(?=\/|$)/.match(url)[0] if !/(?<=https:\/\/|http:\/\/)(.*?)(?=\/|$)/.match(url).nil?
53
+ self.update_environment
54
+ min_endpoint = MIN_Endpoints[self.environment.to_sym]
53
55
  if !/apps\/services\/a\/\d+\.\d$/.match(url.strip)
54
- self.url = "https://#{hostname}/apps/services/a/#{MIN_Endpoint}"
55
- elsif MIN_Endpoint.to_f > url.scan(/(\d+\.\d)$/).dig(0,0).to_f
56
- self.url = url.gsub(/(\d+\.\d)$/, MIN_Endpoint)
56
+ self.url = "https://#{hostname}/apps/services/a/#{min_endpoint}"
57
+ elsif min_endpoint.to_f > url.scan(/(\d+\.\d)$/).dig(0,0).to_f
58
+ self.url = url.gsub(/(\d+\.\d)$/, min_endpoint)
57
59
  else
58
60
  self.url = url
59
61
  end
@@ -65,7 +67,6 @@ module ZuoraAPI
65
67
  self.status = status.blank? ? "Active" : status
66
68
  self.user_info = Hash.new
67
69
  self.update_region
68
- self.update_environment
69
70
  self.update_zconnect_provider
70
71
  @timeout_sleep = 5
71
72
  end
@@ -252,7 +253,7 @@ module ZuoraAPI
252
253
  end
253
254
 
254
255
  def update_environment
255
- if !self.url.blank?
256
+ if !self.hostname.blank?
256
257
  case self.hostname
257
258
  when /(?<=\.|\/|-|^)(apisandbox|sandbox)(?=\.|\/|-|$)/
258
259
  self.environment = 'Sandbox'
@@ -275,13 +276,13 @@ module ZuoraAPI
275
276
  end
276
277
 
277
278
  def update_zconnect_provider
278
- region = update_region
279
- environment = update_environment
279
+ update_region if self.region.blank?
280
+ update_environment if self.environment.blank?
280
281
  mappings = {"US" => {"Sandbox" => "ZConnectSbx", "Services" => "ZConnectSvcUS", "Production" => "ZConnectProd", "Performance" => "ZConnectPT1", "Test" => "ZConnectTest", "Staging" => "ZConnectQA", "KubeSTG" => "ZConnectDev", "KubeDEV" => "ZConnectDev", "KubePROD" => "ZConnectDev"},
281
282
  "NA" => {"Sandbox" => "ZConnectSbxNA", "Services" => "ZConnectSvcNA", "Production" => "ZConnectProdNA", "Performance" => "ZConnectPT1NA"},
282
283
  "EU" => {"Sandbox" => "ZConnectSbxEU", "Services" => "ZConnectSvcEU", "Production" => "ZConnectProdEU", "Performance" => "ZConnectPT1EU", "Test" => "ZConnectTest"},
283
284
  "Unknown" => {"Unknown" => "Unknown"}}
284
- self.zconnect_provider = mappings[region][environment]
285
+ self.zconnect_provider = mappings[self.region][self.environment]
285
286
  end
286
287
 
287
288
  def aqua_endpoint(url="")
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.7.7a"
2
+ VERSION = "1.7.7b"
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.7.7a
4
+ version: 1.7.7b
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-08-26 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler