zuora_api 1.7.66f → 1.7.66k

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: b2ec277d17da6045065c52d109e4e46c6c4abfb9b0024e1196536fd1e3713dd9
4
- data.tar.gz: f6341f70793093543d78c26028ce8bd7e347d6bdb56bddcf2a3eacacaa3e1d8d
3
+ metadata.gz: 7fa1187b824462a04a69aedfa13b20c67727e30a8fccef9a62d7c5b5dde77224
4
+ data.tar.gz: ace9bbb9317ac71fecbff5af4fd24509f9698fcd33db71b3330342a4bca8d1aa
5
5
  SHA512:
6
- metadata.gz: d9d5c64f3a17b2bab098eed68c888752ad781df5095ae39cce33ba74687cae36785481313dc8915a633788ba52d7fd32feb696fdeb07cd6fc4d3012a146fb2bc
7
- data.tar.gz: 84ac3d58829be07766fa31cbb964aea48d73da0d77a88ea92067622508ce3296bbda4b153119c08c7b2f19dbc8341e74ac04d9abce7ef1c363a568a7ee9fa1de
6
+ metadata.gz: 9ac138aec48b305c7d3c972f4b533b6e4ab7ff21e937dc9c79992a23b8480542b7bc25449f90365e59509b239e3fa7bad89248b4273337cb8e9d53d6c782ff8b
7
+ data.tar.gz: 037f86064a5ea3434da2d5256d3652c36567036955ca7ebd1b56f50d86593415f615181d23c322b820506ece425f16b531a551073c6aa1517d4b8b7ee6005336
@@ -616,7 +616,7 @@ module ZuoraAPI
616
616
  path: ex.response.request.path.to_s,
617
617
  method: ex.response.request.http_method.to_s.split("Net::HTTP::").last.upcase,
618
618
  params: ex.response.request.raw_body.to_s,
619
- headers: ex.response.request.options[:headers].map{|k,v| [k, k.downcase.strip == "authorization" ? "VALUE FILTERED" : v]}.to_h.to_s,
619
+ headers: ex.response.request.options[:headers].map{|k,v| [k.to_s, k.to_s.downcase.strip == "authorization" ? "VALUE FILTERED" : v]}.to_h.to_s,
620
620
  },
621
621
  response: {
622
622
  status: ex.response.code,
@@ -632,7 +632,7 @@ module ZuoraAPI
632
632
  path: ex.request.path.to_s,
633
633
  method: ex.request.http_method.to_s.split("Net::HTTP::").last.upcase,
634
634
  params: ex.request.options[:body],
635
- headers: ex.request.options[:headers].map{|k,v| [k, k.downcase.strip == "authorization" ? "VALUE FILTERED" : v]}.to_h.to_s
635
+ headers: ex.request.options[:headers].map{|k,v| [k.to_s, k.to_s.downcase.strip == "authorization" ? "VALUE FILTERED" : v]}.to_h.to_s
636
636
  }
637
637
  })
638
638
  args.merge!({
@@ -697,12 +697,12 @@ module ZuoraAPI
697
697
  ).present?
698
698
  result = body.xpath('//ns2:Status', 'ns2' => 'http://object.api.zuora.com/').text
699
699
  if result == 'Failed'
700
- reason = body.xpath('//ns2:StatusReason', 'ns2' => 'http://object.api.zuora.com/').text
701
- if reason.present?
702
- message = body.xpath('//ns2:StatusReason', 'ns2' => 'http://object.api.zuora.com/').text
703
- error = message.match(/^[\w\d]{16}\: (Unexpected error.|No HTTP Response|Socket Timeout|There is an internal error, please try again later)/).present? ? 'UNEXPECTED_ERROR' : 'FATAL_ERROR'
700
+ message = body.xpath('//ns2:StatusReason', 'ns2' => 'http://object.api.zuora.com/').text
701
+ error = 'FATAL_ERROR'
702
+ if message.present?
703
+ identifier, new_message = message.scan(/^([\w\d]{16})\: (.*)/).first
704
+ error, message = ['UNEXPECTED_ERROR', new_message] if new_message.present?
704
705
  else
705
- error = 'FATAL_ERROR'
706
706
  message = 'Export failed due to unknown reason. Consult api logs.'
707
707
  end
708
708
  end
@@ -925,6 +925,8 @@ module ZuoraAPI
925
925
  raise ZuoraAPI::Exceptions::ZuoraAPIConnectionTimeout.new(error_message, response)
926
926
  when /Client sent a bad request./, /Bad Request/, /403 Forbidden/
927
927
  raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(error_message, response)
928
+ when /414 Request-URI Too Large/
929
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new("Request URL is too long", response)
928
930
  else
929
931
  raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(error_message, response)
930
932
  end
@@ -994,7 +996,7 @@ module ZuoraAPI
994
996
  raise ZuoraAPI::Exceptions::ZuoraAPIUnkownError.new(message, response, errors, success)
995
997
  end
996
998
  raise ZuoraAPI::Exceptions::ZuoraAPIError.new(message, response, errors, success)
997
- when /invalid/, /^DUPLICATE_VALUE/, /^REQUEST_REJECTED/, /INVALID_ID/, /MAX_RECORDS_EXCEEDED/, /INVALID_FIELD/, /MALFORMED_QUERY/, /NO_PERMISSION/, /PDF_QUERY_ERROR/, /MISSING_REQUIRED_VALUE/, /INVALID_TYPE/, /TRANSACTION_FAILED/, /API_DISABLED/, /CANNOT_DELETE/, /ACCOUNTING_PERIOD_CLOSED/
999
+ when /^INVALID_VERSION/, /invalid/, /^DUPLICATE_VALUE/, /^REQUEST_REJECTED/, /INVALID_ID/, /MAX_RECORDS_EXCEEDED/, /INVALID_FIELD/, /MALFORMED_QUERY/, /NO_PERMISSION/, /PDF_QUERY_ERROR/, /MISSING_REQUIRED_VALUE/, /INVALID_TYPE/, /TRANSACTION_FAILED/, /API_DISABLED/, /CANNOT_DELETE/, /ACCOUNTING_PERIOD_CLOSED/
998
1000
  raise ZuoraAPI::Exceptions::ZuoraAPIError.new(message, response, errors, success)
999
1001
  when /.*UNEXPECTED_ERROR/
1000
1002
  raise ZuoraAPI::Exceptions::ZuoraUnexpectedError.new(message, response, errors, success)
@@ -32,7 +32,6 @@ module ZuoraAPI
32
32
  end
33
33
 
34
34
  def get_z_session(debug: false, zuora_track_id: nil)
35
- tries ||= 2
36
35
  headers = self.entity_id.present? ? {"Zuora-Entity-Ids" => self.entity_id } : {}
37
36
  headers['Zuora-Track-Id'] = zuora_track_id if zuora_track_id.present?
38
37
  output_json, response = self.rest_call(:url => self.rest_endpoint("connections"), :session_type => :bearer, :headers => headers)
@@ -46,16 +45,8 @@ module ZuoraAPI
46
45
  headers: response.headers.to_s,
47
46
  }
48
47
  })
49
- raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Failure Parsing Cookie Headers")
48
+ raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Failure Parsing Cookie Headers", response)
50
49
  end
51
- rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
52
- if !tries.zero?
53
- @tries -= 1
54
- Rails.logger.debug {"Session Invalid"}
55
- self.new_session(auth_type: :bearer)
56
- retry
57
- end
58
- raise ex
59
50
  end
60
51
 
61
52
  def get_bearer_token(zuora_track_id: nil)
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.7.66f"
2
+ VERSION = "1.7.66k"
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.66f
4
+ version: 1.7.66k
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-06-14 00:00:00.000000000 Z
11
+ date: 2020-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler