chartmogul-ruby 1.5.1 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +5 -1
  4. data/Gemfile +2 -0
  5. data/LICENSE.txt +1 -1
  6. data/README.md +5 -3
  7. data/Rakefile +2 -0
  8. data/bin/console +1 -0
  9. data/chartmogul-ruby.gemspec +21 -17
  10. data/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml +112 -0
  11. data/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml +77 -0
  12. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml +53 -0
  13. data/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +148 -109
  14. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml +164 -0
  15. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml +297 -0
  16. data/lib/chartmogul.rb +8 -2
  17. data/lib/chartmogul/api/actions/all.rb +2 -0
  18. data/lib/chartmogul/api/actions/create.rb +2 -0
  19. data/lib/chartmogul/api/actions/custom.rb +2 -0
  20. data/lib/chartmogul/api/actions/destroy.rb +2 -0
  21. data/lib/chartmogul/api/actions/retrieve.rb +2 -0
  22. data/lib/chartmogul/api/actions/update.rb +22 -0
  23. data/lib/chartmogul/api_resource.rb +21 -12
  24. data/lib/chartmogul/concerns/entries.rb +2 -0
  25. data/lib/chartmogul/concerns/pageable.rb +2 -0
  26. data/lib/chartmogul/concerns/pageable2.rb +2 -0
  27. data/lib/chartmogul/concerns/summary.rb +2 -0
  28. data/lib/chartmogul/config_attributes.rb +7 -1
  29. data/lib/chartmogul/configuration.rb +3 -0
  30. data/lib/chartmogul/customer.rb +2 -0
  31. data/lib/chartmogul/customer_invoices.rb +11 -0
  32. data/lib/chartmogul/data_source.rb +2 -0
  33. data/lib/chartmogul/enrichment/customer.rb +2 -0
  34. data/lib/chartmogul/errors/chartmogul_error.rb +2 -0
  35. data/lib/chartmogul/errors/configuration_error.rb +2 -0
  36. data/lib/chartmogul/errors/forbidden_error.rb +2 -0
  37. data/lib/chartmogul/errors/not_found_error.rb +2 -0
  38. data/lib/chartmogul/errors/resource_invalid_error.rb +2 -0
  39. data/lib/chartmogul/errors/schema_invalid_error.rb +2 -0
  40. data/lib/chartmogul/errors/server_error.rb +2 -0
  41. data/lib/chartmogul/errors/unauthorized_error.rb +2 -0
  42. data/lib/chartmogul/invoice.rb +2 -0
  43. data/lib/chartmogul/line_items/one_time.rb +2 -0
  44. data/lib/chartmogul/line_items/subscription.rb +2 -0
  45. data/lib/chartmogul/metrics/activity.rb +2 -0
  46. data/lib/chartmogul/metrics/all_key_metrics.rb +2 -0
  47. data/lib/chartmogul/metrics/arpa.rb +2 -0
  48. data/lib/chartmogul/metrics/arr.rb +2 -0
  49. data/lib/chartmogul/metrics/asp.rb +2 -0
  50. data/lib/chartmogul/metrics/base.rb +6 -2
  51. data/lib/chartmogul/metrics/customer_churn_rate.rb +2 -0
  52. data/lib/chartmogul/metrics/customer_count.rb +2 -0
  53. data/lib/chartmogul/metrics/ltv.rb +2 -0
  54. data/lib/chartmogul/metrics/mrr.rb +2 -0
  55. data/lib/chartmogul/metrics/mrr_churn_rate.rb +2 -0
  56. data/lib/chartmogul/metrics/subscription.rb +2 -0
  57. data/lib/chartmogul/object.rb +2 -0
  58. data/lib/chartmogul/ping.rb +2 -0
  59. data/lib/chartmogul/plan.rb +2 -0
  60. data/lib/chartmogul/plan_group.rb +2 -0
  61. data/lib/chartmogul/plan_groups/plans.rb +2 -0
  62. data/lib/chartmogul/resource_path.rb +6 -1
  63. data/lib/chartmogul/subscription.rb +2 -0
  64. data/lib/chartmogul/summary.rb +2 -0
  65. data/lib/chartmogul/transactions/payment.rb +2 -0
  66. data/lib/chartmogul/transactions/refund.rb +2 -0
  67. data/lib/chartmogul/utils/hash_snake_caser.rb +2 -0
  68. data/lib/chartmogul/utils/json_parser.rb +11 -1
  69. data/lib/chartmogul/version.rb +3 -1
  70. metadata +64 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca7ae56bc58d152fa47c9af3e07b2f42f10b3cb357c08a68412675d1dc2565c3
