billimatic-client 0.10.1 → 0.10.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTc3NTUxNjYwZDM1ZTVkMGUxM2I1ZWJkZjY0MDk4YTcyYTlhZTMwZQ==
4
+ MTMwYjgwMjgxZDc0OWU3YjdiMjUyNDdmZWUzNDk5NTIyOWI4ZWViZQ==
5
5
  data.tar.gz: !binary |-
6
- OGExMzc2ZDcyM2RjNzRjMzYwYjA5MjE4YTU4NjVjNmIwMjA1MzE5OA==
6
+ MGY2NDc2NTMyMWRlZjdmM2Q0N2VlYjc3OGYxM2NiMjhlODBmYTVmZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDkwNGI2ZDEzNzE0MmNmODViYThiNTZlZmNiMTQ0ZTRlODcxMDYzYmFmYzcw
10
- MGU1ZTA0NjExNTc2ZWQwMDkzNWQzYmVlYTAyNDMwZDVlODM5MWEwOWU5YjU2
11
- MzYyZDMzNWIxMTA2OGMwYWZjYWVjOTk0YTRkOTUyM2M4YjM3ZjU=
9
+ MTg5ZTE0MWJlZTU2YmJmOTkwMDNkZDNiNDk2MzFmMDhlMjA3MjBjMWU1MDM2
10
+ MTVjNjFlMTBkY2EwZjAwNGU3ZTNkYjlmMGQ0OTdkYjRjNTJiNTJiZDVlMjdk
11
+ YjBjNDE0NmI1NjQyN2U4YTA1OTBhZGY2ZTU1MmQzNzAyZGI1ZmU=
12
12
  data.tar.gz: !binary |-
13
- ZTA1MjhkNmZmNjI3MGIwMGZhZjUwMzkyN2U1OTI4ZDRhYzkyMjkyM2Y2Nzk2
14
- YWQwODczYjRiOTJiNWQwZTIxNGNjNDlhYWQ4MzBlODVlNWJhZWE0YWMyNzkx
15
- OTMwMzVmMzUzMGJlNzNhYTdhYzkzOWY4YjY3ZTFiZGYzMzQ4MjY=
13
+ ZjU1ZjBiNDY4ZDJlMDBjZTA0ZWM3OTA1MzM0MjlhZDE5M2QyZTI0NTdjZTll
14
+ NDIyNWYyN2E1OGE0YWRkZTYxYTVhZjljZjJkMDJkZDk0MjFkMmNiZWIzMjM0
15
+ MTJjYzFiZTgxMjAzNDA2MDBhNTQzNzFmODU2MjQ4NjJkNGZmODc=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- billimatic-client (0.10.1)
4
+ billimatic-client (0.10.2)
5
5
  multi_json (~> 1.11)
6
6
  typhoeus (~> 0.8)
7
7
  virtus (~> 1.0.5)
@@ -25,7 +25,7 @@ GEM
25
25
  diff-lcs (1.2.5)
26
26
  docile (1.1.5)
27
27
  equalizer (0.0.11)
28
- ethon (0.9.0)
28
+ ethon (0.10.1)
29
29
  ffi (>= 1.3.0)
30
30
  ffi (1.9.14)
31
31
  formatador (0.2.5)
data/README.md CHANGED
@@ -237,7 +237,11 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
237
237
  </a>
238
238
  </td>
239
239
  <td>
240
- <code>client.subscriptions.cancel(token: token)</code>
240
+ <code>
241
+ # cancel_date and cancel_reason are optional arguments
242
+ <br>
243
+ client.subscriptions.cancel(token: token, cancel_date: date, cancel_reason: reason)
244
+ </code>
241
245
  </td>
242
246
  </tr>
243
247
  </table>
@@ -18,6 +18,7 @@ module Billimatic
18
18
  attribute :billing_contacts, String
19
19
  attribute :comments, String
20
20
  attribute :kind, String
21
+ attribute :client_since, Date
21
22
  attribute :created_at, DateTime
22
23
  end
23
24
  end
@@ -20,6 +20,8 @@ module Billimatic
20
20
  attribute :overdue, Boolean
21
21
  attribute :valid_until, Date
22
22
  attribute :status, String
23
+ attribute :cancel_date, Date
24
+ attribute :cancel_reason, String
23
25
  attribute :plan, Plan
24
26
  end
25
27
  end
@@ -35,8 +35,11 @@ module Billimatic
35
35
  end
36
36
  end
37
37
 
38
- def cancel(token:)
39
- http.patch("#{resource_base_path}/#{token}/cancel") do |response|
38
+ def cancel(token:, cancel_date: nil, cancel_reason: nil)
39
+ http.patch(
40
+ "#{resource_base_path}/#{token}/cancel",
41
+ body: { subscription: { cancel_date: cancel_date, cancel_reason: cancel_reason } }
42
+ ) do |response|
40
43
  respond_with_entity response
41
44
  end
42
45
  end
@@ -1,3 +1,3 @@
1
1
  module Billimatic
2
- VERSION = '0.10.1'
2
+ VERSION = '0.10.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billimatic-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tassinari de Oliveira
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-12-06 00:00:00.000000000 Z
13
+ date: 2016-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus