chartmogul-ruby 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +82 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/changelog.md +8 -0
- data/chartmogul-ruby.gemspec +29 -0
- data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -0
- data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -0
- data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_custom_attributes.yml +80 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_required_tags.yml +79 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_404_if_no_customers_found.yml +38 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_custom_attributes.yml +80 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_tags.yml +80 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml +47 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml +43 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/updates_custom_attributes.yml +82 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_handles_a_422_response.yml +50 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_interracts_with_the_API.yml +240 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +298 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_handles_a_422_error.yml +51 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_interracts_with_the_API.yml +152 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Subscription/API_Interactions/correctly_interracts_with_the_API.yml +340 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml +243 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_Pageable/should_be_pageable.yml +41 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml +41 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml +40 -0
- data/lib/chartmogul.rb +77 -0
- data/lib/chartmogul/api/actions/all.rb +28 -0
- data/lib/chartmogul/api/actions/create.rb +39 -0
- data/lib/chartmogul/api/actions/custom.rb +42 -0
- data/lib/chartmogul/api/actions/destroy.rb +14 -0
- data/lib/chartmogul/api/actions/update.rb +19 -0
- data/lib/chartmogul/api_resource.rb +57 -0
- data/lib/chartmogul/concerns/entries.rb +37 -0
- data/lib/chartmogul/concerns/pageable.rb +14 -0
- data/lib/chartmogul/concerns/summary.rb +20 -0
- data/lib/chartmogul/config_attributes.rb +15 -0
- data/lib/chartmogul/configuration.rb +6 -0
- data/lib/chartmogul/enrichment/customer.rb +114 -0
- data/lib/chartmogul/errors/chartmogul_error.rb +19 -0
- data/lib/chartmogul/errors/configuration_error.rb +4 -0
- data/lib/chartmogul/errors/forbidden_error.rb +4 -0
- data/lib/chartmogul/errors/not_found_error.rb +4 -0
- data/lib/chartmogul/errors/resource_invalid_error.rb +4 -0
- data/lib/chartmogul/errors/schema_invalid_error.rb +4 -0
- data/lib/chartmogul/import/customer.rb +38 -0
- data/lib/chartmogul/import/customer_invoices.rb +40 -0
- data/lib/chartmogul/import/data_source.rb +19 -0
- data/lib/chartmogul/import/invoice.rb +64 -0
- data/lib/chartmogul/import/line_items/one_time.rb +25 -0
- data/lib/chartmogul/import/line_items/subscription.rb +31 -0
- data/lib/chartmogul/import/plan.rb +21 -0
- data/lib/chartmogul/import/subscription.rb +30 -0
- data/lib/chartmogul/import/transactions/payment.rb +26 -0
- data/lib/chartmogul/import/transactions/refund.rb +26 -0
- data/lib/chartmogul/metrics/activity.rb +32 -0
- data/lib/chartmogul/metrics/all_key_metrics.rb +25 -0
- data/lib/chartmogul/metrics/arpa.rb +19 -0
- data/lib/chartmogul/metrics/arr.rb +19 -0
- data/lib/chartmogul/metrics/asp.rb +19 -0
- data/lib/chartmogul/metrics/base.rb +56 -0
- data/lib/chartmogul/metrics/customer_churn_rate.rb +19 -0
- data/lib/chartmogul/metrics/customer_count.rb +19 -0
- data/lib/chartmogul/metrics/ltv.rb +19 -0
- data/lib/chartmogul/metrics/mrr.rb +26 -0
- data/lib/chartmogul/metrics/mrr_churn_rate.rb +19 -0
- data/lib/chartmogul/metrics/subscription.rb +35 -0
- data/lib/chartmogul/object.rb +119 -0
- data/lib/chartmogul/resource_path.rb +42 -0
- data/lib/chartmogul/summary.rb +7 -0
- data/lib/chartmogul/utils/hash_snake_caser.rb +50 -0
- data/lib/chartmogul/utils/json_parser.rb +11 -0
- data/lib/chartmogul/version.rb +3 -0
- metadata +232 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://api.chartmogul.com/v1/import/data_sources/1234-a-uuid-that-doesnt-exist
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Authorization:
|
13
|
+
- Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 404
|
17
|
+
message:
|
18
|
+
headers:
|
19
|
+
server:
|
20
|
+
- nginx/1.9.10
|
21
|
+
date:
|
22
|
+
- Sun, 05 Jun 2016 17:05:01 GMT
|
23
|
+
content-type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
transfer-encoding:
|
26
|
+
- chunked
|
27
|
+
connection:
|
28
|
+
- close
|
29
|
+
x-frame-options:
|
30
|
+
- SAMEORIGIN
|
31
|
+
x-xss-protection:
|
32
|
+
- 1; mode=block
|
33
|
+
x-content-type-options:
|
34
|
+
- nosniff
|
35
|
+
cache-control:
|
36
|
+
- no-cache
|
37
|
+
x-request-id:
|
38
|
+
- f12d6c48-58f5-4ccd-b398-ff4e7acb93bc
|
39
|
+
x-runtime:
|
40
|
+
- '0.010826'
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"error":"Data source not found"}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Sun, 05 Jun 2016 17:05:01 GMT
|
46
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.chartmogul.com/v1/import/data_sources
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"name":null}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 422
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.9.10
|
23
|
+
date:
|
24
|
+
- Sun, 05 Jun 2016 17:04:50 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
x-frame-options:
|
32
|
+
- SAMEORIGIN
|
33
|
+
x-xss-protection:
|
34
|
+
- 1; mode=block
|
35
|
+
x-content-type-options:
|
36
|
+
- nosniff
|
37
|
+
cache-control:
|
38
|
+
- no-cache
|
39
|
+
x-request-id:
|
40
|
+
- 76a25073-4c20-49fb-83b2-bbad2c361b0d
|
41
|
+
x-runtime:
|
42
|
+
- '0.009928'
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"errors":{"name":"A name is required for each data source."}}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Sun, 05 Jun 2016 17:04:50 GMT
|
48
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.chartmogul.com/v1/customers/20268060
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.9.10
|
23
|
+
date:
|
24
|
+
- Wed, 29 Jun 2016 12:47:09 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
content-length:
|
28
|
+
- '567'
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
status:
|
32
|
+
- 200 OK
|
33
|
+
access-control-allow-credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam
|
38
|
+
Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["example","another-tag"]},"address":{"country":"United
|
39
|
+
States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}'
|
40
|
+
http_version:
|
41
|
+
recorded_at: Wed, 29 Jun 2016 12:47:09 GMT
|
42
|
+
- request:
|
43
|
+
method: post
|
44
|
+
uri: https://api.chartmogul.com/v1/customers/20268060/attributes/custom
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"custom":[{"type":"String","key":"string_key","value":"String Value"},{"type":"Integer","key":"integer_key","value":1234},{"type":"Timestamp","key":"timestamp_key","value":"2016-01-31
|
48
|
+
00:00:00 UTC"},{"type":"Boolean","key":"boolean_key","value":true}]}'
|
49
|
+
headers:
|
50
|
+
User-Agent:
|
51
|
+
- Faraday v0.9.2
|
52
|
+
Content-Type:
|
53
|
+
- application/json
|
54
|
+
Authorization:
|
55
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message:
|
60
|
+
headers:
|
61
|
+
server:
|
62
|
+
- nginx/1.9.10
|
63
|
+
date:
|
64
|
+
- Wed, 29 Jun 2016 12:47:09 GMT
|
65
|
+
content-type:
|
66
|
+
- application/json
|
67
|
+
content-length:
|
68
|
+
- '121'
|
69
|
+
connection:
|
70
|
+
- close
|
71
|
+
status:
|
72
|
+
- 200 OK
|
73
|
+
access-control-allow-credentials:
|
74
|
+
- 'true'
|
75
|
+
body:
|
76
|
+
encoding: UTF-8
|
77
|
+
string: '{"custom":{"string_key":"String Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Wed, 29 Jun 2016 12:47:09 GMT
|
80
|
+
recorded_with: VCR 3.0.3
|
data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_required_tags.yml
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.chartmogul.com/v1/customers/20268060
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.9.10
|
23
|
+
date:
|
24
|
+
- Wed, 29 Jun 2016 12:47:08 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
content-length:
|
28
|
+
- '544'
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
status:
|
32
|
+
- 200 OK
|
33
|
+
access-control-allow-credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam
|
38
|
+
Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":[]},"address":{"country":"United
|
39
|
+
States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}'
|
40
|
+
http_version:
|
41
|
+
recorded_at: Wed, 29 Jun 2016 12:47:08 GMT
|
42
|
+
- request:
|
43
|
+
method: post
|
44
|
+
uri: https://api.chartmogul.com/v1/customers/20268060/attributes/tags
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"tags":["example","another-tag"]}'
|
48
|
+
headers:
|
49
|
+
User-Agent:
|
50
|
+
- Faraday v0.9.2
|
51
|
+
Content-Type:
|
52
|
+
- application/json
|
53
|
+
Authorization:
|
54
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
55
|
+
response:
|
56
|
+
status:
|
57
|
+
code: 200
|
58
|
+
message:
|
59
|
+
headers:
|
60
|
+
server:
|
61
|
+
- nginx/1.9.10
|
62
|
+
date:
|
63
|
+
- Wed, 29 Jun 2016 12:47:08 GMT
|
64
|
+
content-type:
|
65
|
+
- application/json
|
66
|
+
content-length:
|
67
|
+
- '34'
|
68
|
+
connection:
|
69
|
+
- close
|
70
|
+
status:
|
71
|
+
- 200 OK
|
72
|
+
access-control-allow-credentials:
|
73
|
+
- 'true'
|
74
|
+
body:
|
75
|
+
encoding: UTF-8
|
76
|
+
string: '{"tags":["example","another-tag"]}'
|
77
|
+
http_version:
|
78
|
+
recorded_at: Wed, 29 Jun 2016 12:47:08 GMT
|
79
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.chartmogul.com/v1/customers/search?email=no%40email.com
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 404
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.9.10
|
23
|
+
date:
|
24
|
+
- Wed, 29 Jun 2016 12:47:11 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
content-length:
|
28
|
+
- '94'
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
status:
|
32
|
+
- 404 Not Found
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"code":404,"message":"Can''t find any customers with email: \"no@email.com\"","param":"email"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 29 Jun 2016 12:47:11 GMT
|
38
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.chartmogul.com/v1/customers/20268060
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.9.10
|
23
|
+
date:
|
24
|
+
- Wed, 29 Jun 2016 13:57:20 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
content-length:
|
28
|
+
- '685'
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
status:
|
32
|
+
- 200 OK
|
33
|
+
access-control-allow-credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam
|
38
|
+
Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["another-tag"],"custom":{"string_key":"Another
|
39
|
+
String Value","integer_key":"5678","timestamp_key":"2016-02-01 00:00:00 UTC","boolean_key":"f"}},"address":{"country":"United
|
40
|
+
States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Wed, 29 Jun 2016 13:57:20 GMT
|
43
|
+
- request:
|
44
|
+
method: delete
|
45
|
+
uri: https://api.chartmogul.com/v1/customers/20268060/attributes/custom
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"custom":["string_key","integer_key","timestamp_key","boolean_key"]}'
|
49
|
+
headers:
|
50
|
+
User-Agent:
|
51
|
+
- Faraday v0.9.2
|
52
|
+
Content-Type:
|
53
|
+
- application/json
|
54
|
+
Authorization:
|
55
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message:
|
60
|
+
headers:
|
61
|
+
server:
|
62
|
+
- nginx/1.9.10
|
63
|
+
date:
|
64
|
+
- Wed, 29 Jun 2016 13:57:20 GMT
|
65
|
+
content-type:
|
66
|
+
- application/json
|
67
|
+
content-length:
|
68
|
+
- '2'
|
69
|
+
connection:
|
70
|
+
- close
|
71
|
+
status:
|
72
|
+
- 200 OK
|
73
|
+
access-control-allow-credentials:
|
74
|
+
- 'true'
|
75
|
+
body:
|
76
|
+
encoding: UTF-8
|
77
|
+
string: '{}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Wed, 29 Jun 2016 13:57:20 GMT
|
80
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.chartmogul.com/v1/customers/20268060
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx/1.9.10
|
23
|
+
date:
|
24
|
+
- Wed, 29 Jun 2016 12:47:10 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
content-length:
|
28
|
+
- '695'
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
status:
|
32
|
+
- 200 OK
|
33
|
+
access-control-allow-credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam
|
38
|
+
Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["example","another-tag"],"custom":{"string_key":"Another
|
39
|
+
String Value","integer_key":"5678","timestamp_key":"2016-02-01 00:00:00 UTC","boolean_key":"f"}},"address":{"country":"United
|
40
|
+
States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Wed, 29 Jun 2016 12:47:10 GMT
|
43
|
+
- request:
|
44
|
+
method: delete
|
45
|
+
uri: https://api.chartmogul.com/v1/customers/20268060/attributes/tags
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"tags":["example"]}'
|
49
|
+
headers:
|
50
|
+
User-Agent:
|
51
|
+
- Faraday v0.9.2
|
52
|
+
Content-Type:
|
53
|
+
- application/json
|
54
|
+
Authorization:
|
55
|
+
- Basic MDFiNzI2YzI0ZjNiYjhlOTc0MmEwNGZiMDhhZmE3NzQ6NzJlNGMxYTdlZTFiYzlkNGZjMDBlZWUwNWIyN2QzMGY=
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message:
|
60
|
+
headers:
|
61
|
+
server:
|
62
|
+
- nginx/1.9.10
|
63
|
+
date:
|
64
|
+
- Wed, 29 Jun 2016 12:47:11 GMT
|
65
|
+
content-type:
|
66
|
+
- application/json
|
67
|
+
content-length:
|
68
|
+
- '24'
|
69
|
+
connection:
|
70
|
+
- close
|
71
|
+
status:
|
72
|
+
- 200 OK
|
73
|
+
access-control-allow-credentials:
|
74
|
+
- 'true'
|
75
|
+
body:
|
76
|
+
encoding: UTF-8
|
77
|
+
string: '{"tags":["another-tag"]}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Wed, 29 Jun 2016 12:47:11 GMT
|
80
|
+
recorded_with: VCR 3.0.3
|