boletosimples 0.0.7 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/README.md +156 -3
  4. data/boletosimples.gemspec +9 -9
  5. data/lib/boletosimples.rb +38 -4
  6. data/lib/boletosimples/configuration.rb +69 -0
  7. data/lib/boletosimples/extra.rb +8 -0
  8. data/lib/boletosimples/last_request.rb +43 -0
  9. data/lib/boletosimples/middlewares/last_request.rb +9 -0
  10. data/lib/boletosimples/middlewares/raise_error.rb +11 -0
  11. data/lib/boletosimples/middlewares/user_agent.rb +10 -0
  12. data/lib/boletosimples/resources/bank_billet.rb +13 -0
  13. data/lib/boletosimples/resources/base_model.rb +8 -0
  14. data/lib/boletosimples/resources/customer.rb +4 -0
  15. data/lib/boletosimples/resources/partner/user.rb +7 -0
  16. data/lib/boletosimples/resources/transaction.rb +4 -0
  17. data/lib/boletosimples/response_error.rb +43 -0
  18. data/lib/boletosimples/version.rb +1 -1
  19. data/spec/boletosimples/configuration_spec.rb +84 -0
  20. data/spec/boletosimples/extra_spec.rb +31 -0
  21. data/spec/boletosimples/last_request_spec.rb +34 -0
  22. data/spec/boletosimples/resources/bank_billet_spec.rb +75 -0
  23. data/spec/boletosimples/resources/customer_spec.rb +66 -0
  24. data/spec/boletosimples/resources/partner/user_spec.rb +19 -0
  25. data/spec/boletosimples/resources/transactions_spec.rb +17 -0
  26. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +64 -0
  27. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +56 -0
  28. data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +58 -0
  29. data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +54 -0
  30. data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +129 -0
  31. data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +58 -0
  32. data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +132 -0
  33. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel.yml +125 -0
  34. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +61 -0
  35. data/spec/fixtures/vcr_cassettes/{BoletoSimples_Client/_cancel_bank_billet/already_canceled.yml → resources/bank_billet/create/invalid_root.yml} +24 -24
  36. data/spec/fixtures/vcr_cassettes/{BoletoSimples_Client/_create_bank_billet/with_valid_data.yml → resources/bank_billet/create/valid.yml} +32 -28
  37. data/spec/fixtures/vcr_cassettes/{BoletoSimples_Client/_bank_billet/existing_bank_billet.yml → resources/bank_billet/find.yml} +30 -28
  38. data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +72 -0
  39. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +59 -0
  40. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +58 -0
  41. data/spec/fixtures/vcr_cassettes/{BoletoSimples_Client/_create_customer/with_valid_data.yml → resources/customer/create/valid.yml} +30 -26
  42. data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +59 -0
  43. data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +60 -0
  44. data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +62 -0
  45. data/spec/spec_helper.rb +10 -0
  46. data/spec/support/vcr.rb +8 -0
  47. metadata +97 -80
  48. data/example/access_token_example.rb +0 -79
  49. data/example/oauth_example.rb +0 -126
  50. data/lib/boletosimples/client.rb +0 -100
  51. data/lib/boletosimples/oauth_client.rb +0 -74
  52. data/spec/boletosimples/client_spec.rb +0 -415
  53. data/spec/boletosimples/oauth_client_spec.rb +0 -17
  54. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billet/not_found.yml +0 -44
  55. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_bank_billets.yml +0 -63
  56. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_invalid_bank_billet.yml +0 -54
  57. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_cancel_bank_billet/with_valid_bank_billet.yml +0 -71
  58. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_bank_billet/with_invalid_data.yml +0 -64
  59. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_create_customer/with_invalid_data.yml +0 -59
  60. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/existing_customer.yml +0 -57
  61. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customer/not_found.yml +0 -58
  62. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_customers.yml +0 -59
  63. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_transactions.yml +0 -67
  64. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication.yml +0 -56
  65. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/with_authentication/.yml +0 -56
  66. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication.yml +0 -54
  67. data/spec/fixtures/vcr_cassettes/BoletoSimples_Client/_userinfo/without_authentication/.yml +0 -54
  68. data/spec/fixtures/vcr_cassettes/BoletoSimples_OAuthClient/_userinfo/without_authentication/.yml +0 -62
data/spec/spec_helper.rb CHANGED
@@ -10,6 +10,16 @@ require 'rspec'
10
10
  require 'pry'
11
11
  require 'boletosimples'
12
12
 
13
+ if(ENV['BOLETOSIMPLES_ACCESS_TOKEN'].nil?)
14
+ puts "\e[31mWarning: Environment variable BOLETOSIMPLES_ACCESS_TOKEN is not set. Tests will run and pass, but if you delete vcr cassettes you need to set this variable before running tests.\e[0m"
15
+ ENV['BOLETOSIMPLES_ACCESS_TOKEN'] = 'any-token'
16
+ end
17
+
18
+ if(ENV['BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN'].nil?)
19
+ puts "\e[31mWarning: Environment variable BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN is not set. Tests will run and pass, but if you delete vcr cassettes you need to set this variable before running tests.\e[0m"
20
+ ENV['BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN'] = 'any-token'
21
+ end
22
+
13
23
  RSpec.configure do |config|
14
24
  config.disable_monkey_patching!
15
25
  config.order = :random
data/spec/support/vcr.rb CHANGED
@@ -4,4 +4,12 @@ VCR.configure do |c|
4
4
  c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
5
5
  c.hook_into :webmock
6
6
  c.configure_rspec_metadata!
7
+ c.ignore_hosts 'codeclimate.com'
8
+ c.before_record do |i|
9
+ i.response.body.force_encoding('UTF-8')
10
+ end
11
+ c.filter_sensitive_data('BOLETOSIMPLES_APP_ID') { ENV['BOLETOSIMPLES_APP_ID'] }
12
+ c.filter_sensitive_data('BOLETOSIMPLES_APP_SECRET') { ENV['BOLETOSIMPLES_APP_SECRET'] }
13
+ c.filter_sensitive_data('BOLETOSIMPLES_ACCESS_TOKEN') { ENV['BOLETOSIMPLES_ACCESS_TOKEN'] }
14
+ c.filter_sensitive_data('BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN') { ENV['BOLETOSIMPLES_CLIENT_CREDENTIALS_TOKEN'] }
7
15
  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.7
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kivanio Barbosa
@@ -10,78 +10,78 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-05 00:00:00.000000000 Z
13
+ date: 2015-03-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: httparty
16
+ name: her
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 0.13.1
21
+ version: 0.7.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 0.13.1
28
+ version: 0.7.3
29
29
  - !ruby/object:Gem::Dependency
30
- name: multi_json
30
+ name: faraday_middleware
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 1.10.1
35
+ version: 0.9.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 1.10.1
42
+ version: 0.9.1
43
43
  - !ruby/object:Gem::Dependency
44
- name: oauth2
44
+ name: faraday-http-cache
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 1.0.0
49
+ version: 1.0.1
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: 1.0.0
56
+ version: 1.0.1
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: pry
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ">="
61
+ - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '0'
63
+ version: 0.10.1
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ">="
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '0'
70
+ version: 0.10.1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rspec
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: '3.1'
77
+ version: 3.2.0
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: '3.1'
84
+ version: 3.2.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: vcr
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -100,58 +100,58 @@ dependencies:
100
100
  name: webmock
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
103
+ - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '0'
105
+ version: 1.20.4
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ">="
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '0'
112
+ version: 1.20.4
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rake
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ">="
117
+ - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '0'
119
+ version: 10.4.2
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ">="
124
+ - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: '0'
126
+ version: 10.4.2
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: coveralls
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ">="
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: '0'
133
+ version: 0.7.11
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ">="
138
+ - - "~>"
139
139
  - !ruby/object:Gem::Version
140
- version: '0'
140
+ version: 0.7.11
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: codeclimate-test-reporter
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">="
145
+ - - "~>"
146
146
  - !ruby/object:Gem::Version
