zuora_api 1.7.7d → 1.7.7e

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: 06ea9e3edcec3fe4fdd4f8f77a0b393dc7b7008c1ad8122daf7b4979a2a30f91
4
- data.tar.gz: d18b6753bb06443cdf7ad915ff03c54e069900a40568313c79a31a4c2947ba1f
3
+ metadata.gz: e1dd5edfe590ad2f7aa070eb4bae913605e0035e16ad02c92ff8a1110714fb70
4
+ data.tar.gz: 7b1824d0b0046df3e1ae8ab179a04f19df7803595a44cfb2caffa7bbcb620fcb
5
5
  SHA512:
6
- metadata.gz: d48da927e43428795532797726669d5d911506cb4cf53ad4f927623135a436a49ba2efb00a1c017ba097fb7dd89848f72e28329983a48b57c316b4422658dd31
7
- data.tar.gz: 99097cd17e7954fa5a05ae96b3479344be576146b909575b066aa14634e7afe295f057762aaf230387e809db4ce406305e7e1c2a273d08d5bf73db09bbef0071
6
+ metadata.gz: ad30e83ace37d5c8a75709cc7ecbf36d30a7aae527f93993e48322914c412b30dd717cb5a48601aff64e1dd51a55907e934488a136256e86942c6e41f61d4540
7
+ data.tar.gz: '094a9f289fe688ee21c371e7215910b3590c5230144579e82f5db1bfff2559de385381064b0a0cab069757f1d9dae78a9ce018584dc2091297fa54a84708edd7'
data/.gitignore CHANGED
@@ -7,4 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- .idea
10
+ .idea
11
+ .DS_Store
@@ -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': '105.0', 'Sandbox': '105.0', 'Production': '105.0', 'Preformance': '105.0', 'Services': '96.0', 'Unknown': '96.0', 'Staging': '105.0'}.freeze
10
+ MIN_Endpoints = {'Test': '105.0', 'Sandbox': '105.0', 'Production': '105.0', 'Performance': '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 = [
@@ -709,10 +709,21 @@ module ZuoraAPI
709
709
 
710
710
  body = body.dig("results").present? ? body["results"] : body if body.class == Hash
711
711
  if body.class == Hash && (!body["success"] || !body["Success"] || response.code != 200)
712
- messages_array = body.fetch("reasons", []).map {|error| error['message']}.compact
712
+ reason_keys = %w(reasons errors)
713
+ message_keys = %w(message title)
714
+ messages_array, codes_array = []
715
+ reason_keys.each do |rsn_key|
716
+ message_keys.each do |msg_key|
717
+ messages_array = body.fetch(rsn_key, []).map {|error| error[msg_key]}.compact
718
+ break if messages_array.present?
719
+ end
720
+ codes_array = body.fetch(rsn_key, []).map {|error| error['code']}.compact
721
+ break if messages_array.present? && codes_array.present?
722
+ end
713
723
  messages_array = messages_array.push(body.dig("error", 'message')).compact if body.dig('error').class == Hash
714
- codes_array = body.fetch("reasons", []).map {|error| error['code']}.compact
715
724
  codes_array = codes_array.push(body.dig("error", 'code')).compact if body.dig('error').class == Hash
725
+ puts "messages_array #{messages_array}"
726
+ puts "codes_array #{codes_array}"
716
727
 
717
728
  if body['message'] == 'request exceeded limit'
718
729
  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)
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.7.7d"
2
+ VERSION = "1.7.7e"
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.7d
4
+ version: 1.7.7e
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-09-14 00:00:00.000000000 Z
11
+ date: 2020-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler