boletosimples 0.0.6 → 0.0.7

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +14 -0
  4. data/boletosimples.gemspec +3 -1
  5. data/example/access_token_example.rb +29 -4
  6. data/example/oauth_example.rb +28 -4
  7. data/lib/boletosimples/client.rb +11 -4
  8. data/lib/boletosimples/version.rb +1 -1
  9. data/spec/boletosimples/client_spec.rb +407 -4
  10. data/spec/boletosimples/oauth_client_spec.rb +6 -3
  11. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/existing_bank_billet.yml +61 -0
  12. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/not_found.yml +44 -0
  13. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billets.yml +63 -0
  14. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/already_canceled.yml +58 -0
  15. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_invalid_bank_billet.yml +54 -0
  16. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_valid_bank_billet.yml +71 -0
  17. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_invalid_data.yml +64 -0
  18. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_valid_data.yml +66 -0
  19. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_invalid_data.yml +59 -0
  20. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_valid_data.yml +61 -0
  21. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/existing_customer.yml +57 -0
  22. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/not_found.yml +58 -0
  23. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customers.yml +59 -0
  24. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_transactions.yml +67 -0
  25. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication.yml +56 -0
  26. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication/.yml +56 -0
  27. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication.yml +54 -0
  28. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication/.yml +54 -0
  29. data/spec/fixtures/vcr_cassettes/BoletoSimples_OAuthClient/_userinfo/without_authentication/.yml +62 -0
  30. data/spec/spec_helper.rb +18 -0
  31. data/spec/support/vcr.rb +7 -0
  32. metadata +72 -2
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/userinfo?access_token=
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ User-Agent:
13
+ - Meu e-Commerce (meuecommerce@example.com)
14
+ response:
15
+ status:
16
+ code: 401
17
+ message: Unauthorized
18
+ headers:
19
+ Server:
20
+ - Cowboy
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Fri, 24 Oct 2014 16:53:01 GMT
25
+ Status:
26
+ - 401 Unauthorized
27
+ Strict-Transport-Security:
28
+ - max-age=2592000
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Www-Authenticate:
36
+ - Basic realm="Boleto Simples"
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Cache-Control:
40
+ - no-cache
41
+ X-Request-Id:
42
+ - 11e5d0ee-1ecd-4e0f-9d91-6bd3ae9e811d
43
+ X-Runtime:
44
+ - '0.211845'
45
+ Via:
46
+ - 1.1 vegur
47
+ body:
48
+ encoding: ASCII-8BIT
49
+ string: !binary |-
50
+ eyJlcnJvciI6IlZvY8OqIHByZWNpc2Egc2UgbG9nYXIgb3UgcmVnaXN0cmFy
51
+ IGFudGVzIGRlIHByb3NzZWd1aXIuIn0=
52
+ http_version:
53
+ recorded_at: Fri, 24 Oct 2014 16:53:01 GMT
54
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/userinfo?access_token=
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ User-Agent:
13
+ - Meu e-Commerce (meuecommerce@example.com)
14
+ response:
15
+ status:
16
+ code: 401
17
+ message: Unauthorized
18
+ headers:
19
+ Server:
20
+ - Cowboy
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Fri, 24 Oct 2014 17:15:08 GMT
25
+ Status:
26
+ - 401 Unauthorized
27
+ Strict-Transport-Security:
28
+ - max-age=2592000
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Www-Authenticate:
36
+ - Basic realm="Boleto Simples"
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Cache-Control:
40
+ - no-cache
41
+ X-Request-Id:
42
+ - 91a925ba-63da-4a1a-ba8a-9e790f77a81a
43
+ X-Runtime:
44
+ - '0.019146'
45
+ Via:
46
+ - 1.1 vegur
47
+ body:
48
+ encoding: ASCII-8BIT
49
+ string: !binary |-
50
+ eyJlcnJvciI6IlZvY8OqIHByZWNpc2Egc2UgbG9nYXIgb3UgcmVnaXN0cmFy
51
+ IGFudGVzIGRlIHByb3NzZWd1aXIuIn0=
52
+ http_version:
53
+ recorded_at: Fri, 24 Oct 2014 17:15:08 GMT
54
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.boletosimples.com.br/api/v1/userinfo
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Meu e-Commerce (meuecommerce@example.com)
12
+ Accept-Charset:
13
+ - UTF-8
14
+ Content-Type:
15
+ - application/json
16
+ Authorization:
17
+ - Bearer invalid-token
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: 401
25
+ message: Unauthorized
26
+ headers:
27
+ Server:
28
+ - Cowboy
29
+ Connection:
30
+ - close
31
+ Date:
32
+ - Fri, 24 Oct 2014 16:53:02 GMT
33
+ Status:
34
+ - 401 Unauthorized
35
+ Strict-Transport-Security:
36
+ - max-age=2592000
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Xss-Protection:
40
+ - 1; mode=block
41
+ X-Content-Type-Options:
42
+ - nosniff
43
+ Www-Authenticate:
44
+ - Basic realm="Boleto Simples"
45
+ Content-Type:
46
+ - application/json; charset=utf-8
47
+ Cache-Control:
48
+ - no-cache
49
+ X-Request-Id:
50
+ - d23b7940-c389-45f4-a468-ec8d488862c8
51
+ X-Runtime:
52
+ - '0.081793'
53
+ Via:
54
+ - 1.1 vegur
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: !binary |-
58
+ eyJlcnJvciI6IlZvY8OqIHByZWNpc2Egc2UgbG9nYXIgb3UgcmVnaXN0cmFy
59
+ IGFudGVzIGRlIHByb3NzZWd1aXIuIn0=
60
+ http_version:
61
+ recorded_at: Fri, 24 Oct 2014 16:53:02 GMT
62
+ recorded_with: VCR 2.9.3
data/spec/spec_helper.rb CHANGED
@@ -10,6 +10,24 @@ require 'rspec'
10
10
  require 'pry'
11
11
  require 'boletosimples'
12
12
 
13
+ RSpec.configure do |config|
14
+ config.disable_monkey_patching!
15
+ config.order = :random
16
+ Kernel.srand config.seed
17
+ config.filter_run focus: true
18
+ config.run_all_when_everything_filtered = true
19
+ config.expect_with :rspec do |expectations|
20
+ expectations.syntax = :expect
21
+ end
22
+ config.mock_with :rspec do |mocks|
23
+ mocks.syntax = :expect
24
+ mocks.verify_partial_doubles = true
25
+ end
26
+ if config.files_to_run.one?
27
+ config.default_formatter = 'doc'
28
+ end
29
+ end
30
+
13
31
  # Requires supporting files with custom matchers and macros, etc,
14
32
  # in ./support/ and its subdirectories.
15
33
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,7 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
5
+ c.hook_into :webmock
6
+ c.configure_rspec_metadata!
7
+ end
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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kivanio Barbosa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-10 00:00:00.000000000 Z
13
+ date: 2014-12-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -70,6 +70,34 @@ dependencies:
70
70
  version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rspec
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '3.1'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '3.1'
85
+ - !ruby/object:Gem::Dependency
86
+ name: vcr
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '2.9'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
97
+ - !ruby/object:Gem::Version
98
+ version: '2.9'
99
+ - !ruby/object:Gem::Dependency
100
+ name: webmock
73
101
  requirement: !ruby/object:Gem::Requirement
74
102
  requirements:
75
103
  - - ">="
@@ -138,6 +166,7 @@ files:
138
166
  - ".ruby-gemset"
139
167
  - ".ruby-version"
140
168
  - ".travis.yml"
169
+ - CHANGELOG.md
141
170
  - Gemfile
142
171
  - LICENSE.txt
143
172
  - README.md
@@ -152,8 +181,28 @@ files:
152
181
  - lib/oauth2_patch.rb
153
182
  - spec/boletosimples/client_spec.rb
154
183
  - spec/boletosimples/oauth_client_spec.rb
184
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/existing_bank_billet.yml
185
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/not_found.yml
186
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billets.yml
187
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/already_canceled.yml
188
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_invalid_bank_billet.yml
189
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_valid_bank_billet.yml
190
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_invalid_data.yml
191
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_valid_data.yml
192
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_invalid_data.yml
193
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_valid_data.yml
194
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/existing_customer.yml
195
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/not_found.yml
196
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customers.yml
197
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_transactions.yml
198
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication.yml
199
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication/.yml
200
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication.yml
201
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication/.yml
202
+ - spec/fixtures/vcr_cassettes/BoletoSimples_OAuthClient/_userinfo/without_authentication/.yml
155
203
  - spec/spec.opts
156
204
  - spec/spec_helper.rb
205
+ - spec/support/vcr.rb
157
206
  homepage: https://boletosimples.com.br
158
207
  licenses: []
159
208
  metadata: {}
@@ -180,5 +229,26 @@ summary: An easy way to charge by bank billet.
180
229
  test_files:
181
230
  - spec/boletosimples/client_spec.rb
182
231
  - spec/boletosimples/oauth_client_spec.rb
232
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/existing_bank_billet.yml
233
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/not_found.yml
234
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billets.yml
235
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/already_canceled.yml
236
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_invalid_bank_billet.yml
237
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_valid_bank_billet.yml
238
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_invalid_data.yml
239
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_valid_data.yml
240
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_invalid_data.yml
241
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_valid_data.yml
242
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/existing_customer.yml
243
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/not_found.yml
244
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customers.yml
245
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_transactions.yml
246
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication.yml
247
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication/.yml
248
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication.yml
249
+ - spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication/.yml
250
+ - spec/fixtures/vcr_cassettes/BoletoSimples_OAuthClient/_userinfo/without_authentication/.yml
183
251
  - spec/spec.opts
184
252
  - spec/spec_helper.rb
253
+ - spec/support/vcr.rb
254
+ has_rdoc: