chartmogul-ruby 1.0.0 → 1.0.1
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 +4 -4
- data/changelog.md +4 -1
- data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml +3 -3
- data/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml +1 -1
- data/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml +1 -1
- data/lib/chartmogul.rb +5 -4
- data/lib/chartmogul/concerns/pageable.rb +0 -1
- data/lib/chartmogul/concerns/pageable2.rb +12 -0
- data/lib/chartmogul/customer.rb +26 -2
- data/lib/chartmogul/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 328c6007bb38235b2ba6105d29f2955bb937307b
|
4
|
+
data.tar.gz: cb707fb9b221b5fe83ebfb75ab4c7f86172f1666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb65cca1c49f24694f0afc6bf352dd3d9576b6d8828c3ae0ccdc8204de43bb9b287cbbe660f765ca11cdcbb820213bd14fa841417e9902e3ecb8981c8ccc4be9
|
7
|
+
data.tar.gz: 93deaa8c4a6a3eef1aadb18f6beff031d596ad6d81485f5a1eddfe7009927ad7c495e2b351c6d04d255b326f94af1fa156ca85b5104d9c686a60944ff5727e43
|
data/changelog.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# chartmogul-ruby Change Log
|
2
2
|
|
3
|
-
## Version 1.0.
|
3
|
+
## Version 1.0.1 - 21 February 2017
|
4
|
+
- Fixed all() in Customer, now returns Customers with paging
|
5
|
+
|
6
|
+
## Version 1.0.0 - 14 February 2017
|
4
7
|
- Add support for new plan and data source endpoints
|
5
8
|
- Remove deprecated Import namespace
|
6
9
|
|
@@ -147,8 +147,8 @@ http_interactions:
|
|
147
147
|
- max-age=15768000
|
148
148
|
body:
|
149
149
|
encoding: UTF-8
|
150
|
-
string: '{"
|
151
|
-
Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","lead_created_at":"2016-10-01T23:55:00.000Z","free_trial_started_at":"2016-10-12T11:12:00.000Z","data_source_uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa"}],"current_page":1,"total_pages":1}'
|
150
|
+
string: '{"entries":[{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
|
151
|
+
Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","lead_created_at":"2016-10-01T23:55:00.000Z","free_trial_started_at":"2016-10-12T11:12:00.000Z","data_source_uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa"}],"current_page":1,"total_pages":1,"has_more":false,"per_page":50,"page":1}'
|
152
152
|
http_version:
|
153
153
|
recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
|
154
154
|
- request:
|
@@ -238,7 +238,7 @@ http_interactions:
|
|
238
238
|
- max-age=15768000
|
239
239
|
body:
|
240
240
|
encoding: UTF-8
|
241
|
-
string: '{"customers":[],"current_page":1,"total_pages":0}'
|
241
|
+
string: '{"customers":[],"current_page":1,"total_pages":0,"has_more":false,"per_page":50,"page":1}'
|
242
242
|
http_version:
|
243
243
|
recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
|
244
244
|
recorded_with: VCR 3.0.3
|
@@ -95,7 +95,7 @@ http_interactions:
|
|
95
95
|
- max-age=15768000
|
96
96
|
body:
|
97
97
|
encoding: UTF-8
|
98
|
-
string: '{"
|
98
|
+
string: '{"entries":[{"uuid":"cus_c4babf63-3eb9-4125-8687-2a0d781b0af2","external_id":"X1234","name":"Test
|
99
99
|
Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85"}],"current_page":1,"total_pages":1}'
|
100
100
|
http_version:
|
101
101
|
recorded_at: Mon, 06 Jun 2016 15:26:40 GMT
|
data/lib/chartmogul.rb
CHANGED
@@ -34,6 +34,11 @@ require "chartmogul/line_items/subscription"
|
|
34
34
|
require "chartmogul/transactions/payment"
|
35
35
|
require "chartmogul/transactions/refund"
|
36
36
|
|
37
|
+
require "chartmogul/concerns/entries"
|
38
|
+
require "chartmogul/concerns/summary"
|
39
|
+
require "chartmogul/concerns/pageable"
|
40
|
+
require "chartmogul/concerns/pageable2"
|
41
|
+
|
37
42
|
require "chartmogul/subscription"
|
38
43
|
require "chartmogul/invoice"
|
39
44
|
require "chartmogul/customer_invoices"
|
@@ -42,10 +47,6 @@ require "chartmogul/data_source"
|
|
42
47
|
require "chartmogul/ping"
|
43
48
|
require "chartmogul/plan"
|
44
49
|
|
45
|
-
require "chartmogul/concerns/entries"
|
46
|
-
require "chartmogul/concerns/summary"
|
47
|
-
require "chartmogul/concerns/pageable"
|
48
|
-
|
49
50
|
require "chartmogul/metrics/arpa"
|
50
51
|
require "chartmogul/metrics/arr"
|
51
52
|
require "chartmogul/metrics/asp"
|
data/lib/chartmogul/customer.rb
CHANGED
@@ -2,7 +2,6 @@ module ChartMogul
|
|
2
2
|
class Customer < APIResource
|
3
3
|
set_resource_name 'Customer'
|
4
4
|
set_resource_path '/v1/customers'
|
5
|
-
set_resource_root_key :customers
|
6
5
|
|
7
6
|
readonly_attr :uuid
|
8
7
|
|
@@ -18,10 +17,17 @@ module ChartMogul
|
|
18
17
|
writeable_attr :lead_created_at, type: :time
|
19
18
|
writeable_attr :free_trial_started_at, type: :time
|
20
19
|
|
21
|
-
include API::Actions::All
|
22
20
|
include API::Actions::Create
|
23
21
|
include API::Actions::Destroy
|
24
22
|
|
23
|
+
def self.all(options = {})
|
24
|
+
Customers.all(options)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.search(email)
|
28
|
+
Customers.search(email)
|
29
|
+
end
|
30
|
+
|
25
31
|
def self.find_by_external_id(external_id)
|
26
32
|
all(external_id: external_id).first
|
27
33
|
end
|
@@ -37,5 +43,23 @@ module ChartMogul
|
|
37
43
|
def invoices=(invoices_array)
|
38
44
|
@invoices = ChartMogul::CustomerInvoices.new(customer_uuid: uuid, invoices: invoices_array)
|
39
45
|
end
|
46
|
+
|
47
|
+
|
48
|
+
class Customers < APIResource
|
49
|
+
set_resource_name 'Customers'
|
50
|
+
set_resource_path '/v1/customers'
|
51
|
+
|
52
|
+
include Concerns::Entries
|
53
|
+
include API::Actions::Custom
|
54
|
+
include Concerns::Pageable
|
55
|
+
include Concerns::Pageable2
|
56
|
+
|
57
|
+
set_entry_class Customer
|
58
|
+
|
59
|
+
def self.search(email)
|
60
|
+
path = ChartMogul::ResourcePath.new('/v1/customers/search')
|
61
|
+
custom!(:get, path.apply_with_get_params(email: email))
|
62
|
+
end
|
63
|
+
end
|
40
64
|
end
|
41
65
|
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.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Langenauer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- lib/chartmogul/api_resource.rb
|
174
174
|
- lib/chartmogul/concerns/entries.rb
|
175
175
|
- lib/chartmogul/concerns/pageable.rb
|
176
|
+
- lib/chartmogul/concerns/pageable2.rb
|
176
177
|
- lib/chartmogul/concerns/summary.rb
|
177
178
|
- lib/chartmogul/config_attributes.rb
|
178
179
|
- lib/chartmogul/configuration.rb
|