zuora_rest_client 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fixtures/vcr_cassettes/zuora/create_account_object_success.yml +8 -8
- data/fixtures/vcr_cassettes/zuora/create_account_success.yml +16 -10
- data/fixtures/vcr_cassettes/zuora/delete_account_object_success.yml +34 -34
- data/fixtures/vcr_cassettes/zuora/describe_account.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/describe_account_related_objects.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/describe_all_account_fields.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/describe_all_zobjects.yml +27 -21
- data/fixtures/vcr_cassettes/zuora/describe_exportable_account_fields.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/describe_non_exportable_account_fields.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/describe_non_updateable_account_fields.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/describe_updateable_account_fields.yml +31 -12
- data/fixtures/vcr_cassettes/zuora/get_account_object_success.yml +11 -11
- data/fixtures/vcr_cassettes/zuora/get_account_success.yml +21 -12
- data/fixtures/vcr_cassettes/zuora/get_account_summary_success.yml +21 -14
- data/fixtures/vcr_cassettes/zuora/update_account_object_success.yml +20 -20
- data/fixtures/vcr_cassettes/zuora/update_account_success.yml +35 -20
- data/lib/zuora_rest_client/connection.rb +21 -10
- data/lib/zuora_rest_client/version.rb +1 -1
- metadata +2 -2
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://rest.zuora.com/v1/accounts/
|
5
|
+
uri: https://rest.zuora.com/v1/accounts/2c92a0fc636cad92016375070a0e3b22
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: '{"batch":"Batch2"}'
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Accept-Encoding:
|
15
15
|
- gzip,deflate
|
16
16
|
Date:
|
17
|
-
-
|
17
|
+
- Fri, 18 May 2018 20:53:06 GMT
|
18
18
|
Content-Type:
|
19
19
|
- application/json
|
20
20
|
Apiaccesskeyid:
|
@@ -28,22 +28,28 @@ http_interactions:
|
|
28
28
|
headers:
|
29
29
|
Content-Type:
|
30
30
|
- application/json;charset=utf-8
|
31
|
+
Content-Security-Policy-Report-Only:
|
32
|
+
- media-src 'none'; img-src 'self' *.zuora.com; object-src *.zuora.com; script-src
|
33
|
+
'unsafe-inline' 'unsafe-eval' 'self' https://api.tcell.io/; manifest-src 'none';
|
34
|
+
style-src 'unsafe-inline' 'self'; font-src 'self'; child-src 'none'; frame-src
|
35
|
+
'none'; connect-src 'self' https://api.tcell.io/ https://input.tcell.io/;
|
36
|
+
report-uri https://input.tcell.io/csp/e14f749ededb34ed6f61ee047073e7d5c02428ea31e0b1249ed5bdb2d99decec?tid=88c09fe3-c5cf-43ca-b135-133ede4800d4
|
31
37
|
Server:
|
32
38
|
- Zuora App
|
33
|
-
|
34
|
-
-
|
39
|
+
Zuora-Request-Id:
|
40
|
+
- 2a168ab2-6970-4d9b-b7ab-26a7de5ac5c9
|
35
41
|
X-Kong-Upstream-Latency:
|
36
|
-
- '
|
42
|
+
- '70'
|
37
43
|
X-Kong-Proxy-Latency:
|
38
44
|
- '0'
|
39
45
|
Expires:
|
40
|
-
-
|
46
|
+
- Fri, 18 May 2018 20:53:06 GMT
|
41
47
|
Cache-Control:
|
42
48
|
- max-age=0, no-cache, no-store
|
43
49
|
Pragma:
|
44
50
|
- no-cache
|
45
51
|
Date:
|
46
|
-
-
|
52
|
+
- Fri, 18 May 2018 20:53:06 GMT
|
47
53
|
Content-Length:
|
48
54
|
- '22'
|
49
55
|
Connection:
|
@@ -57,10 +63,10 @@ http_interactions:
|
|
57
63
|
"success" : true
|
58
64
|
}
|
59
65
|
http_version:
|
60
|
-
recorded_at:
|
66
|
+
recorded_at: Fri, 18 May 2018 20:53:06 GMT
|
61
67
|
- request:
|
62
68
|
method: get
|
63
|
-
uri: https://rest.zuora.com/v1/accounts/
|
69
|
+
uri: https://rest.zuora.com/v1/accounts/2c92a0fc636cad92016375070a0e3b22
|
64
70
|
body:
|
65
71
|
encoding: UTF-8
|
66
72
|
string: ''
|
@@ -72,7 +78,7 @@ http_interactions:
|
|
72
78
|
Accept-Encoding:
|
73
79
|
- gzip,deflate
|
74
80
|
Date:
|
75
|
-
-
|
81
|
+
- Fri, 18 May 2018 20:53:06 GMT
|
76
82
|
Content-Type:
|
77
83
|
- application/json
|
78
84
|
Apiaccesskeyid:
|
@@ -86,24 +92,30 @@ http_interactions:
|
|
86
92
|
headers:
|
87
93
|
Content-Type:
|
88
94
|
- application/json;charset=utf-8
|
95
|
+
Content-Security-Policy-Report-Only:
|
96
|
+
- media-src 'none'; img-src 'self' *.zuora.com; object-src *.zuora.com; script-src
|
97
|
+
'unsafe-inline' 'unsafe-eval' 'self' https://api.tcell.io/; manifest-src 'none';
|
98
|
+
style-src 'unsafe-inline' 'self'; font-src 'self'; child-src 'none'; frame-src
|
99
|
+
'none'; connect-src 'self' https://api.tcell.io/ https://input.tcell.io/;
|
100
|
+
report-uri https://input.tcell.io/csp/e14f749ededb34ed6f61ee047073e7d5c02428ea31e0b1249ed5bdb2d99decec?tid=fcad505f-f11b-42a5-a3dc-7ba58cecf924
|
89
101
|
Server:
|
90
102
|
- Zuora App
|
91
|
-
|
92
|
-
-
|
103
|
+
Zuora-Request-Id:
|
104
|
+
- e5e3f867-e66e-45cf-b061-1f6eae78ef00
|
93
105
|
X-Kong-Upstream-Latency:
|
94
|
-
- '
|
106
|
+
- '67'
|
95
107
|
X-Kong-Proxy-Latency:
|
96
108
|
- '0'
|
97
109
|
Expires:
|
98
|
-
-
|
110
|
+
- Fri, 18 May 2018 20:53:06 GMT
|
99
111
|
Cache-Control:
|
100
112
|
- max-age=0, no-cache, no-store
|
101
113
|
Pragma:
|
102
114
|
- no-cache
|
103
115
|
Date:
|
104
|
-
-
|
116
|
+
- Fri, 18 May 2018 20:53:06 GMT
|
105
117
|
Content-Length:
|
106
|
-
- '
|
118
|
+
- '2376'
|
107
119
|
Connection:
|
108
120
|
- keep-alive
|
109
121
|
Set-Cookie:
|
@@ -113,9 +125,9 @@ http_interactions:
|
|
113
125
|
string: |-
|
114
126
|
{
|
115
127
|
"basicInfo" : {
|
116
|
-
"id" : "
|
128
|
+
"id" : "2c92a0fc636cad92016375070a0e3b22",
|
117
129
|
"name" : "Test Account",
|
118
|
-
"accountNumber" : "
|
130
|
+
"accountNumber" : "Z00324103",
|
119
131
|
"notes" : null,
|
120
132
|
"status" : "Active",
|
121
133
|
"crmId" : null,
|
@@ -136,9 +148,12 @@ http_interactions:
|
|
136
148
|
"TestAccountField__c" : null,
|
137
149
|
"SuppressDunning__c" : null,
|
138
150
|
"ACHVerificationCode__c" : null,
|
151
|
+
"CCemail__c" : null,
|
139
152
|
"publisher__c" : null,
|
140
153
|
"DellAffinityNo__c" : null,
|
141
|
-
"ACHVerificationTimestamp__c" : null
|
154
|
+
"ACHVerificationTimestamp__c" : null,
|
155
|
+
"salesRep" : null,
|
156
|
+
"parentId" : null
|
142
157
|
},
|
143
158
|
"billingAndPayment" : {
|
144
159
|
"billCycleDay" : 15,
|
@@ -203,5 +218,5 @@ http_interactions:
|
|
203
218
|
"success" : true
|
204
219
|
}
|
205
220
|
http_version:
|
206
|
-
recorded_at:
|
221
|
+
recorded_at: Fri, 18 May 2018 20:53:06 GMT
|
207
222
|
recorded_with: VCR 3.0.3
|
@@ -10,6 +10,9 @@ require 'net/http'
|
|
10
10
|
require 'addressable/uri'
|
11
11
|
|
12
12
|
module ZuoraRestClient
|
13
|
+
|
14
|
+
class ConnectionError < StandardError; end
|
15
|
+
|
13
16
|
class Connection
|
14
17
|
|
15
18
|
DEFAULT_OPTIONS = {
|
@@ -66,8 +69,12 @@ module ZuoraRestClient
|
|
66
69
|
request[header_key] = header_value
|
67
70
|
end
|
68
71
|
http.request request do |response|
|
69
|
-
response.
|
70
|
-
|
72
|
+
if response.kind_of? Net::HTTPSuccess
|
73
|
+
response.read_body do |chunk|
|
74
|
+
destination_io.write chunk
|
75
|
+
end
|
76
|
+
else
|
77
|
+
raise ConnectionError.new("Error: #{response.code} - #{response.message}")
|
71
78
|
end
|
72
79
|
end
|
73
80
|
end
|
@@ -144,17 +151,21 @@ module ZuoraRestClient
|
|
144
151
|
end
|
145
152
|
|
146
153
|
def process_response(response)
|
147
|
-
if response.
|
148
|
-
|
149
|
-
|
150
|
-
object.
|
154
|
+
if response.success? || response.status == 404
|
155
|
+
if response.headers['Content-Type'].to_s.start_with?('application/json')
|
156
|
+
object = MultiJson.load(response.body)
|
157
|
+
if object.is_a? Array
|
158
|
+
object.map { |item| Result.new(item, recurse_over_arrays: true) }
|
159
|
+
else
|
160
|
+
Result.new(object, recurse_over_arrays: true)
|
161
|
+
end
|
162
|
+
elsif response.headers['Content-Type'].to_s.start_with?('text/xml')
|
163
|
+
Result.new(Nori.new.parse(response.body), recurse_over_arrays: true)
|
151
164
|
else
|
152
|
-
|
165
|
+
response
|
153
166
|
end
|
154
|
-
elsif response.headers['Content-Type'].to_s.start_with?('text/xml')
|
155
|
-
Result.new(Nori.new.parse(response.body), recurse_over_arrays: true)
|
156
167
|
else
|
157
|
-
response
|
168
|
+
raise ConnectionError.new("Error: #{response.status} - #{response.reason_phrase}")
|
158
169
|
end
|
159
170
|
end
|
160
171
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_rest_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Massad
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|