boletosimples 0.6.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -12
  3. data/README.md +21 -59
  4. data/lib/boletosimples/configuration.rb +25 -28
  5. data/lib/boletosimples/last_request.rb +17 -10
  6. data/lib/boletosimples/middlewares/bearer.rb +12 -0
  7. data/lib/boletosimples/middlewares/custom_headers.rb +12 -0
  8. data/lib/boletosimples/middlewares/debug.rb +30 -0
  9. data/lib/boletosimples/middlewares/last_request.rb +3 -1
  10. data/lib/boletosimples/middlewares/raise_error.rb +9 -2
  11. data/lib/boletosimples/middlewares/user_agent.rb +3 -1
  12. data/lib/boletosimples/resources/bank_billet.rb +5 -11
  13. data/lib/boletosimples/resources/bank_billet_account.rb +3 -1
  14. data/lib/boletosimples/resources/bank_billet_discharge.rb +3 -1
  15. data/lib/boletosimples/resources/bank_billet_payment.rb +3 -1
  16. data/lib/boletosimples/resources/bank_billet_remittance.rb +3 -1
  17. data/lib/boletosimples/resources/base_model.rb +3 -1
  18. data/lib/boletosimples/resources/customer.rb +3 -1
  19. data/lib/boletosimples/resources/customer_import.rb +5 -3
  20. data/lib/boletosimples/resources/customer_subscription.rb +3 -10
  21. data/lib/boletosimples/resources/customer_subscription_import.rb +5 -3
  22. data/lib/boletosimples/resources/discharge.rb +4 -11
  23. data/lib/boletosimples/resources/email_delivery.rb +3 -1
  24. data/lib/boletosimples/resources/event.rb +3 -1
  25. data/lib/boletosimples/resources/installment.rb +3 -1
  26. data/lib/boletosimples/resources/remittance.rb +3 -1
  27. data/lib/boletosimples/resources/sms_delivery.rb +6 -0
  28. data/lib/boletosimples/resources/transaction.rb +3 -1
  29. data/lib/boletosimples/resources/webhook.rb +3 -1
  30. data/lib/boletosimples/resources/webhook_delivery.rb +3 -1
  31. data/lib/boletosimples/response_error.rb +10 -5
  32. data/lib/boletosimples/version.rb +3 -1
  33. data/lib/boletosimples.rb +6 -6
  34. data/spec/boletosimples/configuration_spec.rb +67 -80
  35. data/spec/boletosimples/last_request_spec.rb +17 -28
  36. data/spec/boletosimples/middlewares/custom_headers_spec.rb +26 -0
  37. data/spec/boletosimples/resources/bank_billet_account_spec.rb +57 -33
  38. data/spec/boletosimples/resources/bank_billet_discharge_spec.rb +7 -12
  39. data/spec/boletosimples/resources/bank_billet_payment_spec.rb +7 -12
  40. data/spec/boletosimples/resources/bank_billet_remittance_spec.rb +7 -12
  41. data/spec/boletosimples/resources/bank_billet_spec.rb +56 -42
  42. data/spec/boletosimples/resources/customer_import_spec.rb +41 -30
  43. data/spec/boletosimples/resources/customer_spec.rb +57 -39
  44. data/spec/boletosimples/resources/customer_subscription_import_spec.rb +41 -30
  45. data/spec/boletosimples/resources/customer_subscription_spec.rb +61 -33
  46. data/spec/boletosimples/resources/discharge_spec.rb +64 -11
  47. data/spec/boletosimples/resources/email_delivery_spec.rb +6 -11
  48. data/spec/boletosimples/resources/event_spec.rb +7 -12
  49. data/spec/boletosimples/resources/installment_spec.rb +61 -32
  50. data/spec/boletosimples/resources/remittance_spec.rb +7 -12
  51. data/spec/boletosimples/resources/sms_delivery_spec.rb +12 -0
  52. data/spec/boletosimples/resources/transactions_spec.rb +7 -12
  53. data/spec/boletosimples/resources/webhook_delivery_spec.rb +7 -12
  54. data/spec/boletosimples/resources/webhook_spec.rb +7 -12
  55. data/spec/fixtures/discharge.RET +3 -0
  56. data/spec/fixtures/vcr_cassettes/custom_headers.yml +113 -0
  57. data/spec/fixtures/vcr_cassettes/last_request/bank_billets.yml +409 -95
  58. data/spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml +101 -99
  59. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml +55 -95
  60. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml +55 -27
  61. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml +51 -24
  62. data/spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml +64 -34
  63. data/spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml +97 -0
  64. data/spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml +73 -34
  65. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml +82 -27
  66. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml +57 -27
  67. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_root.yml +53 -26
  68. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/valid.yml +64 -28
  69. data/spec/fixtures/vcr_cassettes/resources/bank_billet_account/find.yml +61 -25
  70. data/spec/fixtures/vcr_cassettes/resources/bank_billet_discharge/all.yml +59 -46
  71. data/spec/fixtures/vcr_cassettes/resources/bank_billet_payment/all.yml +74 -71
  72. data/spec/fixtures/vcr_cassettes/resources/bank_billet_remittance/all.yml +63 -47
  73. data/spec/fixtures/vcr_cassettes/resources/customer/all.yml +141 -39
  74. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_params.yml +54 -25
  75. data/spec/fixtures/vcr_cassettes/resources/customer/create/invalid_root.yml +54 -24
  76. data/spec/fixtures/vcr_cassettes/resources/customer/create/valid.yml +56 -28
  77. data/spec/fixtures/vcr_cassettes/resources/customer/find.yml +56 -26
  78. data/spec/fixtures/vcr_cassettes/resources/customer_import/all.yml +58 -59
  79. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_params.yml +53 -51
  80. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/invalid_root.yml +54 -52
  81. data/spec/fixtures/vcr_cassettes/resources/customer_import/create/valid.yml +58 -67
  82. data/spec/fixtures/vcr_cassettes/resources/customer_import/find.yml +55 -53
  83. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/all.yml +65 -51
  84. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_params.yml +56 -50
  85. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/invalid_root.yml +52 -48
  86. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/create/valid.yml +63 -52
  87. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/find.yml +61 -51
  88. data/spec/fixtures/vcr_cassettes/resources/customer_subscription/next_charge.yml +60 -132
  89. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/all.yml +58 -54
  90. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_params.yml +53 -52
  91. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/invalid_root.yml +55 -53
  92. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml +58 -69
  93. data/spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml +55 -54
  94. data/spec/fixtures/vcr_cassettes/resources/discharge/all.yml +63 -34
  95. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml +86 -0
  96. data/spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml +85 -0
  97. data/spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml +100 -0
  98. data/spec/fixtures/vcr_cassettes/resources/discharge/find.yml +89 -0
  99. data/spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml +40 -43
  100. data/spec/fixtures/vcr_cassettes/resources/event/all.yml +326 -167
  101. data/spec/fixtures/vcr_cassettes/resources/installment/all.yml +113 -51
  102. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_params.yml +57 -52
  103. data/spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml +52 -48
  104. data/spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml +63 -52
  105. data/spec/fixtures/vcr_cassettes/resources/installment/find.yml +83 -51
  106. data/spec/fixtures/vcr_cassettes/resources/remittance/all.yml +83 -62
  107. data/spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml +89 -0
  108. data/spec/fixtures/vcr_cassettes/resources/transaction/all.yml +73 -60
  109. data/spec/fixtures/vcr_cassettes/resources/web_hook/all.yml +59 -34
  110. data/spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml +2684 -55
  111. data/spec/spec_helper.rb +3 -20
  112. data/spec/support/stub_env.rb +7 -0
  113. data/spec/support/vcr.rb +3 -4
  114. metadata +42 -176
  115. data/.coveralls.yml +0 -2
  116. data/.gitignore +0 -19
  117. data/.ruby-version +0 -1
  118. data/.travis.yml +0 -46
  119. data/Gemfile +0 -4
  120. data/Rakefile +0 -14
  121. data/boletosimples.gemspec +0 -38
  122. data/gemfiles/rails_42.gemfile +0 -8
  123. data/gemfiles/rails_50.gemfile +0 -8
  124. data/gemfiles/rails_51.gemfile +0 -8
  125. data/gemfiles/rails_52.gemfile +0 -9
  126. data/lib/boletosimples/extra.rb +0 -8
  127. data/lib/boletosimples/resources/partner/user.rb +0 -7
  128. data/lib/oauth2_patch.rb +0 -24
  129. data/spec/boletosimples/extra_spec.rb +0 -31
  130. data/spec/boletosimples/resources/partner/user_spec.rb +0 -19
  131. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml +0 -64
  132. data/spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml +0 -56
  133. data/spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml +0 -58
  134. data/spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml +0 -54
  135. data/spec/fixtures/vcr_cassettes/last_request/userinfo.yml +0 -58
  136. data/spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml +0 -118
  137. data/spec/fixtures/vcr_cassettes/resources/partner/user/create.yml +0 -60
  138. data/spec/spec.opts +0 -8
data/spec/spec_helper.rb CHANGED
@@ -1,25 +1,10 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
-
4
- require 'simplecov'
5
- SimpleCov.start
1
+ # frozen_string_literal: true
6
2
 
7
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
8
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
9
5
  require 'rspec'
10
- require 'pry'
11
6
  require 'boletosimples'
12
7
 
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
-
23
8
  RSpec.configure do |config|
24
9
  config.disable_monkey_patching!
25
10
  config.order = :random
@@ -33,11 +18,9 @@ RSpec.configure do |config|
33
18
  mocks.syntax = :expect
34
19
  mocks.verify_partial_doubles = true
35
20
  end
36
- if config.files_to_run.one?
37
- config.default_formatter = 'doc'
38
- end
21
+ config.default_formatter = 'doc' if config.files_to_run.one?
39
22
  end
40
23
 
41
24
  # Requires supporting files with custom matchers and macros, etc,
42
25
  # in ./support/ and its subdirectories.
43
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
26
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'stub_env'
4
+
5
+ RSpec.configure do |config|
6
+ config.include StubEnv::Helpers
7
+ end
data/spec/support/vcr.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vcr'
2
4
 
3
5
  VCR.configure do |c|
@@ -8,8 +10,5 @@ VCR.configure do |c|
8
10
  c.before_record do |i|
9
11
  i.response.body.force_encoding('UTF-8')
10
12
  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'] }
13
+ c.filter_sensitive_data('BOLETOSIMPLES_API_TOKEN') { ENV['BOLETOSIMPLES_API_TOKEN'] }
15
14
  end
metadata CHANGED
@@ -1,185 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boletosimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kivanio Barbosa
8
8
  - Rafael Lima
9
9
  - Thiago Belem
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-12-14 00:00:00.000000000 Z
13
+ date: 2022-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: her
16
+ name: faraday-http-cache
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.0'
21
+ version: 2.2.0
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: '1.0'
28
+ version: 2.2.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: faraday_middleware
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0.12'
35
+ version: '1.0'
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: '0.12'
42
+ version: '1.0'
43
43
  - !ruby/object:Gem::Dependency
44
- name: faraday-http-cache
44
+ name: her
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 2.0.0
49
+ version: '1.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: 2.0.0
57
- - !ruby/object:Gem::Dependency
58
- name: pry
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- - !ruby/object:Gem::Dependency
72
- name: rspec
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: '0'
85
- - !ruby/object:Gem::Dependency
86
- name: vcr
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: '0'
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
- - !ruby/object:Gem::Dependency
100
- name: webmock
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: '0'
113
- - !ruby/object:Gem::Dependency
114
- name: rake
115
- requirement: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: '0'
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: '0'
127
- - !ruby/object:Gem::Dependency
128
- name: coveralls
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - ">="
132
- - !ruby/object:Gem::Version
133
- version: '0'
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: '0'
141
- - !ruby/object:Gem::Dependency
142
- name: simplecov
143
- requirement: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- version: '0'
148
- type: :development
149
- prerelease: false
150
- version_requirements: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: '0'
155
- - !ruby/object:Gem::Dependency
156
- name: codeclimate-test-reporter
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - ">="
160
- - !ruby/object:Gem::Version
161
- version: '0'
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- version: '0'
169
- - !ruby/object:Gem::Dependency
170
- name: rubocop
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - ">="
174
- - !ruby/object:Gem::Version
175
- version: '0'
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - ">="
181
- - !ruby/object:Gem::Version
182
- version: '0'
56
+ version: '1.1'
183
57
  description: Boleto Simples API wrapper.
