chartmogul-ruby 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 429f1848cad731536e10e6cb18405ded2b3204f3
|
4
|
+
data.tar.gz: b81939c53b835021ecfdc36182fa77d56f3f41c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de0ed3cd12c57e8cd64333b2ba1dacf6929b141951ef42ba9d4e3bb9861b48c9bcbfa9542c47a1fe032cae957aa2c1c9817c0869c47805655f602adc0f6a2ffd
|
7
|
+
data.tar.gz: 2d24f1deea02bc3ba25adafccaedc1c9c44e96e3a6626b56e7c02c0ff241570be32c5747c650ea1719df33c4213970aac81aac9677c7033cb05fea19eb696c8b
|
data/.gitignore
CHANGED
data/changelog.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# chartmogul-ruby Change Log
|
2
2
|
|
3
|
+
## Version 1.2.2 - 21 December 2018
|
4
|
+
- Added connect subscriptions method
|
5
|
+
|
6
|
+
## Version 1.2.1 - 11 September 2018
|
7
|
+
- Update Faraday dependency version
|
8
|
+
|
9
|
+
## Version 1.2.0 - 15 August 2018
|
10
|
+
- Rertry requests on certain statuses and allow config
|
11
|
+
|
3
12
|
## Version 1.1.8 - 22 June 2018
|
4
13
|
- Fix ChartMogul::ChartMogulError class
|
5
14
|
|
data/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml
ADDED
@@ -0,0 +1,436 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.chartmogul.com/v1/data_sources
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"name":"Subscription Test Data Source"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.15.4
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic secret
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 201
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.10.1
|
23
|
+
date:
|
24
|
+
- Fri, 21 Dec 2018 01:42:26 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
content-length:
|
28
|
+
- '167'
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
status:
|
32
|
+
- 201 Created
|
33
|
+
access-control-allow-credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998","name":"Subscription
|
38
|
+
Test Data Source","system":"Import API","created_at":"2018-12-21T01:42:26.724Z","status":"idle"}'
|
39
|
+
http_version:
|
40
|
+
recorded_at: Fri, 21 Dec 2018 01:42:26 GMT
|
41
|
+
- request:
|
42
|
+
method: post
|
43
|
+
uri: https://api.chartmogul.com/v1/customers
|
44
|
+
body:
|
45
|
+
encoding: UTF-8
|
46
|
+
string: '{"external_id":"test_cus_ext_id","name":"Test Customer","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"}'
|
47
|
+
headers:
|
48
|
+
User-Agent:
|
49
|
+
- Faraday v0.15.4
|
50
|
+
Content-Type:
|
51
|
+
- application/json
|
52
|
+
Authorization:
|
53
|
+
- Basic secret
|
54
|
+
response:
|
55
|
+
status:
|
56
|
+
code: 201
|
57
|
+
message:
|
58
|
+
headers:
|
59
|
+
server:
|
60
|
+
- nginx/1.10.1
|
61
|
+
date:
|
62
|
+
- Fri, 21 Dec 2018 01:42:32 GMT
|
63
|
+
content-type:
|
64
|
+
- application/json
|
65
|
+
content-length:
|
66
|
+
- '769'
|
67
|
+
connection:
|
68
|
+
- close
|
69
|
+
status:
|
70
|
+
- 201 Created
|
71
|
+
access-control-allow-credentials:
|
72
|
+
- 'true'
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: '{"id":36881599,"uuid":"cus_af43be5c-04c1-11e9-989b-7f7327db80e7","external_id":"test_cus_ext_id","name":"Test
|
76
|
+
Customer","email":"","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998","data_source_uuids":["ds_abb65e7a-04c1-11e9-989b-c743ec986998"],"external_ids":["test_cus_ext_id"],"company":"","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/36881599-Test_Customer","billing-system-type":"Import
|
77
|
+
API","currency":"USD","currency-sign":"$"}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Fri, 21 Dec 2018 01:42:33 GMT
|
80
|
+
- request:
|
81
|
+
method: post
|
82
|
+
uri: https://api.chartmogul.com/v1/plans
|
83
|
+
body:
|
84
|
+
encoding: UTF-8
|
85
|
+
string: '{"name":"Test Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"}'
|
86
|
+
headers:
|
87
|
+
User-Agent:
|
88
|
+
- Faraday v0.15.4
|
89
|
+
Content-Type:
|
90
|
+
- application/json
|
91
|
+
Authorization:
|
92
|
+
- Basic secret
|
93
|
+
response:
|
94
|
+
status:
|
95
|
+
code: 201
|
96
|
+
message:
|
97
|
+
headers:
|
98
|
+
server:
|
99
|
+
- nginx/1.10.1
|
100
|
+
date:
|
101
|
+
- Fri, 21 Dec 2018 01:42:38 GMT
|
102
|
+
content-type:
|
103
|
+
- application/json; charset=utf-8
|
104
|
+
transfer-encoding:
|
105
|
+
- chunked
|
106
|
+
connection:
|
107
|
+
- close
|
108
|
+
status:
|
109
|
+
- 201 Created
|
110
|
+
x-frame-options:
|
111
|
+
- SAMEORIGIN
|
112
|
+
x-xss-protection:
|
113
|
+
- 1; mode=block
|
114
|
+
x-content-type-options:
|
115
|
+
- nosniff
|
116
|
+
etag:
|
117
|
+
- W/"40c9cb90213753b4579976c4164580b4"
|
118
|
+
cache-control:
|
119
|
+
- max-age=0, private, must-revalidate
|
120
|
+
x-request-id:
|
121
|
+
- 0eb6d420-ac32-47ee-b2be-123fe07cfb5e
|
122
|
+
x-runtime:
|
123
|
+
- '0.070593'
|
124
|
+
strict-transport-security:
|
125
|
+
- max-age=15768000
|
126
|
+
body:
|
127
|
+
encoding: UTF-8
|
128
|
+
string: '{"external_id":"9f66ec20-e6ef-0136-9650-0a93cf4e3017","name":"Test
|
129
|
+
Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998","uuid":"pl_9f66ec20-e6ef-0136-9650-0a93cf4e3017"}'
|
130
|
+
http_version:
|
131
|
+
recorded_at: Fri, 21 Dec 2018 01:42:38 GMT
|
132
|
+
- request:
|
133
|
+
method: post
|
134
|
+
uri: https://api.chartmogul.com/v1/plans
|
135
|
+
body:
|
136
|
+
encoding: UTF-8
|
137
|
+
string: '{"name":"Test Plan2","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"}'
|
138
|
+
headers:
|
139
|
+
User-Agent:
|
140
|
+
- Faraday v0.15.4
|
141
|
+
Content-Type:
|
142
|
+
- application/json
|
143
|
+
Authorization:
|
144
|
+
- Basic secret
|
145
|
+
response:
|
146
|
+
status:
|
147
|
+
code: 201
|
148
|
+
message:
|
149
|
+
headers:
|
150
|
+
server:
|
151
|
+
- nginx/1.10.1
|
152
|
+
date:
|
153
|
+
- Fri, 21 Dec 2018 01:42:44 GMT
|
154
|
+
content-type:
|
155
|
+
- application/json; charset=utf-8
|
156
|
+
transfer-encoding:
|
157
|
+
- chunked
|
158
|
+
connection:
|
159
|
+
- close
|
160
|
+
status:
|
161
|
+
- 201 Created
|
162
|
+
x-frame-options:
|
163
|
+
- SAMEORIGIN
|
164
|
+
x-xss-protection:
|
165
|
+
- 1; mode=block
|
166
|
+
x-content-type-options:
|
167
|
+
- nosniff
|
168
|
+
etag:
|
169
|
+
- W/"8a56e6d98bb0f542c42190cdc87b6895"
|
170
|
+
cache-control:
|
171
|
+
- max-age=0, private, must-revalidate
|
172
|
+
x-request-id:
|
173
|
+
- 79882ce2-da78-40ea-8208-9c08e111fa50
|
174
|
+
x-runtime:
|
175
|
+
- '0.087159'
|
176
|
+
strict-transport-security:
|
177
|
+
- max-age=15768000
|
178
|
+
body:
|
179
|
+
encoding: UTF-8
|
180
|
+
string: '{"external_id":"a2f18aa0-e6ef-0136-9651-0a93cf4e3017","name":"Test
|
181
|
+
Plan2","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998","uuid":"pl_a2f18aa0-e6ef-0136-9651-0a93cf4e3017"}'
|
182
|
+
http_version:
|
183
|
+
recorded_at: Fri, 21 Dec 2018 01:42:44 GMT
|
184
|
+
- request:
|
185
|
+
method: post
|
186
|
+
uri: https://api.chartmogul.com/v1/import/customers/cus_af43be5c-04c1-11e9-989b-7f7327db80e7/invoices
|
187
|
+
body:
|
188
|
+
encoding: UTF-8
|
189
|
+
string: '{"invoices":[{"date":"2016-01-01 12:00:00 UTC","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id1","service_period_start":"2016-01-01
|
190
|
+
12:00:00 UTC","service_period_end":"2016-02-01 12:00:00 UTC","amount_in_cents":1000,"plan_uuid":"pl_9f66ec20-e6ef-0136-9650-0a93cf4e3017"}],"external_id":"test_tr_inv_ext_id1"},{"date":"2016-01-01
|
191
|
+
12:00:00 UTC","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id2","service_period_start":"2016-01-01
|
192
|
+
12:00:00 UTC","service_period_end":"2016-02-01 12:00:00 UTC","amount_in_cents":1000,"plan_uuid":"pl_a2f18aa0-e6ef-0136-9651-0a93cf4e3017"}],"external_id":"test_tr_inv_ext_id2"}],"customer_uuid":"cus_af43be5c-04c1-11e9-989b-7f7327db80e7"}'
|
193
|
+
headers:
|
194
|
+
User-Agent:
|
195
|
+
- Faraday v0.15.4
|
196
|
+
Content-Type:
|
197
|
+
- application/json
|
198
|
+
Authorization:
|
199
|
+
- Basic secret
|
200
|
+
response:
|
201
|
+
status:
|
202
|
+
code: 201
|
203
|
+
message:
|
204
|
+
headers:
|
205
|
+
server:
|
206
|
+
- nginx/1.10.1
|
207
|
+
date:
|
208
|
+
- Fri, 21 Dec 2018 01:42:50 GMT
|
209
|
+
content-type:
|
210
|
+
- application/json; charset=utf-8
|
211
|
+
transfer-encoding:
|
212
|
+
- chunked
|
213
|
+
connection:
|
214
|
+
- close
|
215
|
+
x-frame-options:
|
216
|
+
- SAMEORIGIN
|
217
|
+
x-xss-protection:
|
218
|
+
- 1; mode=block
|
219
|
+
x-content-type-options:
|
220
|
+
- nosniff
|
221
|
+
etag:
|
222
|
+
- W/"820f19710f9624431a0a88b26badec9e"
|
223
|
+
cache-control:
|
224
|
+
- max-age=0, private, must-revalidate
|
225
|
+
x-request-id:
|
226
|
+
- e000572c-cb9a-4ac8-821d-28c139bbba15
|
227
|
+
x-runtime:
|
228
|
+
- '0.246535'
|
229
|
+
strict-transport-security:
|
230
|
+
- max-age=15768000
|
231
|
+
body:
|
232
|
+
encoding: UTF-8
|
233
|
+
string: '{"invoices":[{"uuid":"inv_5e58fef0-a850-44b9-b86d-0214d83a1a54","external_id":"test_tr_inv_ext_id1","date":"2016-01-01T12:00:00.000Z","due_date":null,"currency":"USD","line_items":[{"uuid":"li_e4ea894c-e295-46f0-80c1-0ac51653bf4b","external_id":null,"type":"subscription","subscription_uuid":"sub_d5f99da9-3f88-4a8e-a405-4f0dce5136f4","subscription_external_id":"test_cus_sub_ext_id1","prorated":false,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","amount_in_cents":1000,"quantity":1,"plan_uuid":"pl_9f66ec20-e6ef-0136-9650-0a93cf4e3017","discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":""}],"transactions":[]},{"uuid":"inv_75207f91-335b-48fc-9342-0dc166f972df","external_id":"test_tr_inv_ext_id2","date":"2016-01-01T12:00:00.000Z","due_date":null,"currency":"USD","line_items":[{"uuid":"li_d290b329-e83d-4dd6-a6e0-1791c478fc8f","external_id":null,"type":"subscription","subscription_uuid":"sub_e6b75c82-258c-4160-bcf3-7cbbdfc61bdb","subscription_external_id":"test_cus_sub_ext_id2","prorated":false,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","amount_in_cents":1000,"quantity":1,"plan_uuid":"pl_a2f18aa0-e6ef-0136-9651-0a93cf4e3017","discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":""}],"transactions":[]}]}'
|
234
|
+
http_version:
|
235
|
+
recorded_at: Fri, 21 Dec 2018 01:42:51 GMT
|
236
|
+
- request:
|
237
|
+
method: get
|
238
|
+
uri: https://api.chartmogul.com/v1/import/customers/cus_af43be5c-04c1-11e9-989b-7f7327db80e7/subscriptions
|
239
|
+
body:
|
240
|
+
encoding: US-ASCII
|
241
|
+
string: ''
|
242
|
+
headers:
|
243
|
+
User-Agent:
|
244
|
+
- Faraday v0.15.4
|
245
|
+
Content-Type:
|
246
|
+
- application/json
|
247
|
+
Authorization:
|
248
|
+
- Basic secret
|
249
|
+
response:
|
250
|
+
status:
|
251
|
+
code: 200
|
252
|
+
message:
|
253
|
+
headers:
|
254
|
+
server:
|
255
|
+
- nginx/1.10.1
|
256
|
+
date:
|
257
|
+
- Fri, 21 Dec 2018 01:42:56 GMT
|
258
|
+
content-type:
|
259
|
+
- application/json; charset=utf-8
|
260
|
+
transfer-encoding:
|
261
|
+
- chunked
|
262
|
+
connection:
|
263
|
+
- close
|
264
|
+
vary:
|
265
|
+
- Accept-Encoding, Accept-Encoding
|
266
|
+
x-frame-options:
|
267
|
+
- SAMEORIGIN
|
268
|
+
x-xss-protection:
|
269
|
+
- 1; mode=block
|
270
|
+
x-content-type-options:
|
271
|
+
- nosniff
|
272
|
+
etag:
|
273
|
+
- W/"89bd938d693589f8f05b17b1319effcd"
|
274
|
+
cache-control:
|
275
|
+
- max-age=0, private, must-revalidate
|
276
|
+
x-request-id:
|
277
|
+
- 1ab2bf60-091c-4036-8ea9-8ce78250602e
|
278
|
+
x-runtime:
|
279
|
+
- '0.063054'
|
280
|
+
strict-transport-security:
|
281
|
+
- max-age=15768000
|
282
|
+
body:
|
283
|
+
encoding: ASCII-8BIT
|
284
|
+
string: '{"customer_uuid":"cus_af43be5c-04c1-11e9-989b-7f7327db80e7","subscriptions":[{"uuid":"sub_e6b75c82-258c-4160-bcf3-7cbbdfc61bdb","external_id":"test_cus_sub_ext_id2","cancellation_dates":[],"plan_uuid":"pl_a2f18aa0-e6ef-0136-9651-0a93cf4e3017","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"},{"uuid":"sub_d5f99da9-3f88-4a8e-a405-4f0dce5136f4","external_id":"test_cus_sub_ext_id1","cancellation_dates":[],"plan_uuid":"pl_9f66ec20-e6ef-0136-9650-0a93cf4e3017","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"}],"current_page":1,"total_pages":1}'
|
285
|
+
http_version:
|
286
|
+
recorded_at: Fri, 21 Dec 2018 01:42:56 GMT
|
287
|
+
- request:
|
288
|
+
method: patch
|
289
|
+
uri: https://api.chartmogul.com/v1/import/subscriptions/sub_e6b75c82-258c-4160-bcf3-7cbbdfc61bdb
|
290
|
+
body:
|
291
|
+
encoding: UTF-8
|
292
|
+
string: '{"cancelled_at":"2016-01-15 12:00:00 UTC"}'
|
293
|
+
headers:
|
294
|
+
User-Agent:
|
295
|
+
- Faraday v0.15.4
|
296
|
+
Content-Type:
|
297
|
+
- application/json
|
298
|
+
Authorization:
|
299
|
+
- Basic secret
|
300
|
+
response:
|
301
|
+
status:
|
302
|
+
code: 202
|
303
|
+
message:
|
304
|
+
headers:
|
305
|
+
server:
|
306
|
+
- nginx/1.10.1
|
307
|
+
date:
|
308
|
+
- Fri, 21 Dec 2018 01:43:02 GMT
|
309
|
+
content-type:
|
310
|
+
- application/json; charset=utf-8
|
311
|
+
transfer-encoding:
|
312
|
+
- chunked
|
313
|
+
connection:
|
314
|
+
- close
|
315
|
+
x-frame-options:
|
316
|
+
- SAMEORIGIN
|
317
|
+
x-xss-protection:
|
318
|
+
- 1; mode=block
|
319
|
+
x-content-type-options:
|
320
|
+
- nosniff
|
321
|
+
cache-control:
|
322
|
+
- no-cache
|
323
|
+
x-request-id:
|
324
|
+
- a4e36900-6664-4315-a115-c40371b81ea4
|
325
|
+
x-runtime:
|
326
|
+
- '0.109018'
|
327
|
+
body:
|
328
|
+
encoding: UTF-8
|
329
|
+
string: '{"uuid":"sub_e6b75c82-258c-4160-bcf3-7cbbdfc61bdb","external_id":"test_cus_sub_ext_id2","cancellation_dates":["2016-01-15T12:00:00.000Z"],"customer_uuid":"cus_af43be5c-04c1-11e9-989b-7f7327db80e7","plan_uuid":"pl_a2f18aa0-e6ef-0136-9651-0a93cf4e3017","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"}'
|
330
|
+
http_version:
|
331
|
+
recorded_at: Fri, 21 Dec 2018 01:43:02 GMT
|
332
|
+
- request:
|
333
|
+
method: post
|
334
|
+
uri: https://api.chartmogul.com/v1/customers/cus_af43be5c-04c1-11e9-989b-7f7327db80e7/connect_subscriptions
|
335
|
+
body:
|
336
|
+
encoding: UTF-8
|
337
|
+
string: '{"subscriptions":[{"external_id":"test_cus_sub_ext_id2","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"},{"external_id":"test_cus_sub_ext_id1","data_source_uuid":"ds_abb65e7a-04c1-11e9-989b-c743ec986998"}]}'
|
338
|
+
headers:
|
339
|
+
User-Agent:
|
340
|
+
- Faraday v0.15.4
|
341
|
+
Content-Type:
|
342
|
+
- application/json
|
343
|
+
Authorization:
|
344
|
+
- Basic secret
|
345
|
+
response:
|
346
|
+
status:
|
347
|
+
code: 202
|
348
|
+
message:
|
349
|
+
headers:
|
350
|
+
server:
|
351
|
+
- nginx/1.10.1
|
352
|
+
date:
|
353
|
+
- Fri, 21 Dec 2018 01:43:10 GMT
|
354
|
+
content-type:
|
355
|
+
- application/json
|
356
|
+
content-length:
|
357
|
+
- '2'
|
358
|
+
connection:
|
359
|
+
- close
|
360
|
+
status:
|
361
|
+
- 202 Accepted
|
362
|
+
body:
|
363
|
+
encoding: UTF-8
|
364
|
+
string: "{}"
|
365
|
+
http_version:
|
366
|
+
recorded_at: Fri, 21 Dec 2018 01:43:10 GMT
|
367
|
+
- request:
|
368
|
+
method: get
|
369
|
+
uri: https://api.chartmogul.com/v1/customers/cus_af43be5c-04c1-11e9-989b-7f7327db80e7/subscriptions
|
370
|
+
body:
|
371
|
+
encoding: US-ASCII
|
372
|
+
string: ''
|
373
|
+
headers:
|
374
|
+
User-Agent:
|
375
|
+
- Faraday v0.15.4
|
376
|
+
Content-Type:
|
377
|
+
- application/json
|
378
|
+
Authorization:
|
379
|
+
- Basic secret
|
380
|
+
response:
|
381
|
+
status:
|
382
|
+
code: 200
|
383
|
+
message:
|
384
|
+
headers:
|
385
|
+
server:
|
386
|
+
- nginx/1.10.1
|
387
|
+
date:
|
388
|
+
- Fri, 21 Dec 2018 01:44:16 GMT
|
389
|
+
content-type:
|
390
|
+
- application/json
|
391
|
+
content-length:
|
392
|
+
- '344'
|
393
|
+
connection:
|
394
|
+
- close
|
395
|
+
status:
|
396
|
+
- 200 OK
|
397
|
+
access-control-allow-credentials:
|
398
|
+
- 'true'
|
399
|
+
body:
|
400
|
+
encoding: UTF-8
|
401
|
+
string: '{"entries":[{"id":32639332,"external_id":"test_cus_sub_ext_id1","quantity":1,"mrr":4348,"arr":52176,"status":"active","plan":"Test
|
402
|
+
Plan1","billing-cycle":"day","billing-cycle-count":7,"start-date":"2016-01-01T12:00:00+00:00","end-date":"2016-02-01T12:00:00+00:00","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":200,"page":1}'
|
403
|
+
http_version:
|
404
|
+
recorded_at: Fri, 21 Dec 2018 01:44:16 GMT
|
405
|
+
- request:
|
406
|
+
method: delete
|
407
|
+
uri: https://api.chartmogul.com/v1/data_sources/ds_abb65e7a-04c1-11e9-989b-c743ec986998
|
408
|
+
body:
|
409
|
+
encoding: US-ASCII
|
410
|
+
string: ''
|
411
|
+
headers:
|
412
|
+
User-Agent:
|
413
|
+
- Faraday v0.15.4
|
414
|
+
Authorization:
|
415
|
+
- Basic secret
|
416
|
+
response:
|
417
|
+
status:
|
418
|
+
code: 204
|
419
|
+
message:
|
420
|
+
headers:
|
421
|
+
server:
|
422
|
+
- nginx/1.10.1
|
423
|
+
date:
|
424
|
+
- Fri, 21 Dec 2018 01:44:22 GMT
|
425
|
+
connection:
|
426
|
+
- close
|
427
|
+
status:
|
428
|
+
- 204 No Content
|
429
|
+
access-control-allow-credentials:
|
430
|
+
- 'true'
|
431
|
+
body:
|
432
|
+
encoding: UTF-8
|
433
|
+
string: ''
|
434
|
+
http_version:
|
435
|
+
recorded_at: Fri, 21 Dec 2018 01:44:22 GMT
|
436
|
+
recorded_with: VCR 3.0.3
|
@@ -4,11 +4,12 @@ module ChartMogul
|
|
4
4
|
set_resource_path '/v1/import/customers/:customer_uuid/subscriptions'
|
5
5
|
|
6
6
|
readonly_attr :uuid
|
7
|
-
|
7
|
+
writeable_attr :external_id
|
8
8
|
readonly_attr :cancellation_dates, default: []
|
9
9
|
|
10
10
|
readonly_attr :plan_uuid
|
11
|
-
|
11
|
+
writeable_attr :data_source_uuid
|
12
|
+
readonly_attr :customer_uuid
|
12
13
|
|
13
14
|
include API::Actions::Custom
|
14
15
|
|
@@ -22,6 +23,11 @@ module ChartMogul
|
|
22
23
|
custom!(:patch, "/v1/import/subscriptions/#{uuid}", cancelled_at: cancelled_at)
|
23
24
|
end
|
24
25
|
|
26
|
+
def connect(customer_uuid, subscriptions)
|
27
|
+
subscriptions.unshift(self)
|
28
|
+
custom!(:post, "/v1/customers/#{customer_uuid}/connect_subscriptions", subscriptions: subscriptions.map(&:serialize_for_write))
|
29
|
+
end
|
30
|
+
|
25
31
|
def self.all(customer_uuid, options = {})
|
26
32
|
Subscriptions.all(customer_uuid, options)
|
27
33
|
end
|
data/lib/chartmogul/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chartmogul-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Langenauer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml
|
189
189
|
- fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml
|
190
190
|
- fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml
|
191
|
+
- fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml
|
191
192
|
- fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml
|
192
193
|
- fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml
|
193
194
|
- fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml
|
@@ -262,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
263
|
version: '0'
|
263
264
|
requirements: []
|
264
265
|
rubyforge_project:
|
265
|
-
rubygems_version: 2.
|
266
|
+
rubygems_version: 2.5.2
|
266
267
|
signing_key:
|
267
268
|
specification_version: 4
|
268
269
|
summary: Chartmogul API Ruby Client
|