4
- data.tar.gz: 06db704ffdc4ee93eec4732d8aae1e3065afefa57415284409d8df734b967a66
3
+ metadata.gz: 48f89ffb09ae87641ce72a86933370c44a34f9bdfc3007e3cd0757e7e3ab86fc
4
+ data.tar.gz: 195daeabc4de7495673bf7a8066ac777743f2e52fe0c4d9a53e2e9562fec3c29
5
5
  SHA512:
6
- metadata.gz: e8a1e1c07dc26c5cc1e4b09245688184a9ee1e73822c34c2f6d320040a6a88322be7c5374cd3e9c91a3594d8499282aaf30d30bc33344dfd7521176e6c9fbd71
7
- data.tar.gz: 8f638c5ec2168f0b5633a6e5f14af3fcc5603b144d9977f9db0c3a1c551a8ddfcd3e6c60b611d848c21ab5b6a6e0a8a681a19edf9bd3dc68b7f17848e19213bb
6
+ metadata.gz: c64c9287441ba417ddb56276eb2b7e993dc0cc41ad7448960dbe6bc9c852d64bd7d022f41fe702cafc0493d02e7f3f72f0c63b6b3c5391921bc86333acb78000
7
+ data.tar.gz: 16ef7f3cc9120ba2934979e4d3aa99b0b36ccfd42dc1d2018a3d2e650993cce5726706543200b718d7bfce233bbdf894be4ed67040859123d1dcae29df59fbba
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  *.swp
11
11
  vendor/bundle
12
+ /.idea
@@ -1,4 +1,8 @@
1
+ os: linux
2
+ dist: bionic
3
+
1
4
  language: ruby
5
+
2
6
  rvm:
3
7
  - 2.3
4
8
  - 2.4
@@ -15,7 +19,7 @@ before_script:
15
19
 
16
20
  branches:
17
21
  only:
18
- - master
22
+ - main
19
23
 
20
24
  after_script:
21
25
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in chartmogul-ruby.gemspec
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 ChartMogul Ltd
3
+ Copyright (c) 2020 ChartMogul Ltd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://badge.fury.io/rb/chartmogul-ruby"><img src="https://badge.fury.io/rb/chartmogul-ruby.svg" alt="Gem Version"></a>
11
- <a href="https://travis-ci.org/chartmogul/chartmogul-ruby"><img src="https://travis-ci.org/chartmogul/chartmogul-ruby.svg?branch=master" alt="Travis project"></a>
11
+ <a href="https://travis-ci.org/chartmogul/chartmogul-ruby"><img src="https://travis-ci.org/chartmogul/chartmogul-ruby.svg?branch=main" alt="Travis project"></a>
12
12
  <a href="https://codeclimate.com/github/chartmogul/chartmogul-ruby/test_coverage"><img src="https://api.codeclimate.com/v1/badges/40e8bdff4d1dbf2451de/test_coverage" /></a>
13
13
  </p>
14
14
 
@@ -48,7 +48,7 @@ Or install it yourself as:
48
48
  $ gem install chartmogul-ruby
49
49
 
50
50
  ### Supported Ruby Versions
51
- This gem supports Ruby 2.3 and 2.4.
51
+ This gem supports Ruby 2.3 and above.
52
52
 
53
53
  ## Configuration
54
54
 
@@ -59,6 +59,8 @@ ChartMogul.account_token = '<Account key goes here>'
59
59
  ChartMogul.secret_key = '<Secret key goes here>'
60
60
  ```
61
61
 
62
+ Configuration is threadsafe and applied only to the current thread.
63
+
62
64
  Test your authentication:
63
65
  ```ruby
64
66
  ChartMogul::Ping.ping
@@ -115,7 +117,7 @@ The gem is available as open source under the terms of the [MIT License](http://
115
117
 
116
118
  ### The MIT License (MIT)
117
119
 
118
- *Copyright (c) 2016 ChartMogul Ltd.*
120
+ *Copyright (c) 2020 ChartMogul Ltd.*
119
121
 
120
122
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
121
123
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'chartmogul'
@@ -1,32 +1,36 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'chartmogul/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'chartmogul-ruby'
9
- spec.version = ChartMogul::VERSION
10
- spec.authors = ['Jason Langenauer']
11
- spec.email = ['jason@chartmogul.com']
8
+ spec.name = 'chartmogul-ruby'
9
+ spec.version = ChartMogul::VERSION
10
+ spec.authors = ['Petr Kopac']
11
+ spec.email = ['petr@chartmogul.com']
12
12
 
13
- spec.summary = 'Chartmogul API Ruby Client'
14
- spec.description = 'Official Ruby client for ChartMogul\'s API'
15
- spec.homepage = 'https://github.com/chartmogul/chartmogul-ruby'
16
- spec.license = 'MIT'
13
+ spec.summary = 'Chartmogul API Ruby Client'
14
+ spec.description = 'Official Ruby client for ChartMogul\'s API'
15
+ spec.homepage = 'https://github.com/chartmogul/chartmogul-ruby'
16
+ spec.license = 'MIT'
17
+ spec.required_ruby_version = '>= 2.3'
17
18
 
18
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- spec.bindir = 'exe'
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
- spec.require_paths = ['lib']
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
22
23
 
23
- spec.add_dependency 'faraday', '~> 0.17.3'
24
+ spec.add_dependency 'faraday', '~> 1.0.0'
24
25
 
25
26
  spec.add_development_dependency 'bundler', '~> 2'
27
+ spec.add_development_dependency 'pry', '~> 0.12.2'
26
28
  spec.add_development_dependency 'rake', '~> 13.0'
27
29
  spec.add_development_dependency 'rspec', '~> 3.0'
30
+ spec.add_development_dependency 'rubocop', '0.79'
31
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.38'
32
+ spec.add_development_dependency 'rubocop-thread_safety', '~> 0.3.4'
33
+ spec.add_development_dependency 'simplecov', '~> 0.17.1'
28
34
  spec.add_development_dependency 'vcr', '~> 5.1'
29
35
  spec.add_development_dependency 'webmock', '~> 3.8'
30
- spec.add_development_dependency 'simplecov', '~> 0.17.1'
31
- spec.add_development_dependency 'pry', '~> 0.12.2'
32
36
  end
@@ -0,0 +1,112 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/ping
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.17.3
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic aW52YWxpZDppbnZhbGlk
16
+ response:
17
+ status:
18
+ code: 401
19
+ message: Unauthorized
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Fri, 17 Jul 2020 08:25:06 GMT
25
+ content-type:
26
+ - application/json
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - keep-alive
31
+ status:
32
+ - 401 Unauthorized
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"code":401,"message":"No valid API key provided","param":null}'
36
+ http_version:
37
+ recorded_at: Fri, 17 Jul 2020 08:25:06 GMT
38
+ - request:
39
+ method: get
40
+ uri: https://api.chartmogul.com/v1/ping
41
+ body:
42
+ encoding: UTF-8
43
+ string: "{}"
44
+ headers:
45
+ User-Agent:
46
+ - Faraday v0.17.3
47
+ Content-Type:
48
+ - application/json
49
+ Authorization:
50
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ server:
57
+ - nginx/1.10.1
58
+ date:
59
+ - Fri, 17 Jul 2020 08:25:11 GMT
60
+ content-type:
61
+ - application/json
62
+ transfer-encoding:
63
+ - chunked
64
+ connection:
65
+ - keep-alive
66
+ vary:
67
+ - Accept-Encoding, Accept-Encoding
68
+ status:
69
+ - 200 OK
70
+ access-control-allow-credentials:
71
+ - 'true'
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"data":"pong!"}'
75
+ http_version:
76
+ recorded_at: Fri, 17 Jul 2020 08:25:11 GMT
77
+ - request:
78
+ method: get
79
+ uri: https://api.chartmogul.com/v1/ping
80
+ body:
81
+ encoding: UTF-8
82
+ string: "{}"
83
+ headers:
84
+ User-Agent:
85
+ - Faraday v0.17.3
86
+ Content-Type:
87
+ - application/json
88
+ Authorization:
89
+ - Basic aW52YWxpZDppbnZhbGlk
90
+ response:
91
+ status:
92
+ code: 401
93
+ message: Unauthorized
94
+ headers:
95
+ server:
96
+ - nginx/1.10.1
97
+ date:
98
+ - Fri, 17 Jul 2020 08:25:11 GMT
99
+ content-type:
100
+ - application/json
101
+ transfer-encoding:
102
+ - chunked
103
+ connection:
104
+ - keep-alive
105
+ status:
106
+ - 401 Unauthorized
107
+ body:
108
+ encoding: UTF-8
109
+ string: '{"code":401,"message":"No valid API key provided","param":null}'
110
+ http_version:
111
+ recorded_at: Fri, 17 Jul 2020 08:25:11 GMT
112
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/ping
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.17.3
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic aW52YWxpZDppbnZhbGlk
16
+ response:
17
+ status:
18
+ code: 401
19
+ message: Unauthorized
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Fri, 17 Jul 2020 08:25:25 GMT
25
+ content-type:
26
+ - application/json
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - keep-alive
31
+ status:
32
+ - 401 Unauthorized
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"code":401,"message":"No valid API key provided","param":null}'
36
+ http_version:
37
+ recorded_at: Fri, 17 Jul 2020 08:25:25 GMT
38
+ - request:
39
+ method: get
40
+ uri: https://api.chartmogul.com/v1/ping
41
+ body:
42
+ encoding: UTF-8
43
+ string: "{}"
44
+ headers:
45
+ User-Agent:
46
+ - Faraday v0.17.3
47
+ Content-Type:
48
+ - application/json
49
+ Authorization:
50
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ server:
57
+ - nginx/1.10.1
58
+ date:
59
+ - Fri, 17 Jul 2020 08:25:26 GMT
60
+ content-type:
61
+ - application/json
62
+ transfer-encoding:
63
+ - chunked
64
+ connection:
65
+ - keep-alive
66
+ vary:
67
+ - Accept-Encoding, Accept-Encoding
68
+ status:
69
+ - 200 OK
70
+ access-control-allow-credentials:
71
+ - 'true'
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"data":"pong!"}'
75
+ http_version:
76
+ recorded_at: Fri, 17 Jul 2020 08:25:26 GMT
77
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://api.chartmogul.com/v1/customers/cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"attributes":{"custom":{"company_size":"just me"},"tags":["foobar"]},"email":"curry@example.com","company":"Curry
9
+ 42","country":"IN","state":"NY","city":"Berlin","free_trial_started_at":"2020-02-02
10
+ 22:40:00 UTC"}'
11
+ headers:
12
+ User-Agent:
13
+ - Faraday v0.17.3
14
+ Content-Type:
15
+ - application/json
16
+ Authorization:
17
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Accept:
21
+ - "*/*"
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Server:
28
+ - nginx/1.10.1
29
+ Date:
30
+ - Fri, 17 Jul 2020 12:10:11 GMT
31
+ Content-Type:
32
+ - application/json
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Connection:
36
+ - keep-alive
37
+ Vary:
38
+ - Accept-Encoding
39
+ - Accept-Encoding
40
+ Status:
41
+ - 200 OK
42
+ Access-Control-Allow-Credentials:
43
+ - 'true'
44
+ body:
45
+ encoding: ASCII-8BIT
46
+ string: '{"id":33802170,"uuid":"cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1","external_id":"HngTohkREePdXBIx","name":"Currywurst","email":"curry@example.com","status":"Past
47
+ due","customer-since":"2018-12-29T00:00:00+00:00","attributes":{"custom":{"company_size":"just
48
+ me","Users":"1"},"clearbit":{},"stripe":{},"tags":["foobar"]},"data_source_uuid":"ds_b835f746-43eb-11e9-8169-9333ac374c59","data_source_uuids":["ds_b835f746-43eb-11e9-8169-9333ac374c59"],"external_ids":["HngTohkREePdXBIx"],"company":"Curry
49
+ 42","country":"IN","state":"NY","city":"Berlin","zip":null,"lead_created_at":"2018-12-15T00:00:00.000Z","free_trial_started_at":"2020-02-02T22:40:00.000Z","address":{"country":"India","state":"New
50
+ York","city":"Berlin","address_zip":null},"mrr":4900,"arr":58800,"billing-system-url":"HngTohkREePdXBIx","chartmogul-url":"https://app.chartmogul.com/#customers/33802170-Currywurst","billing-system-type":"Chargebee","currency":"USD","currency-sign":"$"}'
51
+ http_version: null
52
+ recorded_at: Fri, 17 Jul 2020 12:10:11 GMT
53
+ recorded_with: VCR 5.1.0
@@ -8,291 +8,330 @@ http_interactions:
8
8
  string: '{"name":"Customer Invoices Test Data Source"}'
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v1.0.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  Authorization:
15
- - Basic YmIzN2I0Njk5NjNlMjhlYjY2MjA1ZWYzZmU1MWQ1NmM6ZmM1YjQxYzM3YTNlZTcwYjQyN2UwYzU1ODg2NzA2ZmQ=
15
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
16
16
  response:
17
17
  status:
18
18
  code: 201
19
- message:
19
+ message: Created
20
20
  headers:
21
21
  server:
22
- - nginx/1.9.10
22
+ - nginx/1.10.1
23
23
  date:
24
- - Wed, 22 Jun 2016 15:34:41 GMT
24
+ - Fri, 14 Aug 2020 08:21:40 GMT
25
25
  content-type:
26
- - application/json; charset=utf-8
26
+ - application/json
27
27
  transfer-encoding:
28
28
  - chunked
29
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
- etag:
38
- - W/"60451ca489b1142994522bdcd2a78022"
39
- cache-control:
40
- - max-age=0, private, must-revalidate
41
- x-request-id:
42
- - 14e68eba-6131-4b04-8210-d9901cadd7ef
43
- x-runtime:
44
- - '0.536866'
45
- strict-transport-security:
46
- - max-age=15768000
30
+ - keep-alive
31
+ status:
32
+ - 201 Created
33
+ access-control-allow-credentials:
34
+ - 'true'
47
35
  body:
48
36
  encoding: UTF-8
49
- string: '{"uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e","name":"Customer
50
- Invoices Test Data Source","created_at":"2016-06-22T15:34:41.041Z","status":"never_imported"}'
37
+ string: '{"uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05","name":"Customer
38
+ Invoices Test Data Source","system":"Import API","created_at":"2020-08-14T08:21:40.103Z","status":"idle"}'
51
39
  http_version:
52
- recorded_at: Wed, 22 Jun 2016 15:34:41 GMT
40
+ recorded_at: Fri, 14 Aug 2020 08:21:40 GMT
53
41
  - request:
54
42
  method: post
55
43
  uri: https://api.chartmogul.com/v1/customers
56
44
  body:
57
45
  encoding: UTF-8
58
- string: '{"data_source_uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e","external_id":"test_cus_ext_id","name":"Test
59
- Customer","email":"test@customer.com","company":null,"country":"DE","state":null,"city":"Berlin","zip":null}'
46
+ string: '{"external_id":"test_cus_ext_id","name":"Test Customer","email":"test@customer.com","country":"DE","city":"Berlin","data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05"}'
60
47
  headers:
61
48
  User-Agent:
62
- - Faraday v0.9.2
49
+ - Faraday v1.0.1
63
50
  Content-Type:
64
51
  - application/json
65
52
  Authorization:
66
- - Basic YmIzN2I0Njk5NjNlMjhlYjY2MjA1ZWYzZmU1MWQ1NmM6ZmM1YjQxYzM3YTNlZTcwYjQyN2UwYzU1ODg2NzA2ZmQ=
53
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
67
54
  response:
68
55
  status:
69
56
  code: 201
70
- message:
57
+ message: Created
71
58
  headers:
72
59
  server:
73
- - nginx/1.9.10
60
+ - nginx/1.10.1
74
61
  date:
75
- - Wed, 22 Jun 2016 15:34:41 GMT
62
+ - Fri, 14 Aug 2020 08:21:40 GMT
76
63
  content-type:
77
- - application/json; charset=utf-8
64
+ - application/json
78
65
  transfer-encoding:
79
66
  - chunked
80
67
  connection:
81
- - close
82
- x-frame-options:
83
- - SAMEORIGIN
84
- x-xss-protection:
85
- - 1; mode=block
86
- x-content-type-options:
87
- - nosniff
88
- etag:
89
- - W/"b207f005123ccc7fbe07e3cf8d4ef474"
90
- cache-control:
91
- - max-age=0, private, must-revalidate
92
- x-request-id:
93
- - 8b32a149-5c4a-4b14-a82f-666adaf3897a
94
- x-runtime:
95
- - '0.221606'
96
- strict-transport-security:
97
- - max-age=15768000
68
+ - keep-alive
69
+ status:
70
+ - 201 Created
71
+ access-control-allow-credentials:
72
+ - 'true'
98
73
  body:
99
74
  encoding: UTF-8
100
- string: '{"uuid":"cus_5417b49e-7ea8-474a-b6bc-5bbb406c15c0","external_id":"test_cus_ext_id","name":"Test
101
- Customer","company":"","email":"test@customer.com","city":"Berlin","state":"","country":"DE","zip":"","data_source_uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e"}'
75
+ string: '{"id":58654367,"uuid":"cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf","external_id":"test_cus_ext_id","name":"Test
76
+ Customer","email":"test@customer.com","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05","data_source_uuids":["ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05"],"external_ids":["test_cus_ext_id"],"company":"","country":"DE","state":null,"city":"Berlin","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":"Germany","state":null,"city":"Berlin","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/58654367-Test_Customer","billing-system-type":"Import
77
+ API","currency":"USD","currency-sign":"$"}'
102
78
  http_version:
103
- recorded_at: Wed, 22 Jun 2016 15:34:41 GMT
79
+ recorded_at: Fri, 14 Aug 2020 08:21:40 GMT
104
80
  - request:
105
81
  method: post
106
82
  uri: https://api.chartmogul.com/v1/plans
107
83
  body:
108
84
  encoding: UTF-8
109
- string: '{"data_source_uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e","name":"Test
110
- Plan","interval_count":7,"interval_unit":"day","external_id":"test_cus_pl_ext_id"}'
85
+ string: '{"name":"Test Plan","interval_count":7,"interval_unit":"day","external_id":"test_cus_pl_ext_id","data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05"}'
111
86
  headers:
112
87
  User-Agent:
113
- - Faraday v0.9.2
88
+ - Faraday v1.0.1
114
89
  Content-Type:
115
90
  - application/json
116
91
  Authorization:
117
- - Basic YmIzN2I0Njk5NjNlMjhlYjY2MjA1ZWYzZmU1MWQ1NmM6ZmM1YjQxYzM3YTNlZTcwYjQyN2UwYzU1ODg2NzA2ZmQ=
92
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
118
93
  response:
119
94
  status:
120
95
  code: 201
121
- message:
96
+ message: Created
122
97
  headers:
123
98
  server:
124
- - nginx/1.9.10
99
+ - nginx/1.10.1
125
100
  date:
126
- - Wed, 22 Jun 2016 15:34:41 GMT
101
+ - Fri, 14 Aug 2020 08:21:41 GMT
127
102
  content-type:
128
103
  - application/json; charset=utf-8
129
104
  transfer-encoding:
130
105
  - chunked
131
106
  connection:
132
- - close
107
+ - keep-alive
108
+ status:
109
+ - 201 Created
133
110
  x-frame-options:
134
111
  - SAMEORIGIN
135
112
  x-xss-protection:
136
113
  - 1; mode=block
137
114
  x-content-type-options:
138
115
  - nosniff
116
+ x-download-options:
117
+ - noopen
118
+ x-permitted-cross-domain-policies:
119
+ - none
120
+ referrer-policy:
121
+ - strict-origin-when-cross-origin
139
122
  etag:
140
- - W/"e804690c42c3d5f3d9301ff57fe9e918"
123
+ - W/"1d19bf324f0b6bf397ba8851cb55543c"
141
124
  cache-control:
142
125
  - max-age=0, private, must-revalidate
143
126
  x-request-id:
144
- - 9473bcf9-6970-4be8-a418-d2ae2988fa0c
127
+ - cbb7d1e3-f3a4-4ba2-b85c-7d3eed91922d
145
128
  x-runtime:
146
- - '0.050208'
129
+ - '0.350185'
147
130
  strict-transport-security:
148
131
  - max-age=15768000
149
132
  body:
150
133
  encoding: UTF-8
151
- string: '{"uuid":"pl_209e4674-1258-4a35-8378-9b15c4086965","external_id":"test_cus_pl_ext_id","name":"Test
152
- Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e"}'
134
+ string: '{"external_id":"test_cus_pl_ext_id","name":"Test Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05","uuid":"pl_2e010ebf-de07-11ea-a4dd-8bf0a8234993"}'
153
135
  http_version:
154
- recorded_at: Wed, 22 Jun 2016 15:34:41 GMT
136
+ recorded_at: Fri, 14 Aug 2020 08:21:41 GMT
155
137
  - request:
156
138
  method: get
157
- uri: https://api.chartmogul.com/v1/import/customers/cus_5417b49e-7ea8-474a-b6bc-5bbb406c15c0/invoices
139
+ uri: https://api.chartmogul.com/v1/import/customers/cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf/invoices
158
140
  body:
159
141
  encoding: US-ASCII
160
142
  string: ''
161
143
  headers:
162
144
  User-Agent:
163
- - Faraday v0.9.2
145
+ - Faraday v1.0.1
164
146
  Content-Type:
165
147
  - application/json
166
148
  Authorization:
167
- - Basic YmIzN2I0Njk5NjNlMjhlYjY2MjA1ZWYzZmU1MWQ1NmM6ZmM1YjQxYzM3YTNlZTcwYjQyN2UwYzU1ODg2NzA2ZmQ=
149
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
168
150
  response:
169
151
  status:
170
152
  code: 200
171
- message:
153
+ message: OK
172
154
  headers:
173
155
  server:
174
- - nginx/1.9.10
156
+ - nginx/1.10.1
175
157
  date:
176
- - Wed, 22 Jun 2016 16:08:43 GMT
158
+ - Fri, 14 Aug 2020 08:21:41 GMT
177
159
  content-type:
178
160
  - application/json; charset=utf-8
179
161
  transfer-encoding:
180
162
  - chunked
181
163
  connection:
182
- - close
164
+ - keep-alive
165
+ vary:
166
+ - Accept-Encoding, Accept-Encoding
167
+ status:
168
+ - 200 OK
183
169
  x-frame-options:
184
170
  - SAMEORIGIN
185
171
  x-xss-protection:
186
172
  - 1; mode=block
187
173
  x-content-type-options:
188
174
  - nosniff
175
+ x-download-options:
176
+ - noopen
177
+ x-permitted-cross-domain-policies:
178
+ - none
179
+ referrer-policy:
180
+ - strict-origin-when-cross-origin
189
181
  etag:
190
- - W/"cbb072e75866df2cb9be8bbdbd44920e"
182
+ - W/"aeef59b540af9e5982db384f237518a2"
191
183
  cache-control:
192
184
  - max-age=0, private, must-revalidate
193
185
  x-request-id:
194
- - 9d42e2ff-4066-4a90-99b4-b0999bdfeac6
186
+ - 47e6129d-8195-4273-9c31-170905e27755
195
187
  x-runtime:
196
- - '0.157408'
188
+ - '0.179805'
197
189
  strict-transport-security:
198
190
  - max-age=15768000
199
191
  body:
200
- encoding: UTF-8
201
- string: '{"customer_uuid":"cus_5417b49e-7ea8-474a-b6bc-5bbb406c15c0","invoices":[],"current_page":1,"total_pages":0}'
192
+ encoding: ASCII-8BIT
193
+ string: '{"customer_uuid":"cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf","invoices":[],"current_page":1,"total_pages":0}'
202
194
  http_version:
203
- recorded_at: Wed, 22 Jun 2016 16:08:43 GMT
195
+ recorded_at: Fri, 14 Aug 2020 08:21:42 GMT
204
196
  - request:
205
197
  method: post
206
- uri: https://api.chartmogul.com/v1/import/customers/cus_5417b49e-7ea8-474a-b6bc-5bbb406c15c0/invoices
198
+ uri: https://api.chartmogul.com/v1/import/customers/cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf/invoices
207
199
  body:
208
200
  encoding: UTF-8
209
- string: '{"invoices":[{"date":"2016-01-01 12:00:00 +0000","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id","subscription_set_external_id":"test_cus_set_ext_id","plan_uuid":"pl_209e4674-1258-4a35-8378-9b15c4086965","service_period_start":"2016-01-01
210
- 12:00:00 +0000","service_period_end":"2016-02-01 12:00:00 +0000","amount_in_cents":1000,"cancelled_at":"2016-01-15
211
- 12:00:00 +0000","prorated":false,"quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"test_cus_li_ext_id"}],"transactions":[{"type":"payment","date":"2016-01-01
212
- 12:00:00 +0000","result":"successful","external_id":"test_cus_tr_ext_id"}],"external_id":"test_cus_inv_ext_id","due_date":"2016-01-07
213
- 12:00:00 +0000"}],"customer_uuid":"cus_5417b49e-7ea8-474a-b6bc-5bbb406c15c0"}'
201
+ string: '{"invoices":[{"date":"2016-01-01 12:00:00 UTC","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id","service_period_start":"2016-01-01
202
+ 12:00:00 UTC","service_period_end":"2016-02-01 12:00:00 UTC","amount_in_cents":1000,"cancelled_at":"2016-01-15
203
+ 12:00:00 UTC","prorated":false,"quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"test_cus_li_ext_id","plan_uuid":"pl_2e010ebf-de07-11ea-a4dd-8bf0a8234993"}],"transactions":[{"type":"payment","date":"2016-01-01
204
+ 12:00:00 UTC","result":"successful","external_id":"test_cus_tr_ext_id"}],"external_id":"test_cus_inv_ext_id","customer_external_id":"test_cus_ext_id","due_date":"2016-01-07
205
+ 12:00:00 UTC"}],"customer_uuid":"cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf"}'
214
206
  headers:
215
207
  User-Agent:
216
- - Faraday v0.9.2
208
+ - Faraday v1.0.1
217
209
  Content-Type:
218
210
  - application/json
219
211
  Authorization:
220
- - Basic YmIzN2I0Njk5NjNlMjhlYjY2MjA1ZWYzZmU1MWQ1NmM6ZmM1YjQxYzM3YTNlZTcwYjQyN2UwYzU1ODg2NzA2ZmQ=
212
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
221
213
  response:
222
214
  status:
223
215
  code: 201
224
- message:
216
+ message: Created
225
217
  headers:
226
218
  server:
227
- - nginx/1.9.10
219
+ - nginx/1.10.1
228
220
  date:
229
- - Wed, 22 Jun 2016 16:08:43 GMT
221
+ - Fri, 14 Aug 2020 08:21:43 GMT
230
222
  content-type:
231
223
  - application/json; charset=utf-8
232
224
  transfer-encoding:
233
225
  - chunked
234
226
  connection:
235
- - close
227
+ - keep-alive
228
+ status:
229
+ - 201 Created
236
230
  x-frame-options:
237
231
  - SAMEORIGIN
238
232
  x-xss-protection:
239
233
  - 1; mode=block
240
234
  x-content-type-options:
241
235
  - nosniff
236
+ x-download-options:
237
+ - noopen
238
+ x-permitted-cross-domain-policies:
239
+ - none
240
+ referrer-policy:
241
+ - strict-origin-when-cross-origin
242
242
  etag:
243
- - W/"95e16111eb07645d2ab5af2f762cc1a7"
243
+ - W/"2f2be4d16bccef7180e8df0515ebfd2f"
244
244
  cache-control:
245
245
  - max-age=0, private, must-revalidate
246
246
  x-request-id:
247
- - fcadbbb4-8984-4938-97b3-151a3efae3ce
247
+ - ccdcc2fb-0a04-4307-94c8-f8482ec6bd09
248
248
  x-runtime:
249
- - '0.182908'
249
+ - '1.437992'
250
250
  strict-transport-security:
251
251
  - max-age=15768000
252
252
  body:
253
253
  encoding: UTF-8
254
- string: '{"invoices":[{"uuid":"inv_a11675b0-f4cb-4d2b-8b38-492626ac373e","external_id":"test_cus_inv_ext_id","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","currency":"USD","line_items":[{"uuid":"li_6dc1a6bd-877d-4802-a595-4b0f5943bdfa","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_b39173f6-cd13-4c06-b6e6-0c659867439f","plan_uuid":"pl_209e4674-1258-4a35-8378-9b15c4086965","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":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200}],"transactions":[{"uuid":"tr_829db91c-8b46-48ac-805d-09d29afe64c2","external_id":"test_cus_tr_ext_id","type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful"}]}]}'
254
+ string: '{"invoices":[{"uuid":"inv_deb98a20-3e71-49df-a49a-ac9d29c004be","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","external_id":"test_cus_inv_ext_id","currency":"USD","line_items":[{"uuid":"li_ffa7fad8-c393-45d2-aec4-2a869ece67c5","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_f3fa6a4e-8fc8-4843-95f2-062bc17826c6","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_2e010ebf-de07-11ea-a4dd-8bf0a8234993","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":""}],"transactions":[{"uuid":"tr_ff121f19-ef39-4bc8-824e-225d1b33e5da","external_id":"test_cus_tr_ext_id","type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful"}]}]}'
255
255
  http_version:
256
- recorded_at: Wed, 22 Jun 2016 16:08:43 GMT
256
+ recorded_at: Fri, 14 Aug 2020 08:21:43 GMT
257
257
  - request:
258
258
  method: delete
259
- uri: https://api.chartmogul.com/v1/data_sources/ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e
259
+ uri: https://api.chartmogul.com/v1/data_sources/ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05/customers/cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf/invoices
260
260
  body:
261
261
  encoding: US-ASCII
262
262
  string: ''
263
263
  headers:
264
264
  User-Agent:
265
- - Faraday v0.9.2
265
+ - Faraday v1.0.1
266
266
  Authorization:
267
- - Basic YmIzN2I0Njk5NjNlMjhlYjY2MjA1ZWYzZmU1MWQ1NmM6ZmM1YjQxYzM3YTNlZTcwYjQyN2UwYzU1ODg2NzA2ZmQ=
267
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
268
268
  response:
269
269
  status:
270
270
  code: 204
271
- message:
271
+ message: No Content
272
272
  headers:
273
273
  server:
274
- - nginx/1.9.10
274
+ - nginx/1.10.1
275
275
  date:
276
- - Wed, 22 Jun 2016 16:08:43 GMT
276
+ - Fri, 14 Aug 2020 08:21:44 GMT
277
277
  connection:
278
- - close
278
+ - keep-alive
279
+ status:
280
+ - 204 No Content
279
281
  x-frame-options:
280
282
  - SAMEORIGIN
281
283
  x-xss-protection:
282
284
  - 1; mode=block
283
285
  x-content-type-options:
284
286
  - nosniff
287
+ x-download-options:
288
+ - noopen
289
+ x-permitted-cross-domain-policies:
290
+ - none
291
+ referrer-policy:
292
+ - strict-origin-when-cross-origin
285
293
  cache-control:
286
294
  - no-cache
287
295
  x-request-id:
288
- - 5f2bcbf4-0c81-435f-b168-49a245d4e2c9
296
+ - c03bcf86-5a42-4655-b015-76ffc653ec91
289
297
  x-runtime:
290
- - '0.018236'
298
+ - '0.353793'
291
299
  strict-transport-security:
292
300
  - max-age=15768000
293
301
  body:
294
302
  encoding: UTF-8
295
303
  string: ''
296
304
  http_version:
297
- recorded_at: Wed, 22 Jun 2016 16:08:43 GMT
298
- recorded_with: VCR 3.0.3
305
+ recorded_at: Fri, 14 Aug 2020 08:21:44 GMT
306
+ - request:
307
+ method: delete
308
+ uri: https://api.chartmogul.com/v1/data_sources/ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05
309
+ body:
310
+ encoding: US-ASCII
311
+ string: ''
312
+ headers:
313
+ User-Agent:
314
+ - Faraday v1.0.1
315
+ Authorization:
316
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
317
+ response:
318
+ status:
319
+ code: 204
320
+ message: No Content
321
+ headers:
322
+ server:
323
+ - nginx/1.10.1
324
+ date:
325
+ - Fri, 14 Aug 2020 08:21:44 GMT
326
+ connection:
327
+ - keep-alive
328
+ status:
329
+ - 204 No Content
330
+ access-control-allow-credentials:
331
+ - 'true'
332
+ body:
333
+ encoding: UTF-8
334
+ string: ''
335
+ http_version:
336
+ recorded_at: Fri, 14 Aug 2020 08:21:44 GMT
337
+ recorded_with: VCR 5.1.0