184
58
  email:
185
59
  - kivanio@gmail.com
@@ -189,24 +63,15 @@ executables: []
189
63
  extensions: []
190
64
  extra_rdoc_files: []
191
65
  files:
192
- - ".coveralls.yml"
193
- - ".gitignore"
194
- - ".ruby-version"
195
- - ".travis.yml"
196
66
  - CHANGELOG.md
197
- - Gemfile
198
67
  - LICENSE.txt
199
68
  - README.md
200
- - Rakefile
201
- - boletosimples.gemspec
202
- - gemfiles/rails_42.gemfile
203
- - gemfiles/rails_50.gemfile
204
- - gemfiles/rails_51.gemfile
205
- - gemfiles/rails_52.gemfile
206
69
  - lib/boletosimples.rb
207
70
  - lib/boletosimples/configuration.rb
208
- - lib/boletosimples/extra.rb
209
71
  - lib/boletosimples/last_request.rb
72
+ - lib/boletosimples/middlewares/bearer.rb
73
+ - lib/boletosimples/middlewares/custom_headers.rb
74
+ - lib/boletosimples/middlewares/debug.rb
210
75
  - lib/boletosimples/middlewares/last_request.rb
211
76
  - lib/boletosimples/middlewares/raise_error.rb
212
77
  - lib/boletosimples/middlewares/user_agent.rb
@@ -224,17 +89,16 @@ files:
224
89
  - lib/boletosimples/resources/email_delivery.rb
225
90
  - lib/boletosimples/resources/event.rb
226
91
  - lib/boletosimples/resources/installment.rb
227
- - lib/boletosimples/resources/partner/user.rb
228
92
  - lib/boletosimples/resources/remittance.rb
93
+ - lib/boletosimples/resources/sms_delivery.rb
229
94
  - lib/boletosimples/resources/transaction.rb
230
95
  - lib/boletosimples/resources/webhook.rb
231
96
  - lib/boletosimples/resources/webhook_delivery.rb
232
97
  - lib/boletosimples/response_error.rb
233
98
  - lib/boletosimples/version.rb
234
- - lib/oauth2_patch.rb
235
99
  - spec/boletosimples/configuration_spec.rb
236
- - spec/boletosimples/extra_spec.rb
237
100
  - spec/boletosimples/last_request_spec.rb
101
+ - spec/boletosimples/middlewares/custom_headers_spec.rb
238
102
  - spec/boletosimples/resources/bank_billet_account_spec.rb
239
103
  - spec/boletosimples/resources/bank_billet_discharge_spec.rb
240
104
  - spec/boletosimples/resources/bank_billet_payment_spec.rb
@@ -248,25 +112,22 @@ files:
248
112
  - spec/boletosimples/resources/email_delivery_spec.rb
249
113
  - spec/boletosimples/resources/event_spec.rb
250
114
  - spec/boletosimples/resources/installment_spec.rb
251
- - spec/boletosimples/resources/partner/user_spec.rb
252
115
  - spec/boletosimples/resources/remittance_spec.rb
116
+ - spec/boletosimples/resources/sms_delivery_spec.rb
253
117
  - spec/boletosimples/resources/transactions_spec.rb
254
118
  - spec/boletosimples/resources/webhook_delivery_spec.rb
255
119
  - spec/boletosimples/resources/webhook_spec.rb
256
120
  - spec/fixtures/customer_imports.csv
257
121
  - spec/fixtures/customer_subscription_imports.csv
258
- - spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml
259
- - spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml
260
- - spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml
261
- - spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml
122
+ - spec/fixtures/discharge.RET
123
+ - spec/fixtures/vcr_cassettes/custom_headers.yml
262
124
  - spec/fixtures/vcr_cassettes/last_request/bank_billets.yml
263
- - spec/fixtures/vcr_cassettes/last_request/userinfo.yml
264
125
  - spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml
265
- - spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml
266
126
  - spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml
267
127
  - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml
268
128
  - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml
269
129
  - spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml
130
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml
270
131
  - spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml
271
132
  - spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml
272
133
  - spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml
@@ -298,6 +159,10 @@ files:
298
159
  - spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml
299
160
  - spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml
300
161
  - spec/fixtures/vcr_cassettes/resources/discharge/all.yml
162
+ - spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml
163
+ - spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml
164
+ - spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml
165
+ - spec/fixtures/vcr_cassettes/resources/discharge/find.yml
301
166
  - spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml
302
167
  - spec/fixtures/vcr_cassettes/resources/event/all.yml
303
168
  - spec/fixtures/vcr_cassettes/resources/installment/all.yml
@@ -305,18 +170,19 @@ files:
305
170
  - spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml
306
171
  - spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml
307
172
  - spec/fixtures/vcr_cassettes/resources/installment/find.yml
308
- - spec/fixtures/vcr_cassettes/resources/partner/user/create.yml
309
173
  - spec/fixtures/vcr_cassettes/resources/remittance/all.yml
174
+ - spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml
310
175
  - spec/fixtures/vcr_cassettes/resources/transaction/all.yml
311
176
  - spec/fixtures/vcr_cassettes/resources/web_hook/all.yml
312
177
  - spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml
313
- - spec/spec.opts
314
178
  - spec/spec_helper.rb
179
+ - spec/support/stub_env.rb
315
180
  - spec/support/vcr.rb
316
181
  homepage: https://github.com/BoletoSimples/boletosimples-ruby
317
182
  licenses: []
318
- metadata: {}
319
- post_install_message:
183
+ metadata:
184
+ rubygems_mfa_required: 'true'
185
+ post_install_message:
320
186
  rdoc_options: []
321
187
  require_paths:
322
188
  - lib
@@ -331,15 +197,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
197
  - !ruby/object:Gem::Version
332
198
  version: '0'
333
199
  requirements: []
334
- rubyforge_project:
335
- rubygems_version: 2.7.3
336
- signing_key:
200
+ rubygems_version: 3.3.7
201
+ signing_key:
337
202
  specification_version: 4
338
203
  summary: Boleto Simples API wrapper.
339
204
  test_files:
340
205
  - spec/boletosimples/configuration_spec.rb
341
- - spec/boletosimples/extra_spec.rb
342
206
  - spec/boletosimples/last_request_spec.rb
207
+ - spec/boletosimples/middlewares/custom_headers_spec.rb
343
208
  - spec/boletosimples/resources/bank_billet_account_spec.rb
344
209
  - spec/boletosimples/resources/bank_billet_discharge_spec.rb
345
210
  - spec/boletosimples/resources/bank_billet_payment_spec.rb
@@ -353,25 +218,22 @@ test_files:
353
218
  - spec/boletosimples/resources/email_delivery_spec.rb
354
219
  - spec/boletosimples/resources/event_spec.rb
355
220
  - spec/boletosimples/resources/installment_spec.rb
356
- - spec/boletosimples/resources/partner/user_spec.rb
357
221
  - spec/boletosimples/resources/remittance_spec.rb
222
+ - spec/boletosimples/resources/sms_delivery_spec.rb
358
223
  - spec/boletosimples/resources/transactions_spec.rb
359
224
  - spec/boletosimples/resources/webhook_delivery_spec.rb
360
225
  - spec/boletosimples/resources/webhook_spec.rb
361
226
  - spec/fixtures/customer_imports.csv
362
227
  - spec/fixtures/customer_subscription_imports.csv
363
- - spec/fixtures/vcr_cassettes/configuration/client_credentials/invalid.yml
364
- - spec/fixtures/vcr_cassettes/configuration/client_credentials/valid.yml
365
- - spec/fixtures/vcr_cassettes/extra/userinfo/authenticated.yml
366
- - spec/fixtures/vcr_cassettes/extra/userinfo/not_authenticated.yml
228
+ - spec/fixtures/discharge.RET
229
+ - spec/fixtures/vcr_cassettes/custom_headers.yml
367
230
  - spec/fixtures/vcr_cassettes/last_request/bank_billets.yml
368
- - spec/fixtures/vcr_cassettes/last_request/userinfo.yml
369
231
  - spec/fixtures/vcr_cassettes/resources/bank_billet/all.yml
370
- - spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/failure.yml
371
232
  - spec/fixtures/vcr_cassettes/resources/bank_billet/cancel/success.yml
