chartmogul-ruby 1.2.2 → 1.3.0

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
  SHA1:
3
- metadata.gz: 429f1848cad731536e10e6cb18405ded2b3204f3
4
- data.tar.gz: b81939c53b835021ecfdc36182fa77d56f3f41c1
3
+ metadata.gz: bb69d34374a3e296f5849a6e2b142d7bfd8ab63b
4
+ data.tar.gz: 6756b04e3689169432b05640c1e98e24f04e248d
5
5
  SHA512:
6
- metadata.gz: de0ed3cd12c57e8cd64333b2ba1dacf6929b141951ef42ba9d4e3bb9861b48c9bcbfa9542c47a1fe032cae957aa2c1c9817c0869c47805655f602adc0f6a2ffd
7
- data.tar.gz: 2d24f1deea02bc3ba25adafccaedc1c9c44e96e3a6626b56e7c02c0ff241570be32c5747c650ea1719df33c4213970aac81aac9677c7033cb05fea19eb696c8b
6
+ metadata.gz: ac0364c3b42ca055eb191974ca592e1395be7a91eb2949dde133dc604f158b6623761f432701bf1b7757d8875648587ecca928e85dc7b03ebe6ff533ba93498b
7
+ data.tar.gz: '09844cdef8e2d696f0d5311a175fbc2cd796da195a045bf9e88f68c54d28bc61b262fcb81453acfa257df8cf54d3cf73779a4dd78e30fa46db06cf51a012e3d5'
@@ -1,9 +1,18 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
3
+ - 2.3
4
+ - 2.4
4
5
 
5
6
  before_install: gem install bundler
6
7
 
8
+ before_script:
9
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
10
+ - chmod +x ./cc-test-reporter
11
+ - ./cc-test-reporter before-build
12
+
7
13
  branches:
8
14
  only:
9
15
  - master
16
+
17
+ after_script:
18
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/README.md CHANGED
@@ -30,7 +30,6 @@
30
30
  <hr>
31
31
  <br>
32
32
 
33
-
34
33
  ## Installation
35
34
 
36
35
  Add this line to your application's Gemfile:
@@ -47,6 +46,9 @@ Or install it yourself as:
47
46
 
48
47
  $ gem install chartmogul-ruby
49
48
 
49
+ ### Supported Ruby Versions
50
+ This gem supports Ruby 2.3 and 2.4.
51
+
50
52
  ## Configuration
51
53
 
52
54
  Configure `chartmogul-ruby` with your Account Token and Secret Key, available from the administration section of your ChartMogul account.
@@ -22,10 +22,11 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency 'faraday', '~> 0.15.0'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.11'
25
+ spec.add_development_dependency 'bundler', '~> 2.0.1'
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'vcr', '~> 3.0'
29
29
  spec.add_development_dependency 'pry', '~> 0.10.3'
30
30
  spec.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.2'
31
+ spec.add_development_dependency 'simplecov', '~> 0.16.0'
31
32
  end
@@ -0,0 +1,138 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/customers?external_id=test_cus_ext_id
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic Hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Mon, 04 Mar 2019 15:04:12 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '889'
29
+ connection:
30
+ - keep-alive
31
+ status:
32
+ - 200 OK
33
+ access-control-allow-credentials:
34
+ - 'true'
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"entries":[{"id":22661127,"uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","external_id":"test_cus_ext_id","name":"Test
38
+ Customer","email":"","status":"Active","customer-since":"2016-01-01T12:00:00+00:00","attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47","data_source_uuids":["ds_99d06d30-3e6f-11e9-b645-837bf5404a47"],"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":4348,"arr":52176,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/22661127-Test_Customer","billing-system-type":"Import
39
+ API","currency":"USD","currency-sign":"$"}],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}'
40
+ http_version:
41
+ recorded_at: Mon, 04 Mar 2019 15:04:12 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api.chartmogul.com/v1/import/customers/cus_b289bb4c-3e6f-11e9-b645-6369759fc9da/subscriptions
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers:
49
+ User-Agent:
50
+ - Faraday v0.15.4
51
+ Content-Type:
52
+ - application/json
53
+ Authorization:
54
+ - Basic Hidden
55
+ response:
56
+ status:
57
+ code: 200
58
+ message:
59
+ headers:
60
+ server:
61
+ - nginx/1.10.1
62
+ date:
63
+ - Mon, 04 Mar 2019 15:04:12 GMT
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ transfer-encoding:
67
+ - chunked
68
+ connection:
69
+ - keep-alive
70
+ vary:
71
+ - Accept-Encoding, Accept-Encoding
72
+ x-frame-options:
73
+ - SAMEORIGIN
74
+ x-xss-protection:
75
+ - 1; mode=block
76
+ x-content-type-options:
77
+ - nosniff
78
+ etag:
79
+ - W/"326d93dd0e74d25754ea1611dc13afb0"
80
+ cache-control:
81
+ - max-age=0, private, must-revalidate
82
+ x-request-id:
83
+ - ce3e2ca1-ac44-4e83-bad3-4418d5b9f99d
84
+ x-runtime:
85
+ - '0.062006'
86
+ strict-transport-security:
87
+ - max-age=15768000
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: '{"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","subscriptions":[{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":[],"plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}],"current_page":1,"total_pages":1}'
91
+ http_version:
92
+ recorded_at: Mon, 04 Mar 2019 15:04:12 GMT
93
+ - request:
94
+ method: patch
95
+ uri: https://api.chartmogul.com/v1/import/subscriptions/sub_c2c97897-f0a0-4448-a035-043d7a19b845
96
+ body:
97
+ encoding: UTF-8
98
+ string: '{"cancellation_dates":["2000-01-01 00:00:00 UTC"]}'
99
+ headers:
100
+ User-Agent:
101
+ - Faraday v0.15.4
102
+ Content-Type:
103
+ - application/json
104
+ Authorization:
105
+ - Basic Hidden
106
+ response:
107
+ status:
108
+ code: 202
109
+ message:
110
+ headers:
111
+ server:
112
+ - nginx/1.10.1
113
+ date:
114
+ - Mon, 04 Mar 2019 15:04:13 GMT
115
+ content-type:
116
+ - application/json; charset=utf-8
117
+ transfer-encoding:
118
+ - chunked
119
+ connection:
120
+ - keep-alive
121
+ x-frame-options:
122
+ - SAMEORIGIN
123
+ x-xss-protection:
124
+ - 1; mode=block
125
+ x-content-type-options:
126
+ - nosniff
127
+ cache-control:
128
+ - no-cache
129
+ x-request-id:
130
+ - d65b3ecf-9fbb-4c4b-b213-cdf17415cbc4
131
+ x-runtime:
132
+ - '0.125522'
133
+ body:
134
+ encoding: UTF-8
135
+ string: '{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":["2000-01-01T00:00:00.000Z"],"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}'
136
+ http_version:
137
+ recorded_at: Mon, 04 Mar 2019 15:04:13 GMT
138
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,93 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/customers?external_id=test_cus_ext_id
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic Hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Mon, 04 Mar 2019 12:51:15 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '889'
29
+ connection:
30
+ - keep-alive
31
+ status:
32
+ - 200 OK
33
+ access-control-allow-credentials:
34
+ - 'true'
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"entries":[{"id":22661127,"uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","external_id":"test_cus_ext_id","name":"Test
38
+ Customer","email":"","status":"Active","customer-since":"2016-01-01T12:00:00+00:00","attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47","data_source_uuids":["ds_99d06d30-3e6f-11e9-b645-837bf5404a47"],"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":4348,"arr":52176,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/22661127-Test_Customer","billing-system-type":"Import
39
+ API","currency":"USD","currency-sign":"$"}],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}'
40
+ http_version:
41
+ recorded_at: Mon, 04 Mar 2019 12:51:15 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api.chartmogul.com/v1/import/customers/cus_b289bb4c-3e6f-11e9-b645-6369759fc9da/subscriptions
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers:
49
+ User-Agent:
50
+ - Faraday v0.15.4
51
+ Content-Type:
52
+ - application/json
53
+ Authorization:
54
+ - Basic Hidden
55
+ response:
56
+ status:
57
+ code: 200
58
+ message:
59
+ headers:
60
+ server:
61
+ - nginx/1.10.1
62
+ date:
63
+ - Mon, 04 Mar 2019 12:51:16 GMT
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ transfer-encoding:
67
+ - chunked
68
+ connection:
69
+ - keep-alive
70
+ vary:
71
+ - Accept-Encoding, Accept-Encoding
72
+ x-frame-options:
73
+ - SAMEORIGIN
74
+ x-xss-protection:
75
+ - 1; mode=block
76
+ x-content-type-options:
77
+ - nosniff
78
+ etag:
79
+ - W/"254e64ffb96f23cc2f16356dbd4e8051"
80
+ cache-control:
81
+ - max-age=0, private, must-revalidate
82
+ x-request-id:
83
+ - 8335a8c6-0279-479b-ba1d-c5be1d1bf9d4
84
+ x-runtime:
85
+ - '0.057060'
86
+ strict-transport-security:
87
+ - max-age=15768000
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: '{"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","subscriptions":[{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":["1999-12-31T22:00:00.000Z"],"plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}],"current_page":1,"total_pages":1}'
91
+ http_version:
92
+ recorded_at: Mon, 04 Mar 2019 12:51:16 GMT
93
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,138 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/customers?external_id=test_cus_ext_id
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic Hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Mon, 04 Mar 2019 12:51:16 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '889'
29
+ connection:
30
+ - keep-alive
31
+ status:
32
+ - 200 OK
33
+ access-control-allow-credentials:
34
+ - 'true'
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"entries":[{"id":22661127,"uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","external_id":"test_cus_ext_id","name":"Test
38
+ Customer","email":"","status":"Active","customer-since":"2016-01-01T12:00:00+00:00","attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47","data_source_uuids":["ds_99d06d30-3e6f-11e9-b645-837bf5404a47"],"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":4348,"arr":52176,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/22661127-Test_Customer","billing-system-type":"Import
39
+ API","currency":"USD","currency-sign":"$"}],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}'
40
+ http_version:
41
+ recorded_at: Mon, 04 Mar 2019 12:51:16 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api.chartmogul.com/v1/import/customers/cus_b289bb4c-3e6f-11e9-b645-6369759fc9da/subscriptions
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers:
49
+ User-Agent:
50
+ - Faraday v0.15.4
51
+ Content-Type:
52
+ - application/json
53
+ Authorization:
54
+ - Basic Hidden
55
+ response:
56
+ status:
57
+ code: 200
58
+ message:
59
+ headers:
60
+ server:
61
+ - nginx/1.10.1
62
+ date:
63
+ - Mon, 04 Mar 2019 12:51:17 GMT
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ transfer-encoding:
67
+ - chunked
68
+ connection:
69
+ - keep-alive
70
+ vary:
71
+ - Accept-Encoding, Accept-Encoding
72
+ x-frame-options:
73
+ - SAMEORIGIN
74
+ x-xss-protection:
75
+ - 1; mode=block
76
+ x-content-type-options:
77
+ - nosniff
78
+ etag:
79
+ - W/"254e64ffb96f23cc2f16356dbd4e8051"
80
+ cache-control:
81
+ - max-age=0, private, must-revalidate
82
+ x-request-id:
83
+ - '08593034-b32b-4941-aaf0-6fc712762a81'
84
+ x-runtime:
85
+ - '0.070115'
86
+ strict-transport-security:
87
+ - max-age=15768000
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: '{"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","subscriptions":[{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":["1999-12-31T22:00:00.000Z"],"plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}],"current_page":1,"total_pages":1}'
91
+ http_version:
92
+ recorded_at: Mon, 04 Mar 2019 12:51:17 GMT
93
+ - request:
94
+ method: patch
95
+ uri: https://api.chartmogul.com/v1/import/subscriptions/sub_c2c97897-f0a0-4448-a035-043d7a19b845
96
+ body:
97
+ encoding: UTF-8
98
+ string: '{"cancellation_dates":["2000-01-01 00:00:00 +0200"]}'
99
+ headers:
100
+ User-Agent:
101
+ - Faraday v0.15.4
102
+ Content-Type:
103
+ - application/json
104
+ Authorization:
105
+ - Basic Mjk5ZjAyMjYzMDRkNThhNWZiYzFlNTcwOTdlZGU3Mjk6OWM4NWIwNGFkN2FjNzE2NTUwYTY1NjZhZWYwYzM5ZmU=
106
+ response:
107
+ status:
108
+ code: 202
109
+ message:
110
+ headers:
111
+ server:
112
+ - nginx/1.10.1
113
+ date:
114
+ - Mon, 04 Mar 2019 12:51:17 GMT
115
+ content-type:
116
+ - application/json; charset=utf-8
117
+ transfer-encoding:
118
+ - chunked
119
+ connection:
120
+ - keep-alive
121
+ x-frame-options:
122
+ - SAMEORIGIN
123
+ x-xss-protection:
124
+ - 1; mode=block
125
+ x-content-type-options:
126
+ - nosniff
127
+ cache-control:
128
+ - no-cache
129
+ x-request-id:
130
+ - 737a7d3a-bac8-4cdc-8d8f-15056faab094
131
+ x-runtime:
132
+ - '0.127860'
133
+ body:
134
+ encoding: UTF-8
135
+ string: '{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":["1999-12-31T22:00:00.000Z"],"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}'
136
+ http_version:
137
+ recorded_at: Mon, 04 Mar 2019 12:51:17 GMT
138
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,138 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/customers?external_id=test_cus_ext_id
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic Hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Mon, 04 Mar 2019 12:51:17 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '889'
29
+ connection:
30
+ - keep-alive
31
+ status:
32
+ - 200 OK
33
+ access-control-allow-credentials:
34
+ - 'true'
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"entries":[{"id":22661127,"uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","external_id":"test_cus_ext_id","name":"Test
38
+ Customer","email":"","status":"Active","customer-since":"2016-01-01T12:00:00+00:00","attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47","data_source_uuids":["ds_99d06d30-3e6f-11e9-b645-837bf5404a47"],"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":4348,"arr":52176,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/22661127-Test_Customer","billing-system-type":"Import
39
+ API","currency":"USD","currency-sign":"$"}],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}'
40
+ http_version:
41
+ recorded_at: Mon, 04 Mar 2019 12:51:17 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api.chartmogul.com/v1/import/customers/cus_b289bb4c-3e6f-11e9-b645-6369759fc9da/subscriptions
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers:
49
+ User-Agent:
50
+ - Faraday v0.15.4
51
+ Content-Type:
52
+ - application/json
53
+ Authorization:
54
+ - Basic Hidden
55
+ response:
56
+ status:
57
+ code: 200
58
+ message:
59
+ headers:
60
+ server:
61
+ - nginx/1.10.1
62
+ date:
63
+ - Mon, 04 Mar 2019 12:51:18 GMT
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ transfer-encoding:
67
+ - chunked
68
+ connection:
69
+ - keep-alive
70
+ vary:
71
+ - Accept-Encoding, Accept-Encoding
72
+ x-frame-options:
73
+ - SAMEORIGIN
74
+ x-xss-protection:
75
+ - 1; mode=block
76
+ x-content-type-options:
77
+ - nosniff
78
+ etag:
79
+ - W/"254e64ffb96f23cc2f16356dbd4e8051"
80
+ cache-control:
81
+ - max-age=0, private, must-revalidate
82
+ x-request-id:
83
+ - feb37862-a362-4a35-898b-58677e08f554
84
+ x-runtime:
85
+ - '0.061015'
86
+ strict-transport-security:
87
+ - max-age=15768000
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: '{"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","subscriptions":[{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":["1999-12-31T22:00:00.000Z"],"plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}],"current_page":1,"total_pages":1}'
91
+ http_version:
92
+ recorded_at: Mon, 04 Mar 2019 12:51:18 GMT
93
+ - request:
94
+ method: patch
95
+ uri: https://api.chartmogul.com/v1/import/subscriptions/sub_c2c97897-f0a0-4448-a035-043d7a19b845
96
+ body:
97
+ encoding: UTF-8
98
+ string: '{"cancellation_dates":[]}'
99
+ headers:
100
+ User-Agent:
101
+ - Faraday v0.15.4
102
+ Content-Type:
103
+ - application/json
104
+ Authorization:
105
+ - Basic Mjk5ZjAyMjYzMDRkNThhNWZiYzFlNTcwOTdlZGU3Mjk6OWM4NWIwNGFkN2FjNzE2NTUwYTY1NjZhZWYwYzM5ZmU=
106
+ response:
107
+ status:
108
+ code: 202
109
+ message:
110
+ headers:
111
+ server:
112
+ - nginx/1.10.1
113
+ date:
114
+ - Mon, 04 Mar 2019 12:51:18 GMT
115
+ content-type:
116
+ - application/json; charset=utf-8
117
+ transfer-encoding:
118
+ - chunked
119
+ connection:
120
+ - keep-alive
121
+ x-frame-options:
122
+ - SAMEORIGIN
123
+ x-xss-protection:
124
+ - 1; mode=block
125
+ x-content-type-options:
126
+ - nosniff
127
+ cache-control:
128
+ - no-cache
129
+ x-request-id:
130
+ - 76ef1912-9ef8-4bc7-b56f-4e09e230be06
131
+ x-runtime:
132
+ - '0.135980'
133
+ body:
134
+ encoding: UTF-8
135
+ string: '{"uuid":"sub_c2c97897-f0a0-4448-a035-043d7a19b845","external_id":"test_cus_sub_ext_id","cancellation_dates":[],"customer_uuid":"cus_b289bb4c-3e6f-11e9-b645-6369759fc9da","plan_uuid":"pl_933aefe0-209d-0137-2188-040113b1c101","data_source_uuid":"ds_99d06d30-3e6f-11e9-b645-837bf5404a47"}'
136
+ http_version:
137
+ recorded_at: Mon, 04 Mar 2019 12:51:18 GMT
138
+ recorded_with: VCR 3.0.3
@@ -13,10 +13,9 @@ module ChartMogul
13
13
 
14
14
  include API::Actions::Custom
15
15
 
16
- def set_cancellation_dates(cancellation_dates_array)
17
- @cancellation_dates = cancellation_dates_array.map do |cancellation_date|
18
- Time.parse(cancellation_date)
19
- end
16
+ def update_cancellation_dates(cancellation_dates_array)
17
+ cancellation_dates = parse_dates(cancellation_dates_array)
18
+ custom!(:patch, "/v1/import/subscriptions/#{uuid}", cancellation_dates: cancellation_dates)
20
19
  end
21
20
 
22
21
  def cancel(cancelled_at)
@@ -31,6 +30,16 @@ module ChartMogul
31
30
  def self.all(customer_uuid, options = {})
32
31
  Subscriptions.all(customer_uuid, options)
33
32
  end
33
+
34
+ private
35
+
36
+ def set_cancellation_dates(cancellation_dates_array)
37
+ @cancellation_dates = parse_dates(cancellation_dates_array)
38
+ end
39
+
40
+ def parse_dates(dates)
41
+ dates.map { |date| Time.parse(date.to_s) }
42
+ end
34
43
  end
35
44
 
36
45
  class Subscriptions < APIResource
@@ -1,3 +1,3 @@
1
1
  module ChartMogul
2
- VERSION = '1.2.2'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # put in .git/hooks/
3
+ set -e
4
+
5
+ bundle exec rspec
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.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Langenauer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.11'
33
+ version: 2.0.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.11'
40
+ version: 2.0.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,6 +114,20 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: 3.4.2
117
+ - !ruby/object:Gem::Dependency
118
+ name: simplecov
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: 0.16.0
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: 0.16.0
117
131
  description: Official Ruby client for ChartMogul's API
118
132
  email:
119
133
  - jason@chartmogul.com
@@ -191,6 +205,10 @@ files:
191
205
  - fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml
192
206
  - fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml
193
207
  - fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml
208
+ - fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_has_time_objects/is_setting_the_cancellation_dates_of_the_subscription.yml
209
+ - fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_invalid_entries/raises_an_exception.yml
210
+ - fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_valid_entries/is_setting_the_cancellation_dates_of_the_subscription.yml
211
+ - fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_is_empty/makes_an_API_call_and_removes_the_cancellation_dates.yml
194
212
  - fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml
195
213
  - lib/chartmogul.rb
196
214
  - lib/chartmogul/api/actions/all.rb
@@ -243,6 +261,7 @@ files:
243
261
  - lib/chartmogul/utils/hash_snake_caser.rb
244
262
  - lib/chartmogul/utils/json_parser.rb
245
263
  - lib/chartmogul/version.rb
264
+ - pre-commit.example
246
265
  homepage: https://github.com/chartmogul/chartmogul-ruby
247
266
  licenses:
248
267
  - MIT