brick-sdk 1.0.1
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 +7 -0
- data/.gitignore +8 -0
- data/Gemfile +10 -0
- data/README.md +35 -0
- data/Rakefile +4 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/brick-sdk.gemspec +37 -0
- data/lib/brick/sdk.rb +496 -0
- data/lib/brick/sdk/version.rb +7 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b2f9bfb1d0b5b1162cc0219e14e8ccc2cc4113d200ed06efeec1aa74514ec81f
|
4
|
+
data.tar.gz: 0af0b836de872e51d33158c8c7b4c09f309d8edbc82a22e0f7e5062cbeae06e0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 392271fefd327e6a7c234e8053afa6e5dd96ccae600a70710dffe2cad983371006a09f300045449b51e0bbf28a32a78102469b1cb327b726a7fcb685903925b5
|
7
|
+
data.tar.gz: fe6d51779c9160b50ec7958c59977b9bcde18467011f4868fff96620754c8723d9fc72437f9edbc3b423b953ace7b81dcb71dc993a3cf8ed272fa09f0ecd8082
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Brick::Sdk
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/brick/sdk`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'brick-sdk'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install brick-sdk
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/brick-sdk.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "brick/sdk"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/brick-sdk.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/brick/sdk/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "brick-sdk"
|
7
|
+
spec.version = Brick::Sdk::VERSION
|
8
|
+
spec.authors = ["Brick Seguros "]
|
9
|
+
spec.email = ["bricktecnologia@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Write a short summary, because RubyGems requires one." #a fazer
|
12
|
+
spec.description = "Write a longer description or delete this line." #a fazer
|
13
|
+
spec.homepage = "https://brickseguros.com.br/" #a fazer
|
14
|
+
spec.required_ruby_version = ">= 2.4.0"
|
15
|
+
|
16
|
+
# spec.metadata["allowed_push_host"] = "Set to 'https://brickseguros.com.br/'" #a fazer
|
17
|
+
|
18
|
+
# spec.metadata["homepage_uri"] = 'https://brickseguros.com.br/'
|
19
|
+
# spec.metadata["source_code_uri"] = "https://brickseguros.com.br/" #a fazer
|
20
|
+
# spec.metadata["changelog_uri"] = "https://brickseguros.com.br/" #a fazer
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
# Uncomment to register a new dependency of your gem
|
32
|
+
spec.add_dependency "rake", "~> 13.0"
|
33
|
+
spec.add_dependency "httparty"
|
34
|
+
|
35
|
+
# For more information and examples about making a new gem, checkout our
|
36
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
37
|
+
end
|
data/lib/brick/sdk.rb
ADDED
@@ -0,0 +1,496 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "sdk/version"
|
4
|
+
require 'httparty'
|
5
|
+
|
6
|
+
#'$2b$10$yrYuDTsY/RycaRzpRxQ9keKQ.o.c8UyoPrNjaK5JZsL0M9EHtWbc6'
|
7
|
+
#'https://homolog-api-brick.herokuapp.com'
|
8
|
+
class BrickApi
|
9
|
+
|
10
|
+
def initialize(api, environment)
|
11
|
+
@apikey = api
|
12
|
+
@base_url = environment
|
13
|
+
end
|
14
|
+
|
15
|
+
def headers(usertoken)
|
16
|
+
{
|
17
|
+
'Accept': 'application/json',
|
18
|
+
'Content-type': 'application/json',
|
19
|
+
'apikey': @apikey,
|
20
|
+
'usertoken': usertoken
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def getRequest (endpoint, usertoken="")
|
25
|
+
url = @base_url + endpoint
|
26
|
+
request = HTTParty.get(url, :headers =>headers(usertoken))
|
27
|
+
end
|
28
|
+
|
29
|
+
def postRequest (base_url, usertoken="", body={})
|
30
|
+
url = @base_url + endpoint
|
31
|
+
response = HTTParty.post( url, :headers => headers(usertoken), :body => body)
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
# --------- * --------- Rotas --------- * --------- #
|
36
|
+
|
37
|
+
|
38
|
+
# Cadastrar um novo usuário
|
39
|
+
def cadastrarUsuario (usertoken, body)
|
40
|
+
json = postRequest(
|
41
|
+
'/usuario/signup',
|
42
|
+
usertoken,
|
43
|
+
body
|
44
|
+
# Exemplo de body:
|
45
|
+
# {
|
46
|
+
# "name":"Cliente XPTO",
|
47
|
+
# "doc":"12345678901", // CPF ou CNPJ
|
48
|
+
# "cellphone":"43999081101", // APENAS OS NUMEROS
|
49
|
+
# "email":"cliente@gmail.com"
|
50
|
+
# }
|
51
|
+
)
|
52
|
+
return json
|
53
|
+
end
|
54
|
+
|
55
|
+
# Listar todos os usuários cadastrados pelo parceiro
|
56
|
+
def listarUsuarios ()
|
57
|
+
json = getRequest(
|
58
|
+
'/parceiros/usuarios/listar'
|
59
|
+
)
|
60
|
+
return json
|
61
|
+
end
|
62
|
+
|
63
|
+
# Encontrar um usuário pelo token
|
64
|
+
def encontrarUsuario (usertoken)
|
65
|
+
json = getRequest(
|
66
|
+
'/parceiros/usuarios/listar',
|
67
|
+
usertoken
|
68
|
+
)
|
69
|
+
return json
|
70
|
+
end
|
71
|
+
|
72
|
+
# Utilidade do veículo
|
73
|
+
def encontrarUtilidades ()
|
74
|
+
json = getRequest(
|
75
|
+
'/segmento/automoveis/utilidade'
|
76
|
+
)
|
77
|
+
return json
|
78
|
+
end
|
79
|
+
|
80
|
+
def encontrarUtilidadesPorId (id)
|
81
|
+
json = getRequest(
|
82
|
+
'/segmento/automoveis/utilidade/'+id.to_s
|
83
|
+
)
|
84
|
+
return json
|
85
|
+
end
|
86
|
+
|
87
|
+
# Distância do trabalho
|
88
|
+
def encontrarDistancia ()
|
89
|
+
json = getRequest(
|
90
|
+
'/segmento/automoveis/distancia-do-trabalho'
|
91
|
+
)
|
92
|
+
return json
|
93
|
+
end
|
94
|
+
|
95
|
+
def encontrarDistanciaPorId (id)
|
96
|
+
json = getRequest(
|
97
|
+
'/segmento/automoveis/distancia-do-trabalho/'+id.to_s
|
98
|
+
)
|
99
|
+
return json
|
100
|
+
end
|
101
|
+
|
102
|
+
# Modal
|
103
|
+
def encontrarTipoModal ()
|
104
|
+
json = getRequest(
|
105
|
+
'/segmento/automoveis/tipo-modal'
|
106
|
+
)
|
107
|
+
return json
|
108
|
+
end
|
109
|
+
|
110
|
+
def encontrarTipoModalPorId (id)
|
111
|
+
json = getRequest(
|
112
|
+
'/segmento/automoveis/tipo-modal/'+id.to_s
|
113
|
+
)
|
114
|
+
return json
|
115
|
+
end
|
116
|
+
|
117
|
+
# Tipo do Veículo
|
118
|
+
def encontrarTipoVeiculo ()
|
119
|
+
json = getRequest(
|
120
|
+
'/segmento/automoveis/tipo-veiculo'
|
121
|
+
)
|
122
|
+
return json
|
123
|
+
end
|
124
|
+
|
125
|
+
def encontrarTipoVeiculoPorId (id)
|
126
|
+
json = getRequest(
|
127
|
+
'/segmento/automoveis/tipo-veiculo/'+id.to_s
|
128
|
+
)
|
129
|
+
return json
|
130
|
+
end
|
131
|
+
|
132
|
+
# Residência do principal condutor
|
133
|
+
def encontrarResidencia ()
|
134
|
+
json = getRequest(
|
135
|
+
'/segmento/automoveis/tipo-residencia'
|
136
|
+
)
|
137
|
+
return json
|
138
|
+
end
|
139
|
+
|
140
|
+
def encontrarResidenciaPorId (id)
|
141
|
+
json = getRequest(
|
142
|
+
'/segmento/automoveis/tipo-residencia/'+id.to_s
|
143
|
+
)
|
144
|
+
return json
|
145
|
+
end
|
146
|
+
|
147
|
+
# Relação entre quem contrata o seguro e o principal condutor
|
148
|
+
def encontrarRelacaoCondutor ()
|
149
|
+
json = getRequest(
|
150
|
+
'/segmento/automoveis/relacao-condutor'
|
151
|
+
)
|
152
|
+
return json
|
153
|
+
end
|
154
|
+
|
155
|
+
def encontrarRelacaoCondutorPorId (id)
|
156
|
+
json = getRequest(
|
157
|
+
'/segmento/automoveis/relacao-condutor/'+id.to_s
|
158
|
+
)
|
159
|
+
return json
|
160
|
+
end
|
161
|
+
|
162
|
+
# Estado Civil
|
163
|
+
def encontrarEstadoCivil ()
|
164
|
+
json = getRequest(
|
165
|
+
'/segmento/automoveis/estado-civil'
|
166
|
+
)
|
167
|
+
return json
|
168
|
+
end
|
169
|
+
|
170
|
+
def encontrarEstadoCivilPorId (id)
|
171
|
+
json = getRequest(
|
172
|
+
'/segmento/automoveis/estado-civil/'+id.to_s
|
173
|
+
)
|
174
|
+
return json
|
175
|
+
end
|
176
|
+
|
177
|
+
# Profissões
|
178
|
+
def encontrarProfissoes ()
|
179
|
+
json = getRequest(
|
180
|
+
'/segmento/automoveis/profissoes'
|
181
|
+
)
|
182
|
+
return json
|
183
|
+
end
|
184
|
+
|
185
|
+
def encontrarProfissoesPorId (id)
|
186
|
+
json = getRequest(
|
187
|
+
'/segmento/automoveis/profissoes/'+id.to_s
|
188
|
+
)
|
189
|
+
return json
|
190
|
+
end
|
191
|
+
|
192
|
+
# Segmentos
|
193
|
+
def encontrarSegmentos ()
|
194
|
+
json = getRequest(
|
195
|
+
'/segmentos'
|
196
|
+
)
|
197
|
+
return json
|
198
|
+
end
|
199
|
+
|
200
|
+
def encontrarSegmentoPorId (id)
|
201
|
+
json = getRequest(
|
202
|
+
'/segmentos/'+id.to_s
|
203
|
+
)
|
204
|
+
return json
|
205
|
+
end
|
206
|
+
|
207
|
+
# Status da Solicitação
|
208
|
+
def encontrarStatusSolicitacao ()
|
209
|
+
json = getRequest(
|
210
|
+
'/solicitacao/status'
|
211
|
+
)
|
212
|
+
return json
|
213
|
+
end
|
214
|
+
|
215
|
+
def encontrarStatusSolicitacaoPorId (id)
|
216
|
+
json = getRequest(
|
217
|
+
'/solicitacao/status/'+id.to_s
|
218
|
+
)
|
219
|
+
return json
|
220
|
+
end
|
221
|
+
|
222
|
+
# Status da Contratação
|
223
|
+
def encontrarStatusContratacao ()
|
224
|
+
json = getRequest(
|
225
|
+
'/contratacao/status'
|
226
|
+
)
|
227
|
+
return json
|
228
|
+
end
|
229
|
+
|
230
|
+
def encontrarStatusContratacaoPorId (id)
|
231
|
+
json = getRequest(
|
232
|
+
'/contratacao/status/'+id.to_s
|
233
|
+
)
|
234
|
+
return json
|
235
|
+
end
|
236
|
+
|
237
|
+
# Status Boleto
|
238
|
+
def encontrarStatusBoletos ()
|
239
|
+
json = getRequest(
|
240
|
+
'/pagamentos/boleto/status'
|
241
|
+
)
|
242
|
+
return json
|
243
|
+
end
|
244
|
+
|
245
|
+
def encontrarStatusBoletosPorId (id)
|
246
|
+
json = getRequest(
|
247
|
+
'/pagamentos/boleto/status/'+id.to_s
|
248
|
+
)
|
249
|
+
return json
|
250
|
+
end
|
251
|
+
|
252
|
+
|
253
|
+
# Status Débito em Conta
|
254
|
+
def encontrarStatusDebitoConta ()
|
255
|
+
json = getRequest(
|
256
|
+
'/pagamentos/debito-em-conta/status'
|
257
|
+
)
|
258
|
+
return json
|
259
|
+
end
|
260
|
+
|
261
|
+
def encontrarStatusDebitoContaPorId (id)
|
262
|
+
json = getRequest(
|
263
|
+
'/pagamentos/debito-em-conta/status/'+id.to_s
|
264
|
+
)
|
265
|
+
return json
|
266
|
+
end
|
267
|
+
|
268
|
+
# Criar Solicitação
|
269
|
+
def criarSolicitacao (usertoken, body)
|
270
|
+
json = postRequest(
|
271
|
+
'/segmento/automoveis/solicitar/cotacao',
|
272
|
+
usertoken,
|
273
|
+
body
|
274
|
+
# Exemplo de Body: {
|
275
|
+
# "anofabricacao":"2020",
|
276
|
+
# "fipe":"215768796",
|
277
|
+
# "placaveiculo":"AAA5A55",
|
278
|
+
# "cepcirculacao":"01234567890",
|
279
|
+
# "ceppernoite":"01234567890",
|
280
|
+
# "relacaocondutor_id":1,
|
281
|
+
# "tiporesidencia_id":1,
|
282
|
+
# "cnh":"36876387678687",
|
283
|
+
# "dataprimeirahabilitacao":"05/06/2019",
|
284
|
+
# "nascimento":"05/07/2001",
|
285
|
+
# "nome":"NOME_DE_EXEMPLO",
|
286
|
+
# "cpf":"01234567895",
|
287
|
+
# "estadocivil_id":2,
|
288
|
+
# "profissao_id":47,
|
289
|
+
# "sexo":"M",
|
290
|
+
# "tipomodal_id":1,
|
291
|
+
# "alienadofinanciado":true,
|
292
|
+
# "chassiremarcado":false,
|
293
|
+
# "blindado":false,
|
294
|
+
# "portaoeletronico":false,
|
295
|
+
# "garagem":"Sim, com portão eletrônico",
|
296
|
+
# "utilidade_id":3,
|
297
|
+
# "qntveiculosnaresidencia":2,
|
298
|
+
# "vitimaroubo":false,
|
299
|
+
# "distanciatrabalho_id":2,
|
300
|
+
# "condutorescommenosde26anos":false,
|
301
|
+
# "tipoveiculo_id":3
|
302
|
+
# }
|
303
|
+
)
|
304
|
+
return json
|
305
|
+
end
|
306
|
+
|
307
|
+
# Encontrar as solicitações de cotação de um usuário
|
308
|
+
def encontrarSolicitacoesDeUmUsuario (usertoken)
|
309
|
+
json = getRequest(
|
310
|
+
'/segmento/automoveis/encontrar/solicitacoes/cotacao/usuario',
|
311
|
+
usertoken
|
312
|
+
)
|
313
|
+
return json
|
314
|
+
end
|
315
|
+
|
316
|
+
# Encontrar uma solicitação de cotação de um usuário pelo ID da solicitação
|
317
|
+
def encontrarSolicitacaoDeCotacaoPorId (id, usertoken)
|
318
|
+
json = getRequest(
|
319
|
+
'/segmento/automoveis/encontrar/solicitacoes/cotacao/usuario'+id.to_s,
|
320
|
+
usertoken
|
321
|
+
)
|
322
|
+
return json
|
323
|
+
end
|
324
|
+
|
325
|
+
# Cancelar uma solicitação de cotação de um usuário
|
326
|
+
def cancelarSolicitacaoDeCotacao (id, usertoken)
|
327
|
+
json = postRequest(
|
328
|
+
'/segmento/automoveis/cancelar-cotacao/'+id.to_s,
|
329
|
+
usertoken
|
330
|
+
)
|
331
|
+
return json
|
332
|
+
end
|
333
|
+
|
334
|
+
# Encontrar as cotações de um seguro. Encontrar as respostas de uma solicitação
|
335
|
+
def encontrarCotacoes (usertoken, body)
|
336
|
+
json = postRequest(
|
337
|
+
'/segmento/automoveis/encontrar/respostas/cotacao',
|
338
|
+
usertoken,
|
339
|
+
body
|
340
|
+
# Exemplo de Body:
|
341
|
+
#{
|
342
|
+
# "solicitacao_id":2 // ID DA SOLICITAÇÃO
|
343
|
+
# }
|
344
|
+
)
|
345
|
+
return json
|
346
|
+
end
|
347
|
+
|
348
|
+
# Solicitar Contratação de um seguro
|
349
|
+
def solicitarContratacao (usertoken, body)
|
350
|
+
json = postRequest(
|
351
|
+
'/segmento/automoveis/solicitar/contratacao',
|
352
|
+
usertoken,
|
353
|
+
body
|
354
|
+
# Exemplo de Body para pagamento em Débito em conta:
|
355
|
+
# {
|
356
|
+
# "resposta_id":7,
|
357
|
+
# "numeroparcelas":4,
|
358
|
+
# "pagamento_id":1,
|
359
|
+
# "banco":"xxx",
|
360
|
+
# "conta":"123456789",
|
361
|
+
# "agencia":"yyy"
|
362
|
+
# }
|
363
|
+
#
|
364
|
+
# Exemplo de Body para pagamento em Boleto:
|
365
|
+
# {
|
366
|
+
# "resposta_id":7,
|
367
|
+
# "numeroparcelas":4,
|
368
|
+
# "pagamento_id":2
|
369
|
+
# }
|
370
|
+
)
|
371
|
+
return json
|
372
|
+
end
|
373
|
+
|
374
|
+
# Encontra todos as cotações em que o usuário solicitou a contratação do seguro
|
375
|
+
def encontrarSegurosContratadosPeloUsuario (usertoken)
|
376
|
+
json = postRequest(
|
377
|
+
'/segmento/automoveis/encontrar/respostas/contratacao',
|
378
|
+
usertoken
|
379
|
+
)
|
380
|
+
return json
|
381
|
+
end
|
382
|
+
|
383
|
+
# Encontra um seguro contratado pelo ID da cotação
|
384
|
+
def encontrarSeguroContratadoPeloIdCotacao (id, usertoken)
|
385
|
+
json = postRequest(
|
386
|
+
'/segmento/automoveis/encontrar/respostas/contratacao/'+id.to_s,
|
387
|
+
usertoken
|
388
|
+
)
|
389
|
+
return json
|
390
|
+
end
|
391
|
+
|
392
|
+
# Encontrar todas as apólices de um usuário
|
393
|
+
def encontrarApolicesDoUsuario (usertoken)
|
394
|
+
json = getRequest(
|
395
|
+
'/segmento/automoveis/encontrar/seguros',
|
396
|
+
usertoken
|
397
|
+
)
|
398
|
+
return json
|
399
|
+
end
|
400
|
+
|
401
|
+
# Encontrar apenas uma apólices de um usuário
|
402
|
+
def encontrarApolicesDoUsuario (id, usertoken)
|
403
|
+
json = getRequest(
|
404
|
+
'/segmento/automoveis/encontrar/seguros/'+id.to_s,
|
405
|
+
usertoken
|
406
|
+
)
|
407
|
+
return json
|
408
|
+
end
|
409
|
+
|
410
|
+
# Encontra todos os primeiros boletos de um usuário
|
411
|
+
def encontrarPrimeirosBoletosDoUsuario (usertoken)
|
412
|
+
json = postRequest(
|
413
|
+
'/user/boletos',
|
414
|
+
usertoken
|
415
|
+
)
|
416
|
+
return json
|
417
|
+
end
|
418
|
+
|
419
|
+
# Encontrar o primeiro boleto e uma cotação em específico
|
420
|
+
def encontrarPrimeiroBoletoDeUmaCotacao (usertoken, body)
|
421
|
+
json = postRequest(
|
422
|
+
'/user/boletos',
|
423
|
+
usertoken,
|
424
|
+
body
|
425
|
+
# Exemplo de um body:
|
426
|
+
# {
|
427
|
+
# "resposta_id":8 // ID da cotação
|
428
|
+
# }
|
429
|
+
)
|
430
|
+
return json
|
431
|
+
end
|
432
|
+
|
433
|
+
# Encontra todos os débitos em conta de um usuário
|
434
|
+
def encontrarDebitoContaDoUsuario (usertoken)
|
435
|
+
json = postRequest(
|
436
|
+
'/user/debitos-em-conta',
|
437
|
+
usertoken
|
438
|
+
)
|
439
|
+
return json
|
440
|
+
end
|
441
|
+
|
442
|
+
# Encontrar um débito em conta de uma cotação em específico
|
443
|
+
def encontrarDebitoContaDeUmaCotacao (usertoken, body)
|
444
|
+
json = postRequest(
|
445
|
+
'/pagamentos/debito-em-conta',
|
446
|
+
usertoken,
|
447
|
+
body
|
448
|
+
# Exemplo de um body:
|
449
|
+
# {
|
450
|
+
# "resposta_id":8 // ID da cotação
|
451
|
+
# }
|
452
|
+
)
|
453
|
+
return json
|
454
|
+
end
|
455
|
+
|
456
|
+
# Encontrar todos os boletos de um seguro
|
457
|
+
def encontrarTodosOsDemaisBoletosDeUmSeguro (usertoken, body)
|
458
|
+
json = postRequest(
|
459
|
+
'/segmento/automoveis/seguros/boletos',
|
460
|
+
usertoken,
|
461
|
+
body
|
462
|
+
# Exemplo de um body:
|
463
|
+
# {
|
464
|
+
# "resposta_id":8 // ID da cotação
|
465
|
+
# }
|
466
|
+
)
|
467
|
+
return json
|
468
|
+
end
|
469
|
+
|
470
|
+
# Encontrar o boleto de uma parcela específica
|
471
|
+
def encontrarBoletoDeUmaParcelaEspecifica (usertoken, body)
|
472
|
+
json = postRequest(
|
473
|
+
'/segmento/automoveis/encontrar/boleto/parcela',
|
474
|
+
usertoken,
|
475
|
+
body
|
476
|
+
# Exemplo de um body:
|
477
|
+
# {
|
478
|
+
# "resposta_id":21, // ID da cotação
|
479
|
+
# "parcela":3 // ID da parcela
|
480
|
+
# }
|
481
|
+
)
|
482
|
+
return json
|
483
|
+
end
|
484
|
+
|
485
|
+
end
|
486
|
+
|
487
|
+
module Brick
|
488
|
+
module Sdk
|
489
|
+
class Error < StandardError; end
|
490
|
+
def connect (apikey, environment)
|
491
|
+
return BrickApi.new(apikey, environment)
|
492
|
+
end
|
493
|
+
end
|
494
|
+
end
|
495
|
+
|
496
|
+
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: brick-sdk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- 'Brick Seguros '
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-07-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '13.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '13.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Write a longer description or delete this line.
|
42
|
+
email:
|
43
|
+
- bricktecnologia@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- bin/console
|
53
|
+
- bin/setup
|
54
|
+
- brick-sdk.gemspec
|
55
|
+
- lib/brick/sdk.rb
|
56
|
+
- lib/brick/sdk/version.rb
|
57
|
+
homepage: https://brickseguros.com.br/
|
58
|
+
licenses: []
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.4.0
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubygems_version: 3.1.6
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: Write a short summary, because RubyGems requires one.
|
79
|
+
test_files: []
|