147
- version: '0'
147
+ version: 0.4.7
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ">="
152
+ - - "~>"
153
153
  - !ruby/object:Gem::Version
154
- version: '0'
154
+ version: 0.4.7
155
155
  description: An easy way to charge by bank billet.
156
156
  email:
157
157
  - kivanio@gmail.com
@@ -172,34 +172,47 @@ files:
172
172
  - README.md
173
173
  - Rakefile
174
174
  - boletosimples.gemspec
175
- - example/access_token_example.rb
176
- - example/oauth_example.rb
177
175
  - lib/boletosimples.rb
178
- - lib/boletosimples/client.rb
179
- - lib/boletosimples/oauth_client.rb
176
+ - lib/boletosimples/configuration.rb
177
+ - lib/boletosimples/extra.rb
178
+ - lib/boletosimples/last_request.rb
179
+ - lib/boletosimples/middlewares/last_request.rb
180
+ - lib/boletosimples/middlewares/raise_error.rb
181
+ - lib/boletosimples/middlewares/user_agent.rb
182
+ - lib/boletosimples/resources/bank_billet.rb
183
+ - lib/boletosimples/resources/base_model.rb
184
+ - lib/boletosimples/resources/customer.rb
185
+ - lib/boletosimples/resources/partner/user.rb
186
+ - lib/boletosimples/resources/transaction.rb
187
+ - lib/boletosimples/response_error.rb
180
188
  - lib/boletosimples/version.rb
181
189
  - lib/oauth2_patch.rb
182
- - spec/boletosimples/client_spec.rb
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
190
+ - spec/boletosimples/configuration_spec.rb
191
+ - spec/boletosimples/extra_spec.rb
192
+ - spec/boletosimples/last_request_spec.rb
193
+ - spec/boletosimples/resources/bank_billet_spec.rb
194
+ - spec/boletosimples/resources/customer_spec.rb
195
+ - spec/boletosimples/resources/partner/user_spec.rb
196
+ - spec/boletosimples/resources/transactions_spec.rb
197
+ - spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml
198
+ - spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml
199
+ - spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml
200
+ - spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml
201
+ - spec/fixtures/vcr_cassettes/last_request/bank_billets.yml
202
+ - spec/fixtures/vcr_cassettes/last_request/userinfo.yml
203
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml
204
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/cancel.yml
205
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml
206
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml
207
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml
208
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml
209
+ - spec/fixtures/vcr_cassettes/resources/customer/all.yml
210
+ - spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml
211
+ - spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml
212
+ - spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml
213
+ - spec/fixtures/vcr_cassettes/resources/customer/find.yml
214
+ - spec/fixtures/vcr_cassettes/resources/partner/user/create.yml
215
+ - spec/fixtures/vcr_cassettes/resources/transaction/all.yml
203
216
  - spec/spec.opts
204
217
  - spec/spec_helper.rb
205
218
  - spec/support/vcr.rb
@@ -227,28 +240,32 @@ signing_key:
227
240
  specification_version: 4
228
241
  summary: An easy way to charge by bank billet.
229
242
  test_files:
230
- - spec/boletosimples/client_spec.rb
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
243
+ - spec/boletosimples/configuration_spec.rb
244
+ - spec/boletosimples/extra_spec.rb
245
+ - spec/boletosimples/last_request_spec.rb
246
+ - spec/boletosimples/resources/bank_billet_spec.rb
247
+ - spec/boletosimples/resources/customer_spec.rb
248
+ - spec/boletosimples/resources/partner/user_spec.rb
249
+ - spec/boletosimples/resources/transactions_spec.rb
250
+ - spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml
251
+ - spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml
252
+ - spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml
253
+ - spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml
254
+ - spec/fixtures/vcr_cassettes/last_request/bank_billets.yml
255
+ - spec/fixtures/vcr_cassettes/last_request/userinfo.yml
256
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml
257
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/cancel.yml
258
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml
259
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml
260
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml
261
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml
262
+ - spec/fixtures/vcr_cassettes/resources/customer/all.yml
263
+ - spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml
264
+ - spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml
265
+ - spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml
266
+ - spec/fixtures/vcr_cassettes/resources/customer/find.yml
267
+ - spec/fixtures/vcr_cassettes/resources/partner/user/create.yml
268
+ - spec/fixtures/vcr_cassettes/resources/transaction/all.yml
251
269
  - spec/spec.opts
252
270
  - spec/spec_helper.rb
253
271
  - spec/support/vcr.rb
254
- has_rdoc:
@@ -1,79 +0,0 @@
1
- $LOAD_PATH << File.expand_path('../../lib', __FILE__)
2
- require 'boletosimples'
3
- require 'pp'
4
-
5
- client = BoletoSimples::Client.new('access_token', user_agent: 'Meu e-Commerce (meuecommerce@example.com)')
6
-
7
- # pp client.userinfo
8
-
9
- # pp client.transactions
10
-
11
- # pp client.customers
12
-
13
- # pp client.customer 2
14
- #
15
- # pp client.create_customer(
16
- # {
17
- # person_name: "Joao da Silva",
18
- # cnpj_cpf: "012.345.678-90",
19
- # email: "cliente@bom.com",
20
- # address: "Rua quinhentos",
21
- # city_name: "Rio de Janeiro",
22
- # state: "RJ",
23
- # neighborhood: "bairro",
24
- # zipcode: "12312-123",
25
- # address_number: "111",
26
- # address_complement: "Sala 4",
27
- # phone_number: "2112123434"
28
- # }
29
- # )
30
-
31
- # pp client.bank_billets
32
-
33
- # pp client.bank_billet 3
34
-
35
- # Boleto normal
36
- # pp client.create_bank_billet(
37
- # {
38
- # amount: 41.01,
39
- # customer_address: 'Rua quinhentos',
40
- # customer_address_complement: 'Sala 4',
41
- # customer_address_number: '111',
42
- # customer_city_name: 'Rio de Janeiro',
43
- # customer_cnpj_cpf: '012.345.678-90',
44
- # customer_email: 'cliente@bom.com',
45
- # customer_neighborhood: 'Sao Francisco',
46
- # customer_person_name: 'Joao da Silva',
47
- # customer_person_type: 'individual',
48
- # customer_phone_number: '2112123434',
49
- # customer_state: 'RJ',
50
- # customer_zipcode: '12312-123',
51
- # description: 'Despesas do contrato 0012',
52
- # expire_at: '2014-01-01',
53
- # notification_url: 'http://example.com.br/notify'
54
- # }
55
- # )
56
-
57
- # Boleto parcelado
58
- # pp client.create_bank_billet(
59
- # {
60
- # amount: 41.01,
61
- # customer_address: 'Rua quinhentos',
62
- # customer_address_complement: 'Sala 4',
63
- # customer_address_number: '111',
64
- # customer_city_name: 'Rio de Janeiro',
65
- # customer_cnpj_cpf: '012.345.678-90',
66
- # customer_email: 'cliente@bom.com',
67
- # customer_neighborhood: 'Sao Francisco',
68
- # customer_person_name: 'Joao da Silva',
69
- # customer_person_type: 'individual',
70
- # customer_phone_number: '2112123434',
71
- # customer_state: 'RJ',
72
- # customer_zipcode: '12312-123',
73
- # description: 'Despesas do contrato 0012',
74
- # expire_at: '2014-01-01',
75
- # notification_url: 'http://example.com.br/notify',
76
- # parcels: 3
77
- # }
78
- # )
79
-
@@ -1,126 +0,0 @@
1
- $LOAD_PATH << File.expand_path('../../lib', __FILE__)
2
- require 'boletosimples'
3
- require 'pp'
4
-
5
- # If you need create users in Boleto Simples
6
- # you can get a access token with app_id and app_secret
7
- # def get_access_token
8
- # response = RestClient.post 'http://sandbox.boletosimples.com.br/api/v1/oauth2/token', {
9
- # grant_type: 'client_credentials',
10
- # client_id: 'app_id',
11
- # client_secret: 'app_secret'
12
- # }
13
- #
14
- # access_app_token = JSON.parse(response)["access_token"]
15
- # end
16
-
17
- credentials = {
18
- token: 'access_app_token'
19
- }
20
-
21
- client_options = {
22
- user_agent: 'Meu e-Commerce (meuecommerce@example.com)'
23
- }
24
-
25
- client = BoletoSimples::OAuthClient.new('app_id',
26
- 'app_secret',
27
- credentials,
28
- client_options)
29
-
30
- # create user with oauth
31
- # pp client.partner_create_user(
32
- # {
33
- # user: {
34
- # email: 'new_user@example.com'
35
- # }
36
- # }
37
- # )
38
-
39
- # Other operations need access tokens from user oatuh autorization process
40
- # Use our omniauth-boletosimples (https://github.com/BoletoSimples/omniauth-boletosimples) to archive these tokens
41
-
42
- credentials = {
43
- token: 'access token'
44
- }
45
-
46
- client_options = {
47
- user_agent: 'Meu e-Commerce (meuecommerce@example.com)'
48
- }
49
-
50
- client = BoletoSimples::OAuthClient.new('app_id',
51
- 'app_secret',
52
- credentials,
53
- client_options)
54
-
55
- # pp client.userinfo
56
-
57
- # pp client.transactions
58
-
59
- # pp client.customers
60
-
61
- # pp client.customer 2
62
- #
63
- # pp client.create_customer(
64
- # {
65
- # person_name: "Joao da Silva",
66
- # cnpj_cpf: "012.345.678-90",
67
- # email: "cliente@bom.com",
68
- # address: "Rua quinhentos",
69
- # city_name: "Rio de Janeiro",
70
- # state: "RJ",
71
- # neighborhood: "bairro",
72
- # zipcode: "12312-123",
73
- # address_number: "111",
74
- # address_complement: "Sala 4",
75
- # phone_number: "2112123434"
76
- # }
77
- # )
78
-
79
- # pp client.bank_billets
80
-
81
- # pp client.bank_billet 3
82
-
83
- # Boleto normal
84
- # pp client.create_bank_billet(
85
- # {
86
- # amount: 41.01,
87
- # customer_address: 'Rua quinhentos',
88
- # customer_address_complement: 'Sala 4',
89
- # customer_address_number: '111',
90
- # customer_city_name: 'Rio de Janeiro',
91
- # customer_cnpj_cpf: '012.345.678-90',
92
- # customer_email: 'cliente@bom.com',
93
- # customer_neighborhood: 'Sao Francisco',
94
- # customer_person_name: 'Joao da Silva',
95
- # customer_person_type: 'individual',
96
- # customer_phone_number: '2112123434',
97
- # customer_state: 'RJ',
98
- # customer_zipcode: '12312-123',
99
- # description: 'Despesas do contrato 0012',
100
- # expire_at: '2014-01-01',
101
- # notification_url: 'http://example.com.br/notify'
102
- # }
103
- # )
104
-
105
- # Boleto parcelado
106
- # pp client.create_bank_billet(
107
- # {
108
- # amount: 41.01,
109
- # customer_address: 'Rua quinhentos',
110
- # customer_address_complement: 'Sala 4',
111
- # customer_address_number: '111',
112
- # customer_city_name: 'Rio de Janeiro',
113
- # customer_cnpj_cpf: '012.345.678-90',
114
- # customer_email: 'cliente@bom.com',
115
- # customer_neighborhood: 'Sao Francisco',
116
- # customer_person_name: 'Joao da Silva',
117
- # customer_person_type: 'individual',
118
- # customer_phone_number: '2112123434',
119
- # customer_state: 'RJ',
120
- # customer_zipcode: '12312-123',
121
- # description: 'Despesas do contrato 0012',
122
- # expire_at: '2014-01-01',
123
- # notification_url: 'http://example.com.br/notify',
124
- # parcels: 3
125
- # }
126
- # )