372
233
  - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_params.yml
373
234
  - spec/fixtures/vcr_cassettes/resources/bank_billet/create/invalid_root.yml
374
235
  - spec/fixtures/vcr_cassettes/resources/bank_billet/create/valid.yml
236
+ - spec/fixtures/vcr_cassettes/resources/bank_billet/duplicate/success.yml
375
237
  - spec/fixtures/vcr_cassettes/resources/bank_billet/find.yml
376
238
  - spec/fixtures/vcr_cassettes/resources/bank_billet_account/all.yml
377
239
  - spec/fixtures/vcr_cassettes/resources/bank_billet_account/create/invalid_params.yml
@@ -403,6 +265,10 @@ test_files:
403
265
  - spec/fixtures/vcr_cassettes/resources/customer_subscription_import/create/valid.yml
404
266
  - spec/fixtures/vcr_cassettes/resources/customer_subscription_import/find.yml
405
267
  - spec/fixtures/vcr_cassettes/resources/discharge/all.yml
268
+ - spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_params.yml
269
+ - spec/fixtures/vcr_cassettes/resources/discharge/create/invalid_root.yml
270
+ - spec/fixtures/vcr_cassettes/resources/discharge/create/valid.yml
271
+ - spec/fixtures/vcr_cassettes/resources/discharge/find.yml
406
272
  - spec/fixtures/vcr_cassettes/resources/email_delivery/all.yml
407
273
  - spec/fixtures/vcr_cassettes/resources/event/all.yml
408
274
  - spec/fixtures/vcr_cassettes/resources/installment/all.yml
@@ -410,11 +276,11 @@ test_files:
410
276
  - spec/fixtures/vcr_cassettes/resources/installment/create/invalid_root.yml
411
277
  - spec/fixtures/vcr_cassettes/resources/installment/create/valid.yml
412
278
  - spec/fixtures/vcr_cassettes/resources/installment/find.yml
413
- - spec/fixtures/vcr_cassettes/resources/partner/user/create.yml
414
279
  - spec/fixtures/vcr_cassettes/resources/remittance/all.yml
280
+ - spec/fixtures/vcr_cassettes/resources/sns_delivery/all.yml
415
281
  - spec/fixtures/vcr_cassettes/resources/transaction/all.yml
416
282
  - spec/fixtures/vcr_cassettes/resources/web_hook/all.yml
417
283
  - spec/fixtures/vcr_cassettes/resources/webhook_delivery/all.yml
418
- - spec/spec.opts
419
284
  - spec/spec_helper.rb
285
+ - spec/support/stub_env.rb
420
286
  - spec/support/vcr.rb
data/.coveralls.yml DELETED
@@ -1,2 +0,0 @@
1
- service_name: travis-ci
2
- repo_token: hSYBAmKtSBLrLODdt13qT0A6sk7uGoO8h
data/.gitignore DELETED
@@ -1,19 +0,0 @@
1
- Gemfile.lock
2
- *.gem
3
- *.rbc
4
- .bundle
5
- .config
6
- .yardoc
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- test/tmp
15
- test/version_tmp
16
- tmp
17
- .tddium*
18
- .idea
19
- .DS_Store
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.0
data/.travis.yml DELETED
@@ -1,46 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- before_install:
4
- - gem update --system # use the very latest Rubygems
5
- - gem install bundler # use the very latest Bundler
6
- dist: trusty
7
- before_script:
8
- - unset _JAVA_OPTIONS
9
- rvm:
10
- - '2.5.0'
11
- - '2.4.3'
12
- - '2.3.4'
13
- - '2.2.7'
14
- - '2.1.10'
15
- - jruby-9.1.16.0
16
-
17
- gemfile:
18
- - gemfiles/rails_42.gemfile
19
- - gemfiles/rails_50.gemfile
20
- - gemfiles/rails_51.gemfile
21
- - gemfiles/rails_52.gemfile
22
-
23
- env:
24
- global:
25
- - JRUBY_OPTS="-J-Xmx1024m --dev --debug"
26
- - COVERAGE=true
27
-
28
- matrix:
29
- fast_finish: true
30
-
31
- allow_failures:
32
- - rvm: jruby-9.1.16.0
33
- gemfile: gemfiles/rails_52.gemfile
34
- - rvm: 2.1.10
35
- gemfile: gemfiles/rails_50.gemfile
36
- - rvm: 2.1.10
37
- gemfile: gemfiles/rails_51.gemfile
38
- - rvm: 2.1.10
39
- gemfile: gemfiles/rails_52.gemfile
40
-
41
- branches:
42
- only:
43
- - master
44
- addons:
45
- code_climate:
46
- repo_token: 9c2feef5a1d636d5b08d10561c53f9293783fc175c0cc44d152cdb05a65d1868
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in pah.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task default: :spec
7
-
8
- task :console do
9
- require 'irb'
10
- require 'irb/completion'
11
-
12
- ARGV.clear
13
- IRB.start
14
- end
@@ -1,38 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'boletosimples/version'
6
-
7
- Gem::Specification.new do |gem|
8
- gem.name = 'boletosimples'
9
- gem.version = BoletoSimples::VERSION
10
- gem.authors = ['Kivanio Barbosa', 'Rafael Lima', 'Thiago Belem']
11
- gem.email = ['kivanio@gmail.com', 'contato@rafael.adm.br', 'contato@thiagobelem.net']
12
- gem.description = 'Boleto Simples API wrapper.'
13
- gem.summary = 'Boleto Simples API wrapper.'
14
- gem.homepage = 'https://github.com/BoletoSimples/boletosimples-ruby'
15
-
16
- gem.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(spec|features)/})
18
- end
19
-
20
- gem.test_files = `git ls-files -- {spec,features}/*`.split("\n")
21
- gem.require_paths = ['lib']
22
-
23
- # Gems that must be intalled for boletosimples to work
24
- gem.add_dependency 'her', '~> 1.0'
25
- gem.add_dependency 'faraday_middleware', '~> 0.12'
26
- gem.add_dependency 'faraday-http-cache', '~> 2.0.0'
27
-
28
- # Gems that must be installed for boletosimples to compile and build
29
- gem.add_development_dependency 'pry'
30
- gem.add_development_dependency 'rspec'
31
- gem.add_development_dependency 'vcr'
32
- gem.add_development_dependency 'webmock'
33
- gem.add_development_dependency 'rake'
34
- gem.add_development_dependency 'coveralls'
35
- gem.add_development_dependency 'simplecov'
36
- gem.add_development_dependency 'codeclimate-test-reporter'
37
- gem.add_development_dependency 'rubocop'
38
- end
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
4
-
5
- gem "rails", "4.2.10"
6
- gem "activerecord-jdbcsqlite3-adapter", "~> 1.3", platforms: :jruby
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
4
-
5
- gem "rails", "5.0.6"
6
- gem "activerecord-jdbcsqlite3-adapter", "~> 50.0", platforms: :jruby
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
4
-
5
- gem "rails", "5.1.4"
6
- gem "activerecord-jdbcsqlite3-adapter", "~> 51.0", platforms: :jruby
7
-
8
- gemspec path: "../"
@@ -1,9 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
4
-
5
- gem "rails", "~> 5.2.0"
6
- gem "bootsnap"
7
- gem "activerecord-jdbcsqlite3-adapter", "~> 51.0", platforms: :jruby
8
-
9
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- module BoletoSimples
2
- class Extra
3
- def self.userinfo
4
- response = Her::API.default_api.connection.get '/api/v1/userinfo.json'
5
- response.body[:data]
6
- end
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- module BoletoSimples
2
- module Partner
3
- class User < BoletoSimples::BaseModel
4
- collection_path "partner/users"
5
- end
6
- end
7
- end
data/lib/oauth2_patch.rb DELETED
@@ -1,24 +0,0 @@
1
- module OAuth2
2
- class Error < StandardError
3
- attr_reader :response, :code, :description
4
-
5
- # standard error values include:
6
- # :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope
7
- def initialize(response)
8
- response.error = self
9
- @response = response
10
-
11
- message = []
12
-
13
- if response.parsed.is_a?(Hash)
14
- @code = response.parsed['error']
15
- @description = response.parsed['error_description']
16
- message << "#{@code}: #{@description}"
17
- end
18
-
19
- message << response.body.force_encoding('UTF-8')
20
-
21
- super(message.join("\n"))
22
- end
23
- end
24
- end