zuora_api 1.7.7 → 1.7.08
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/.gitignore +0 -1
- data/.gitlab-ci.yml +2 -2
- data/Gemfile.lock +29 -29
- data/README.md +1 -1
- data/lib/insights_api/login.rb +6 -5
- data/lib/zuora_api/exceptions.rb +28 -103
- data/lib/zuora_api/login.rb +325 -595
- data/lib/zuora_api/logins/basic.rb +5 -14
- data/lib/zuora_api/logins/oauth.rb +32 -54
- 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: 506b37beaa7dbe046f337f7ed10112f2f6a693b1ebcafa37142634d0f8e649a6
|
|
4
|
+
data.tar.gz: b2fa2c58af2f031a4f216daa7adad6bff10cd8ab6d1023a224ca44344beff6e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1b34d7894d4a9c3211c4ce783278d0f087dba37215821c723b064a5272153c0ab806ffd0575963f99ccf8610fb2a79d8979aae78ad43a948df1fa368da96017
|
|
7
|
+
data.tar.gz: f64b564c69ec0a9da2816e1032b78b3c42e22b4fb2bcccdc62d64524871ab0c0f48902c37557249f5c629a34e4299cafd493e80737c9bb9b15c6d7d0c89b1f2f
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
CHANGED
|
@@ -45,8 +45,8 @@ rubygems-deploy:
|
|
|
45
45
|
- apt-get install -y git
|
|
46
46
|
- apt-get clean all
|
|
47
47
|
- gem install dpl
|
|
48
|
-
- if [[ "staging"
|
|
49
|
-
- if [[ "master"
|
|
48
|
+
- if [[ "staging" == $CI_BUILD_REF_SLUG ]];then export VERSION=`git describe --exclude "[0-9]*\.[0-9]*\.[0-9]*[a-z]" --abbrev=0 --tags HEAD`; fi
|
|
49
|
+
- if [[ "master" == $CI_BUILD_REF_SLUG ]];then export VERSION=`git describe --exclude "[0-9]*\.[0-9]*\.[0-9]*[a-z]" --abbrev=0 --tags HEAD`; fi
|
|
50
50
|
- echo $VERSION
|
|
51
51
|
- sed -i "s/0.0.1/$VERSION/" lib/zuora_api/version.rb
|
|
52
52
|
- git add lib/zuora_api/version.rb
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zuora_api (1.7.
|
|
4
|
+
zuora_api (1.7.08)
|
|
5
5
|
httparty
|
|
6
6
|
nokogiri
|
|
7
7
|
railties (>= 4.1.0, < 6)
|
|
@@ -10,65 +10,65 @@ PATH
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
actionpack (5.2.
|
|
14
|
-
actionview (= 5.2.
|
|
15
|
-
activesupport (= 5.2.
|
|
16
|
-
rack (~> 2.0
|
|
13
|
+
actionpack (5.2.3)
|
|
14
|
+
actionview (= 5.2.3)
|
|
15
|
+
activesupport (= 5.2.3)
|
|
16
|
+
rack (~> 2.0)
|
|
17
17
|
rack-test (>= 0.6.3)
|
|
18
18
|
rails-dom-testing (~> 2.0)
|
|
19
19
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
20
|
-
actionview (5.2.
|
|
21
|
-
activesupport (= 5.2.
|
|
20
|
+
actionview (5.2.3)
|
|
21
|
+
activesupport (= 5.2.3)
|
|
22
22
|
builder (~> 3.1)
|
|
23
23
|
erubi (~> 1.4)
|
|
24
24
|
rails-dom-testing (~> 2.0)
|
|
25
25
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
|
26
|
-
activesupport (5.2.
|
|
26
|
+
activesupport (5.2.3)
|
|
27
27
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
28
28
|
i18n (>= 0.7, < 2)
|
|
29
29
|
minitest (~> 5.1)
|
|
30
30
|
tzinfo (~> 1.1)
|
|
31
31
|
addressable (2.5.2)
|
|
32
32
|
public_suffix (>= 2.0.2, < 4.0)
|
|
33
|
-
builder (3.2.
|
|
34
|
-
concurrent-ruby (1.1.
|
|
33
|
+
builder (3.2.3)
|
|
34
|
+
concurrent-ruby (1.1.5)
|
|
35
35
|
crack (0.4.3)
|
|
36
36
|
safe_yaml (~> 1.0.0)
|
|
37
|
-
crass (1.0.
|
|
37
|
+
crass (1.0.4)
|
|
38
38
|
diff-lcs (1.3)
|
|
39
39
|
docile (1.3.1)
|
|
40
40
|
erubi (1.9.0)
|
|
41
41
|
hashdiff (0.3.7)
|
|
42
|
-
httparty (0.
|
|
42
|
+
httparty (0.17.1)
|
|
43
43
|
mime-types (~> 3.0)
|
|
44
44
|
multi_xml (>= 0.5.2)
|
|
45
|
-
i18n (1.
|
|
45
|
+
i18n (1.6.0)
|
|
46
46
|
concurrent-ruby (~> 1.0)
|
|
47
47
|
json (2.1.0)
|
|
48
|
-
loofah (2.
|
|
48
|
+
loofah (2.2.3)
|
|
49
49
|
crass (~> 1.0.2)
|
|
50
50
|
nokogiri (>= 1.5.9)
|
|
51
|
-
method_source (
|
|
52
|
-
mime-types (3.3
|
|
51
|
+
method_source (0.9.2)
|
|
52
|
+
mime-types (3.3)
|
|
53
53
|
mime-types-data (~> 3.2015)
|
|
54
|
-
mime-types-data (3.
|
|
54
|
+
mime-types-data (3.2019.0904)
|
|
55
55
|
mini_portile2 (2.4.0)
|
|
56
|
-
minitest (5.
|
|
56
|
+
minitest (5.12.0)
|
|
57
57
|
multi_xml (0.6.0)
|
|
58
|
-
nokogiri (1.10.
|
|
58
|
+
nokogiri (1.10.4)
|
|
59
59
|
mini_portile2 (~> 2.4.0)
|
|
60
60
|
public_suffix (3.0.3)
|
|
61
|
-
rack (2.
|
|
61
|
+
rack (2.0.7)
|
|
62
62
|
rack-test (1.1.0)
|
|
63
63
|
rack (>= 1.0, < 3)
|
|
64
64
|
rails-dom-testing (2.0.3)
|
|
65
65
|
activesupport (>= 4.2.0)
|
|
66
66
|
nokogiri (>= 1.6)
|
|
67
|
-
rails-html-sanitizer (1.
|
|
68
|
-
loofah (~> 2.
|
|
69
|
-
railties (5.2.
|
|
70
|
-
actionpack (= 5.2.
|
|
71
|
-
activesupport (= 5.2.
|
|
67
|
+
rails-html-sanitizer (1.2.0)
|
|
68
|
+
loofah (~> 2.2, >= 2.2.2)
|
|
69
|
+
railties (5.2.3)
|
|
70
|
+
actionpack (= 5.2.3)
|
|
71
|
+
activesupport (= 5.2.3)
|
|
72
72
|
method_source
|
|
73
73
|
rake (>= 0.8.7)
|
|
74
74
|
thor (>= 0.19.0, < 2.0)
|
|
@@ -86,16 +86,16 @@ GEM
|
|
|
86
86
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
87
87
|
rspec-support (~> 3.8.0)
|
|
88
88
|
rspec-support (3.8.0)
|
|
89
|
-
rubyzip (2.
|
|
89
|
+
rubyzip (2.0.0)
|
|
90
90
|
safe_yaml (1.0.4)
|
|
91
91
|
simplecov (0.16.1)
|
|
92
92
|
docile (~> 1.1)
|
|
93
93
|
json (>= 1.8, < 3)
|
|
94
94
|
simplecov-html (~> 0.10.0)
|
|
95
95
|
simplecov-html (0.10.2)
|
|
96
|
-
thor (
|
|
96
|
+
thor (0.20.3)
|
|
97
97
|
thread_safe (0.3.6)
|
|
98
|
-
tzinfo (1.2.
|
|
98
|
+
tzinfo (1.2.5)
|
|
99
99
|
thread_safe (~> 0.1)
|
|
100
100
|
webmock (3.4.2)
|
|
101
101
|
addressable (>= 2.3.6)
|
|
@@ -114,4 +114,4 @@ DEPENDENCIES
|
|
|
114
114
|
zuora_api!
|
|
115
115
|
|
|
116
116
|
BUNDLED WITH
|
|
117
|
-
1.17.
|
|
117
|
+
1.17.2
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zuora Gem
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/rb/zuora_api) [](https://badge.fury.io/rb/zuora_api) [](https://gitlab.zuora.com/Connect/zuora-gem/commits/master)
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
Add this line to your application's Gemfile:
|
data/lib/insights_api/login.rb
CHANGED
|
@@ -190,11 +190,12 @@ module InsightsAPI
|
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
rescue => ex
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
if !(tries -= 1).zero?
|
|
194
|
+
sleep 3
|
|
195
|
+
retry
|
|
196
|
+
else
|
|
197
|
+
raise ex
|
|
198
|
+
end
|
|
198
199
|
else
|
|
199
200
|
return temp_file
|
|
200
201
|
end
|
data/lib/zuora_api/exceptions.rb
CHANGED
|
@@ -1,38 +1,14 @@
|
|
|
1
1
|
module ZuoraAPI
|
|
2
2
|
module Exceptions
|
|
3
|
-
class Error < StandardError;
|
|
4
|
-
def parse_message(message)
|
|
5
|
-
case message
|
|
6
|
-
when /^Payment status should be Processed. Invalid payment is P-\d*./
|
|
7
|
-
@message = "Payment status should be Processed."
|
|
8
|
-
when /^Adjustment cannot be created for invoice(.*) with a zero balance./
|
|
9
|
-
@message = "Adjustment cannot be created for invoice with a zero balance."
|
|
10
|
-
when /^The balance of all the invoice items and tax items is 0. No write-off is needed for the invoice .*./
|
|
11
|
-
@message = "The balance of all the invoice items and tax items is 0. No write-off is needed for the invoice."
|
|
12
|
-
when /^Json input does not match schema. Error(s): string ".*" is too long .*/
|
|
13
|
-
@message = "Json input does not match schema. Error(s): String is too long."
|
|
14
|
-
when /^Query failed \(#[\d\w_]*\): line [0-9]+:[0-9]+: (.*)$/
|
|
15
|
-
@message = "Query failed: #{$1}"
|
|
16
|
-
when /^Query failed \(#[\d\w_]*\): (.*)$/
|
|
17
|
-
@message = "Query failed: #{$1}"
|
|
18
|
-
when /^Could not find [\w\d]{32}.$/
|
|
19
|
-
@message = "Could not find object."
|
|
20
|
-
when /^Subscription [\w\d]{32} is in expired status. It is not supported to generate billing documents for expired subscriptions./
|
|
21
|
-
@message = "Subscription is in expired status. It is not supported to generate billing documents for expired subscriptions."
|
|
22
|
-
else
|
|
23
|
-
@message = message
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
class FileDownloadError < StandardError; end
|
|
3
|
+
class Error < StandardError; end
|
|
28
4
|
class AuthorizationNotPerformed < Error; end
|
|
29
5
|
class ZuoraAPISessionError < Error
|
|
30
6
|
attr_reader :code, :response
|
|
31
7
|
attr_writer :default_message
|
|
32
8
|
|
|
33
|
-
def initialize(message = nil,response=nil
|
|
34
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
35
|
-
@message =
|
|
9
|
+
def initialize(message = nil,response=nil)
|
|
10
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
11
|
+
@message = message
|
|
36
12
|
@response = response
|
|
37
13
|
@default_message = "Error with Zuora Session."
|
|
38
14
|
end
|
|
@@ -47,8 +23,8 @@ module ZuoraAPI
|
|
|
47
23
|
attr_writer :default_message
|
|
48
24
|
|
|
49
25
|
def initialize(message = nil,response=nil, errors = [], successes = [], *args)
|
|
50
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
51
|
-
@message =
|
|
26
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
27
|
+
@message = message
|
|
52
28
|
@response = response
|
|
53
29
|
@default_message = "Error with Zuora Entity"
|
|
54
30
|
@errors = errors
|
|
@@ -65,8 +41,8 @@ module ZuoraAPI
|
|
|
65
41
|
attr_writer :default_message
|
|
66
42
|
|
|
67
43
|
def initialize(message = nil,response=nil, errors = [], successes = [], *args)
|
|
68
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
69
|
-
@message =
|
|
44
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
45
|
+
@message = message
|
|
70
46
|
@response = response
|
|
71
47
|
@default_message = "Error communicating with Zuora."
|
|
72
48
|
@errors = errors
|
|
@@ -78,31 +54,13 @@ module ZuoraAPI
|
|
|
78
54
|
end
|
|
79
55
|
end
|
|
80
56
|
|
|
81
|
-
class ZuoraAPIInternalServerError < Error
|
|
82
|
-
attr_reader :code, :response, :errors, :successes
|
|
83
|
-
attr_writer :default_message
|
|
84
|
-
|
|
85
|
-
def initialize(message = nil,response = nil, errors = [], successes = [], *args)
|
|
86
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
87
|
-
@message = parse_message(message)
|
|
88
|
-
@response = response
|
|
89
|
-
@default_message = "Zuora Internal Server Error."
|
|
90
|
-
@errors = errors
|
|
91
|
-
@successes = successes
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def to_s
|
|
95
|
-
@message || @default_message
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
|
|
99
57
|
class ZuoraAPIRequestLimit < Error
|
|
100
58
|
attr_reader :code, :response
|
|
101
59
|
attr_writer :default_message
|
|
102
60
|
|
|
103
|
-
def initialize(message = nil,response=nil,
|
|
104
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
105
|
-
@message =
|
|
61
|
+
def initialize(message = nil,response=nil, *args)
|
|
62
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
63
|
+
@message = message
|
|
106
64
|
@response = response
|
|
107
65
|
@default_message = "Your request limit has been exceeded for zuora."
|
|
108
66
|
end
|
|
@@ -112,29 +70,13 @@ module ZuoraAPI
|
|
|
112
70
|
end
|
|
113
71
|
end
|
|
114
72
|
|
|
115
|
-
class ZuoraAPIUnkownError < Error
|
|
116
|
-
attr_reader :code, :response
|
|
117
|
-
attr_writer :default_message
|
|
118
|
-
|
|
119
|
-
def initialize(message = nil,response=nil, errors = [], successes = [], *args)
|
|
120
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
121
|
-
@message = parse_message(message)
|
|
122
|
-
@response = response
|
|
123
|
-
@default_message = "An unkown error occured. Workflow is not responsible. Please contact Support."
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
def to_s
|
|
127
|
-
@message || @default_message
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
|
|
131
73
|
class ZuoraAPILockCompetition < Error
|
|
132
74
|
attr_reader :code, :response
|
|
133
75
|
attr_writer :default_message
|
|
134
76
|
|
|
135
|
-
def initialize(message = nil,response=nil,
|
|
136
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
137
|
-
@message =
|
|
77
|
+
def initialize(message = nil,response=nil, *args)
|
|
78
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
79
|
+
@message = message
|
|
138
80
|
@response = response
|
|
139
81
|
@default_message = "Operation failed due to lock competition. Please retry"
|
|
140
82
|
end
|
|
@@ -148,9 +90,9 @@ module ZuoraAPI
|
|
|
148
90
|
attr_reader :code, :response
|
|
149
91
|
attr_writer :default_message
|
|
150
92
|
|
|
151
|
-
def initialize(message = nil,response=nil,
|
|
152
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
153
|
-
@message =
|
|
93
|
+
def initialize(message = nil,response=nil, *args)
|
|
94
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
95
|
+
@message = message
|
|
154
96
|
@response = response
|
|
155
97
|
@default_message = "Operation failed due to lock competition. Please retry"
|
|
156
98
|
end
|
|
@@ -160,29 +102,13 @@ module ZuoraAPI
|
|
|
160
102
|
end
|
|
161
103
|
end
|
|
162
104
|
|
|
163
|
-
class ZuoraUnexpectedError < Error
|
|
164
|
-
attr_reader :code, :response
|
|
165
|
-
attr_writer :default_message
|
|
166
|
-
|
|
167
|
-
def initialize(message = nil, response=nil, errors = [], successes = [], *args)
|
|
168
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
169
|
-
@message = parse_message(message)
|
|
170
|
-
@response = response
|
|
171
|
-
@default_message = "An unexpected error occurred"
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
def to_s
|
|
175
|
-
@message || @default_message
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
|
|
179
105
|
class ZuoraAPITemporaryError < Error
|
|
180
106
|
attr_reader :code, :response
|
|
181
107
|
attr_writer :default_message
|
|
182
108
|
|
|
183
|
-
def initialize(message = nil,response=nil,
|
|
184
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
185
|
-
@message =
|
|
109
|
+
def initialize(message = nil,response=nil, *args)
|
|
110
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
111
|
+
@message = message
|
|
186
112
|
@response = response
|
|
187
113
|
@default_message = "There is a temporary error with zuora system."
|
|
188
114
|
end
|
|
@@ -196,9 +122,9 @@ module ZuoraAPI
|
|
|
196
122
|
attr_reader :code, :response
|
|
197
123
|
attr_writer :default_message
|
|
198
124
|
|
|
199
|
-
def initialize(message = nil,response=nil,
|
|
200
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
201
|
-
@message =
|
|
125
|
+
def initialize(message = nil,response=nil, *args)
|
|
126
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
127
|
+
@message = message
|
|
202
128
|
@response = response
|
|
203
129
|
@default_message = "Authentication type is not supported by this Login"
|
|
204
130
|
end
|
|
@@ -212,8 +138,8 @@ module ZuoraAPI
|
|
|
212
138
|
attr_reader :code, :response
|
|
213
139
|
attr_writer :default_message
|
|
214
140
|
|
|
215
|
-
def initialize(message = nil,response=nil,
|
|
216
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
141
|
+
def initialize(message = nil,response=nil, *args)
|
|
142
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
217
143
|
@message = message
|
|
218
144
|
@response = response
|
|
219
145
|
@default_message = "Authentication type is not supported by this Login"
|
|
@@ -225,14 +151,13 @@ module ZuoraAPI
|
|
|
225
151
|
end
|
|
226
152
|
|
|
227
153
|
class ZuoraAPIReadTimeout < Net::ReadTimeout
|
|
228
|
-
attr_reader :code, :response
|
|
154
|
+
attr_reader :code, :response
|
|
229
155
|
attr_writer :default_message
|
|
230
156
|
|
|
231
|
-
def initialize(message = nil,
|
|
232
|
-
@code = response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
157
|
+
def initialize(message = nil,response=nil, *args)
|
|
158
|
+
@code = response.present? && response.class.to_s == "HTTParty::Response" ? response.code : nil
|
|
233
159
|
@message = message
|
|
234
160
|
@response = response
|
|
235
|
-
@request = request
|
|
236
161
|
@default_message = "Authentication type is not supported by this Login"
|
|
237
162
|
end
|
|
238
163
|
|