boletosimples 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 490d1c76e70d03fec1a8578e593b6a18e6c58f1e
4
- data.tar.gz: ffc415cf01929b2237ce2dc928460973cda9516c
3
+ metadata.gz: e005560ecb83c538c2c8e0df87e1e26cfa2fef3f
4
+ data.tar.gz: f0994131f188139acfdcfdef6aa8f0d1ce183e54
5
5
  SHA512:
6
- metadata.gz: 9bd04063532e772ab874480ce21af8c8a6108b2649857062ea4aed159586078a96c76b492c03412c099d025fd1d9812745f5fea3c6440f4021a8b03cda1b8125
7
- data.tar.gz: c6aaa930072ad9c2d954c5b5f400496aaba2ee25426f8b999634db769526080f8d5becdbc76b4d64168cb7f34a791e96d9911ded6a7ccae96aa14860f33ed541
6
+ metadata.gz: e685ae865d456aadb881b6f1b3fb77897d912614ae58547143d451fd8ec0b54a7551516c617aa27cf81635beacc41339550dca0d697be8e630e7c3f9b2ec2895
7
+ data.tar.gz: c4baa1f2604a60208f3de20425b4d3b1d702ad0ea131ec846c4579bdc2be6eb55510eec54163f3cba991b4a9b67f209c8c61afa97f22f157d487263d245084df
@@ -2,7 +2,7 @@ module BoletoSimples
2
2
  class CustomerSubscription < BaseModel
3
3
 
4
4
  def next_charge
5
- self.class.request(:_method => :post, :_path => self.class.build_request_path('customer_subscription_subscriptions/:id/next_charge', {self.class.primary_key => id})) do |parsed_data, response|
5
+ self.class.request(:_method => :post, :_path => self.class.build_request_path('customer_subscriptions/:id/next_charge', {self.class.primary_key => id})) do |parsed_data, response|
6
6
  assign_attributes(self.class.parse(parsed_data[:data])) if parsed_data[:data].any?
7
7
  @metadata = parsed_data[:metadata]
8
8
  @response_errors = parsed_data[:errors]
@@ -11,4 +11,4 @@ module BoletoSimples
11
11
  return @response.success?
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module BoletoSimples
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -56,5 +56,11 @@ RSpec.describe BoletoSimples::CustomerSubscription do
56
56
  subject { BoletoSimples::CustomerSubscription.all }
57
57
  it { expect(subject.first).to be_a_kind_of(BoletoSimples::CustomerSubscription) }
58
58
  end
59
+ describe 'cancel' do
60
+ context 'success', vcr: { cassette_name: 'resources/customer_subscription/next_charge'} do
61
+ subject { BoletoSimples::CustomerSubscription.find(@customer_subscription.id) }
62
+ it { expect(subject.next_charge).to be_truthy }
63
+ end
64
+ end
59
65
  end
60
66
  end
@@ -0,0 +1,165 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/customer_subscriptions/4?access_token=BOLETOSIMPLES_ACCESS_TOKEN
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - BoletoSimples Ruby Client v0.4.0 (contato@boletosimples.com.br)
12
+ Authorization:
13
+ - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Connection:
24
+ - keep-alive
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Status:
30
+ - 200 OK
31
+ Cache-Control:
32
+ - must-revalidate, private, max-age=0
33
+ X-Ratelimit-Limit:
34
+ - '500'
35
+ Date:
36
+ - Mon, 15 Aug 2016 19:49:45 GMT
37
+ Strict-Transport-Security:
38
+ - max-age=631138519
39
+ X-Ratelimit-Remaining:
40
+ - '488'
41
+ Vary:
42
+ - Accept-Encoding
43
+ X-Permitted-Cross-Domain-Policies:
44
+ - none
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ X-Request-Id:
48
+ - 23eb19bc-5949-432f-9f51-68298fcb5dc7
49
+ Content-Security-Policy-Report-Only:
50
+ - 'default-src ''self''; child-src ''self'' www.googleadservices.com googleads.g.doubleclick.net
51
+ www.google.com; connect-src ws: wss: *.intercom.io ws.pusherapp.com hn.inspectlet.com
52
+ stats.pusher.com; font-src ''self'' fonts.googleapis.com fonts.gstatic.com
53
+ data:; img-src ''self'' https: data:; script-src ''self'' static.intercomcdn.com
54
+ cdn.inspectlet.com widget.intercom.io js.intercomcdn.com js.pusher.com stats.pusher.com
55
+ zapier.com www.google-analytics.com www.googleadservices.com i.kissmetrics.com
56
+ doug1izaerwt3.cloudfront.net app.popupdomination.com cdn.ywxi.net www.draw.io;
57
+ style-src ''self'' fonts.googleapis.com; report-uri https://boletosimples.report-uri.io/r/default/csp/reportOnly'
58
+ Location:
59
+ - https://sandbox.boletosimples.com.br/api/v1/customer_subscriptions/4
60
+ X-Download-Options:
61
+ - noopen
62
+ Etag:
63
+ - W/"fc1c5eee3b0e21014ab204a47d329184"
64
+ X-Runtime:
65
+ - '0.895405'
66
+ X-Frame-Options:
67
+ - sameorigin
68
+ X-Content-Type-Options:
69
+ - nosniff
70
+ X-Rack-Cache:
71
+ - miss
72
+ X-Powered-By:
73
+ - Phusion Passenger 5.0.30
74
+ Server:
75
+ - nginx/1.10.1 + Phusion Passenger 5.0.30
76
+ Via:
77
+ - 1.1 vegur
78
+ body:
79
+ encoding: UTF-8
80
+ string: '{"id":4,"amount":1120.4,"cycle":"monthly","next_billing":"2016-09-15","end_at":null,"instructions":null,"customer_id":11,"description":"Hospedagem","created_at":"2016-08-15","updated_at":"2016-08-15","created_via_api":true,"days_in_advance":7,"bank_billet_account_id":12}'
81
+ http_version:
82
+ recorded_at: Mon, 15 Aug 2016 19:49:45 GMT
83
+ - request:
84
+ method: post
85
+ uri: https://sandbox.boletosimples.com.br/api/v1/customer_subscriptions/4/next_charge?access_token=BOLETOSIMPLES_ACCESS_TOKEN
86
+ body:
87
+ encoding: UTF-8
88
+ string: "{}"
89
+ headers:
90
+ User-Agent:
91
+ - BoletoSimples Ruby Client v0.4.0 (contato@boletosimples.com.br)
92
+ Authorization:
93
+ - Token token="BOLETOSIMPLES_ACCESS_TOKEN"
94
+ Content-Type:
95
+ - application/json
96
+ Accept-Encoding:
97
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
98
+ Accept:
99
+ - "*/*"
100
+ response:
101
+ status:
102
+ code: 201
103
+ message: Created
104
+ headers:
105
+ Connection:
106
+ - keep-alive
107
+ Content-Type:
108
+ - application/json; charset=utf-8
109
+ Transfer-Encoding:
110
+ - chunked
111
+ Status:
112
+ - 201 Created
113
+ Cache-Control:
114
+ - max-age=0, private, must-revalidate
115
+ X-Ratelimit-Limit:
116
+ - '500'
117
+ Date:
118
+ - Mon, 15 Aug 2016 19:49:47 GMT
119
+ Strict-Transport-Security:
120
+ - max-age=631138519
121
+ X-Ratelimit-Remaining:
122
+ - '487'
123
+ Vary:
124
+ - Accept-Encoding
125
+ X-Permitted-Cross-Domain-Policies:
126
+ - none
127
+ X-Xss-Protection:
128
+ - 1; mode=block
129
+ X-Request-Id:
130
+ - 725dd915-8c35-4bfc-b4ce-efe477de6b7c
131
+ Content-Security-Policy-Report-Only:
132
+ - 'default-src ''self''; child-src ''self'' www.googleadservices.com googleads.g.doubleclick.net
133
+ www.google.com; connect-src ws: wss: *.intercom.io ws.pusherapp.com hn.inspectlet.com
134
+ stats.pusher.com; font-src ''self'' fonts.googleapis.com fonts.gstatic.com
135
+ data:; img-src ''self'' https: data:; script-src ''self'' static.intercomcdn.com
136
+ cdn.inspectlet.com widget.intercom.io js.intercomcdn.com js.pusher.com stats.pusher.com
137
+ zapier.com www.google-analytics.com www.googleadservices.com i.kissmetrics.com
138
+ doug1izaerwt3.cloudfront.net app.popupdomination.com cdn.ywxi.net www.draw.io;
139
+ style-src ''self'' fonts.googleapis.com; report-uri https://boletosimples.report-uri.io/r/default/csp/reportOnly'
140
+ Location:
141
+ - https://sandbox.boletosimples.com.br/api/v1/customer_subscriptions/4
142
+ X-Download-Options:
143
+ - noopen
144
+ Etag:
145
+ - W/"591a0ffde1eb3b777bde3859ce549303"
146
+ X-Runtime:
147
+ - '1.538429'
148
+ X-Frame-Options:
149
+ - sameorigin
150
+ X-Content-Type-Options:
151
+ - nosniff
152
+ X-Rack-Cache:
153
+ - invalidate, pass
154
+ X-Powered-By:
155
+ - Phusion Passenger 5.0.30
156
+ Server:
157
+ - nginx/1.10.1 + Phusion Passenger 5.0.30
158
+ Via:
159
+ - 1.1 vegur
160
+ body:
161
+ encoding: UTF-8
162
+ string: '{"id":4,"amount":1120.4,"cycle":"monthly","next_billing":"2016-10-15","end_at":null,"instructions":null,"customer_id":11,"description":"Hospedagem","created_at":"2016-08-15","updated_at":"2016-08-15","created_via_api":true,"days_in_advance":7,"bank_billet_account_id":12}'
163
+ http_version:
164
+ recorded_at: Mon, 15 Aug 2016 19:49:47 GMT
165
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boletosimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kivanio Barbosa
@@ -252,6 +252,7 @@ files:
252
252
  - spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml
253
253
  - spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml
254
254
  - spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml
255
+ - spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml
255
256
  - spec/fixtures/vcr_cassettes/resources/discharge/all.yml
256
257
  - spec/fixtures/vcr_cassettes/resources/event/all.yml
257
258
  - spec/fixtures/vcr_cassettes/resources/installment/all.yml
@@ -334,6 +335,7 @@ test_files:
334
335
  - spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml
335
336
  - spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml
336
337
  - spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml
338
+ - spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml
337
339
  - spec/fixtures/vcr_cassettes/resources/discharge/all.yml
338
340
  - spec/fixtures/vcr_cassettes/resources/event/all.yml
339
341
  - spec/fixtures/vcr_cassettes/resources/installment/all.yml