chartmogul-ruby 1.1.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd14d80ca5ef6ec9a672747aa43aa42c3c2273d6
4
- data.tar.gz: eff41878d6cdf81a006ab2870389aae11846651b
3
+ metadata.gz: 21efeff5365e244f2e13a75f69612e4213891c0f
4
+ data.tar.gz: 266640ac24ab1171820a873f52cfc6922e6d9dea
5
5
  SHA512:
6
- metadata.gz: 786c4423ba62345bf5c66a71e8c13ca68a2dbd0fc5349ebf78b943e3fcc04df4f8a269efe1723821922add7c0912f35bdc0b8ca2c33926800d3b1b98eafe1d78
7
- data.tar.gz: 97e57e5a0590f2ec2cdda4219980e6686c567e6555dde5358089b30018a9358370dd032dd450cc34f00850a4c7a5a122eea0ab308b35f133ed68c2def84ebb5a
6
+ metadata.gz: c6a6f337cb045730d283db6761cedd6724469bff03cb56348620916b90da84284ba300d98006c8d75fbffe61b257a1cc6b13d1c84255c439e11d33632f06a4ff
7
+ data.tar.gz: 515fff807456b09fdbff72a4b2db513ce45deafed4b8fc2f7b96d046f86c6c6b4293266813a8908b219713d69e47c67e8a1ed496dde7f26be736da41d1c6d872
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/invoices?external_id=invoice_eid&per_page=10
6
+ body:
7
+ encoding: US-ASCII
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:45:27 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '1297'
29
+ connection:
30
+ - close
31
+ vary:
32
+ - Accept-Encoding
33
+ status:
34
+ - 200 OK
35
+ access-control-allow-credentials:
36
+ - 'true'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"invoices":[{"date":"2016-01-01 12:00:00 +0000","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id","plan_uuid":"pl_209e4674-1258-4a35-8378-9b15c4086965","service_period_start":"2016-01-01
40
+ 12:00:00 +0000","service_period_end":"2016-02-01 12:00:00 +0000","amount_in_cents":1000,"cancelled_at":"2016-01-15
41
+ 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
42
+ 12:00:00 +0000","result":"successful","external_id":"test_cus_tr_ext_id"}],"external_id":"invoice_eid","due_date":"2016-01-07
43
+ 12:00:00 +0000","customer_uuid":"customer_uuid"}]}'
44
+ http_version:
45
+ recorded_at: Wed, 29 Jun 2016 12:45:27 GMT
46
+ recorded_with: VCR 3.0.3
@@ -1,6 +1,7 @@
1
1
  module ChartMogul
2
2
  class Invoice < ChartMogul::Object
3
3
  readonly_attr :uuid
4
+ readonly_attr :customer_uuid
4
5
 
5
6
  writeable_attr :date, type: :time
6
7
  writeable_attr :currency
@@ -58,5 +59,20 @@ module ChartMogul
58
59
  when 'refund' then ChartMogul::Transactions::Refund
59
60
  end
60
61
  end
62
+
63
+ def self.all(options = {})
64
+ Invoices.all(options)
65
+ end
66
+ end
67
+ class Invoices < APIResource
68
+ set_resource_name 'Invoices'
69
+ set_resource_path '/v1/invoices'
70
+
71
+ set_resource_root_key :invoices
72
+
73
+ include Concerns::Entries
74
+ include Concerns::Pageable2
75
+
76
+ set_entry_class Invoice
61
77
  end
62
78
  end
@@ -1,3 +1,3 @@
1
1
  module ChartMogul
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
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.1.0
4
+ version: 1.1.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-04-12 00:00:00.000000000 Z
11
+ date: 2017-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -135,6 +135,7 @@ files:
135
135
  - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml
136
136
  - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml
137
137
  - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml
138
+ - fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml
138
139
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
139
140
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml
140
141
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml