creditario-client 0.0.1.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.gitignore +14 -0
  4. data/.gitlab-ci.yml +23 -0
  5. data/.rubocop.yml +155 -0
  6. data/.travis.yml +5 -0
  7. data/CODE_OF_CONDUCT.md +74 -0
  8. data/Dockerfile +3 -0
  9. data/Gemfile +8 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +241 -0
  12. data/Rakefile +21 -0
  13. data/bin/console +15 -0
  14. data/bin/setup +8 -0
  15. data/creditario-client.gemspec +35 -0
  16. data/lib/creditario/api/create.rb +29 -0
  17. data/lib/creditario/api/delete.rb +25 -0
  18. data/lib/creditario/api/list.rb +27 -0
  19. data/lib/creditario/api/multipart.rb +29 -0
  20. data/lib/creditario/api/request.rb +101 -0
  21. data/lib/creditario/api/retrieve.rb +32 -0
  22. data/lib/creditario/api/update.rb +32 -0
  23. data/lib/creditario/client.rb +183 -0
  24. data/lib/creditario/client/railtie.rb +14 -0
  25. data/lib/creditario/client/version.rb +9 -0
  26. data/lib/creditario/exceptions.rb +121 -0
  27. data/lib/creditario/repositories/applications.rb +50 -0
  28. data/lib/creditario/repositories/attachments.rb +50 -0
  29. data/lib/creditario/repositories/catalogs.rb +59 -0
  30. data/lib/creditario/repositories/contracts.rb +29 -0
  31. data/lib/creditario/repositories/credit_estimates.rb +29 -0
  32. data/lib/creditario/repositories/credits.rb +35 -0
  33. data/lib/creditario/repositories/customers.rb +50 -0
  34. data/lib/creditario/repositories/expenses.rb +41 -0
  35. data/lib/creditario/repositories/incomes.rb +41 -0
  36. data/lib/creditario/repositories/payments.rb +34 -0
  37. data/lib/creditario/repositories/products.rb +38 -0
  38. data/lib/creditario/repositories/references.rb +41 -0
  39. data/lib/creditario/resources/application.rb +27 -0
  40. data/lib/creditario/resources/attachment.rb +19 -0
  41. data/lib/creditario/resources/catalog.rb +35 -0
  42. data/lib/creditario/resources/contract.rb +21 -0
  43. data/lib/creditario/resources/credit.rb +19 -0
  44. data/lib/creditario/resources/credit_estimate.rb +19 -0
  45. data/lib/creditario/resources/customer.rb +25 -0
  46. data/lib/creditario/resources/expense.rb +19 -0
  47. data/lib/creditario/resources/income.rb +19 -0
  48. data/lib/creditario/resources/payment.rb +21 -0
  49. data/lib/creditario/resources/product.rb +21 -0
  50. data/lib/creditario/resources/reference.rb +19 -0
  51. data/lib/creditario/resources/resource.rb +96 -0
  52. data/lib/creditario/utils/paginated_collection.rb +45 -0
  53. data/lib/creditario/utils/resources_collection.rb +35 -0
  54. data/lib/generators/creditario/USAGE +13 -0
  55. data/lib/generators/creditario/install_generator.rb +17 -0
  56. data/lib/generators/creditario/templates/creditario.yml +12 -0
  57. data/lib/generators/creditario/templates/initializer.rb +4 -0
  58. data/rakelib/fixture_api_response.rake +10 -0
  59. data/rakelib/fixture_api_response.rb +114 -0
  60. metadata +214 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e3f134863c3b8a41b1aa6a04ab85ecdea2f8351a
4
+ data.tar.gz: 3ad89b47f7616b79e9a9749b9e14fbffdd95f234
5
+ SHA512:
6
+ metadata.gz: 36fcf9b0ff2df07227c8e2f36990be0bc4ac065395694cb3b288fca90434826c016a9ad7c9419f63cb7913600c8e5b44a29484ccdb793ae6f36fe9e3b8146430
7
+ data.tar.gz: 478866bd223b0f8b66f780574a11d152bfc166c0f207c2effa0ac30312aed4ad7a0db309d743ef352f88a6d31a150bcc956fe9266ac76ec35dfc46e7385d93c9
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .ruby-version
11
+ /public
12
+ /vendor
13
+
14
+ *.gem
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,23 @@
1
+ image: registry.michelada.io/financial/creditario-client/ci
2
+
3
+ cache:
4
+ key: ${CI_COMMIT_REF_SLUG}
5
+ paths:
6
+ - vendor/ruby
7
+
8
+ before_script:
9
+ - gem install bundler
10
+ - bundle install -j $(nproc) --path vendor
11
+
12
+ # the 'pages' job will deploy and build your site to the 'public' path
13
+ pages:
14
+ stage: deploy
15
+ script:
16
+ - bundle exec sdoc . -T rails --exclude="vendor/|test/"
17
+ - mv doc public
18
+ artifacts:
19
+ paths:
20
+ - public
21
+ only:
22
+ - master # this job will affect only the 'master' branch
23
+
data/.rubocop.yml ADDED
@@ -0,0 +1,155 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.5
3
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
+ # to ignore them, so only the ones explicitly set in this file are enabled.
5
+ DisabledByDefault: true
6
+
7
+ # Prefer &&/|| over and/or.
8
+ Style/AndOr:
9
+ Enabled: true
10
+
11
+ # Do not use braces for hash literals when they are the last argument of a
12
+ # method call.
13
+ Style/BracesAroundHashParameters:
14
+ Enabled: true
15
+ EnforcedStyle: context_dependent
16
+
17
+ # Align `when` with `case`.
18
+ Layout/CaseIndentation:
19
+ Enabled: true
20
+
21
+ # Align comments with method definitions.
22
+ Layout/CommentIndentation:
23
+ Enabled: true
24
+
25
+ Layout/ElseAlignment:
26
+ Enabled: true
27
+
28
+ # Align `end` with the matching keyword or starting expression except for
29
+ # assignments, where it should be aligned with the LHS.
30
+ Layout/EndAlignment:
31
+ Enabled: true
32
+ EnforcedStyleAlignWith: variable
33
+ AutoCorrect: true
34
+
35
+ Layout/EmptyLineAfterMagicComment:
36
+ Enabled: true
37
+
38
+ # In a regular class definition, no empty lines around the body.
39
+ Layout/EmptyLinesAroundClassBody:
40
+ Enabled: true
41
+
42
+ # In a regular method definition, no empty lines around the body.
43
+ Layout/EmptyLinesAroundMethodBody:
44
+ Enabled: true
45
+
46
+ # In a regular module definition, no empty lines around the body.
47
+ Layout/EmptyLinesAroundModuleBody:
48
+ Enabled: true
49
+
50
+ Layout/FirstParameterIndentation:
51
+ Enabled: true
52
+
53
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
54
+ Style/HashSyntax:
55
+ Enabled: true
56
+
57
+ # Method definitions after `private` or `protected` isolated calls need one
58
+ # extra level of indentation.
59
+ Layout/IndentationConsistency:
60
+ Enabled: true
61
+ EnforcedStyle: rails
62
+
63
+ # Two spaces, no tabs (for indentation).
64
+ Layout/IndentationWidth:
65
+ Enabled: true
66
+
67
+ Layout/LeadingCommentSpace:
68
+ Enabled: true
69
+
70
+ Layout/SpaceAfterColon:
71
+ Enabled: true
72
+
73
+ Layout/SpaceAfterComma:
74
+ Enabled: true
75
+
76
+ Layout/SpaceAroundEqualsInParameterDefault:
77
+ Enabled: true
78
+
79
+ Layout/SpaceAroundKeyword:
80
+ Enabled: true
81
+
82
+ Layout/SpaceAroundOperators:
83
+ Enabled: true
84
+
85
+ Layout/SpaceBeforeComma:
86
+ Enabled: true
87
+
88
+ Layout/SpaceBeforeFirstArg:
89
+ Enabled: true
90
+
91
+ Style/DefWithParentheses:
92
+ Enabled: true
93
+
94
+ # Defining a method with parameters needs parentheses.
95
+ Style/MethodDefParentheses:
96
+ Enabled: true
97
+
98
+ Style/FrozenStringLiteralComment:
99
+ Enabled: true
100
+ EnforcedStyle: always
101
+
102
+ # Use `foo {}` not `foo{}`.
103
+ Layout/SpaceBeforeBlockBraces:
104
+ Enabled: true
105
+
106
+ # Use `foo { bar }` not `foo {bar}`.
107
+ Layout/SpaceInsideBlockBraces:
108
+ Enabled: true
109
+
110
+ # Use `{ a: 1 }` not `{a:1}`.
111
+ Layout/SpaceInsideHashLiteralBraces:
112
+ Enabled: true
113
+
114
+ Layout/SpaceInsideParens:
115
+ Enabled: true
116
+
117
+ # Check quotes usage according to lint rule below.
118
+ Style/StringLiterals:
119
+ Enabled: true
120
+ EnforcedStyle: double_quotes
121
+
122
+ # Detect hard tabs, no hard tabs.
123
+ Layout/Tab:
124
+ Enabled: true
125
+
126
+ # Blank lines should not have any spaces.
127
+ Layout/TrailingBlankLines:
128
+ Enabled: true
129
+
130
+ # No trailing whitespace.
131
+ Layout/TrailingWhitespace:
132
+ Enabled: true
133
+
134
+ # Use quotes for string literals when they are enough.
135
+ Style/UnneededPercentQ:
136
+ Enabled: true
137
+
138
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
139
+ Lint/RequireParentheses:
140
+ Enabled: true
141
+
142
+ Lint/StringConversionInInterpolation:
143
+ Enabled: true
144
+
145
+ Style/RedundantReturn:
146
+ Enabled: true
147
+ AllowMultipleReturnValues: true
148
+
149
+ Style/Semicolon:
150
+ Enabled: true
151
+ AllowAsExpressionSeparator: true
152
+
153
+ # Prefer Foo.method over Foo::method
154
+ Style/ColonMethodCall:
155
+ Enabled: true
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
5
+ before_install: gem install bundler -v 2.0.1
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at eduardofigarola@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Dockerfile ADDED
@@ -0,0 +1,3 @@
1
+ FROM ruby:2.5.3-alpine3.9
2
+ RUN apk update && apk upgrade && \
3
+ apk add --no-cache git build-base
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in creditario-client.gemspec
8
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 michelada.io
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # Creditario::Client
2
+
3
+ ## Instalación
4
+
5
+ Solo añade a tu Gemfile:
6
+
7
+ gem "creditario-client", git: "git@git.michelada.io:financial/creditario-client.git"
8
+
9
+ ## Uso
10
+
11
+ ### Ruby on Rails
12
+
13
+ #### 5.2+
14
+
15
+ Si utilizas Ruby on Rails en su versión 5.2, hay 2 cosas que debes hacer, la primera es:
16
+
17
+ $ bundle exec rails g creditario:install
18
+
19
+ Y la segunda es editar tu archivo de credenciales, para añadir el *api_key* de tu Organización:
20
+
21
+ $ EDITOR=vim bundle exec rails credentials:edit
22
+
23
+ Dentro de tu archivo de credenciales, debes agregar lo siguiente:
24
+
25
+ creditario:
26
+ development:
27
+ api_key: BMBE96Wva8NaYMmVx4RavpXSy6Y6HKFe
28
+ production:
29
+ api_key: v48mbFLupTLWGvYnLVjDqaeEUJEYHmAM # Your production api_key
30
+
31
+ ¡Listo! Ya tienes el cliente para la API de creditar.io totalmente configurado.
32
+
33
+ #### \< 5.2
34
+
35
+ En caso de que tu aplicación de Rails no utilice el archivo de credenciales, tal vez prefieras
36
+ utilizar **variables de entorno** para configurar el `api_key` y el `api_base` del cliente para
37
+ la API de creditar.io
38
+
39
+ Todo lo que tienes que hacer es ejecutar:
40
+
41
+ $ bundle exec rails g creditario:install
42
+
43
+ Y actualizar el archivo `config/creditario.yml` que fue generado previamente:
44
+
45
+ default: &default
46
+ api_base: <%= ENV["CREDITARIO_API_URL"] || "http://localhost:3000" %>
47
+ api_key: <%= ENV["CREDITARIO_API_KEY"] %>
48
+
49
+ Listo, ahora solamente deberás inicializar las variables de entorno para que el cliente sea configurado correctamente.
50
+
51
+ ### Fuera de Rails
52
+
53
+ Si deseas usar la gema fuera de una aplicación de Rails. Justo después de requerirla en tu código debes configurar la `api_key` y la `api_base` a utilizar.
54
+
55
+ Esto lo puedes lograr con lo siguiente:
56
+
57
+ Creditario::Client.api_key = "BMBE96Wva8NaYMmVx4RavpXSy6Y6HKFe"
58
+ Creditario::Client.api_base = "http://localhost:3000"
59
+
60
+ ## Desarrollo
61
+
62
+ Recuerda que si necesitas hacer pruebas, deberás tener la API de creditar.io corriendo en tu máquina local o conectarte a la URL de staging.
63
+
64
+ Si estás haciendo pruebas locales, puedes especificar la URL y el puerto, gracias a la variable de entorno llamada: `CREDITARIO_API_URL`, usala antes de iniciar tus pruebas/desarrollo, ejemplo:
65
+
66
+ $ CREDITARIO_API_URL=http://localhost:9000 bundle exec rails server
67
+
68
+ Por defecto, siempre intentará conectarse a `http://localhost:3000` si no se pasa la variable de entorno.
69
+
70
+ ## Ejemplos
71
+
72
+ ### Productos
73
+
74
+ Las operaciones que puedes realizar sobre Productos son: listar y obtener.
75
+
76
+ #### Listar todos los Productos activos
77
+
78
+ result = Creditario::Products.list
79
+ => Creditario::PaginatedCollection
80
+
81
+ result.items
82
+ => [Creditario::Product, Creditario::Product, ...]
83
+
84
+ #### Obtener un Producto
85
+
86
+ Creditario::Products.retrieve("c005b7f7-a44a-4ec0-bf7f-73d15d806fd9")
87
+ => Creditario::Product
88
+
89
+ ### Clientes
90
+
91
+ Las operaciones que puedes realizar sobre Clientes son: listar, obtener, crear y actualizar.
92
+
93
+ #### Listar todos los Clientes
94
+
95
+ result = Creditario::Customers.list
96
+ => Creditario::PaginatedCollection
97
+
98
+ result.items
99
+ => [Creditario::Customer, Creditario::Customer, ...]
100
+
101
+ #### Obtener un Cliente
102
+
103
+ Creditario::Customers.retrieve("2e9d05b8-2180-4779-bab6-bdfd41d1569f")
104
+ => Creditario::Customer
105
+
106
+ #### Crear un Cliente
107
+
108
+ result = Creditario::Customers.create(email: "karla@quieredinero.com", product_id: "c005b7f7-a44a-4ec0-bf7f-73d15d806fd9")
109
+ => Creditario::Customer
110
+
111
+ #### Actualizar un Cliente
112
+
113
+ result = Creditario::Customers.update("2e9d05b8-2180-4779-bab6-bdfd41d1569f", { email: "karina@necesitadinero.com" })
114
+ => Creditario::Customer
115
+
116
+ ### Solicitudes
117
+
118
+ Las operaciones que puedes realizar sobre Solicitudes son: listar, obtener, crear y actualizar.
119
+
120
+ #### Listar todas las Solicitudes
121
+
122
+ result = Creditario::Applications.list
123
+ => Creditario::PaginatedCollection
124
+
125
+ result.items
126
+ => [Creditario::Application, Creditario::Application, ...]
127
+
128
+ #### Obtener una Solicitud
129
+
130
+ Creditario::Applications.retrieve("0b19e3b6-9fae-40e1-a7c2-f2db1cae8a5a")
131
+ => Creditario::Application
132
+
133
+ #### Crear una Solicitud
134
+
135
+ result = Creditario::Applications.create(customer_id: "2e9d05b8-2180-4779-bab6-bdfd41d1569f", product_id: "c005b7f7-a44a-4ec0-bf7f-73d15d806fd9")
136
+ => Creditario::Application
137
+
138
+ #### Actualizar una Solicitud
139
+
140
+ result = Creditario::Applications.update("c0324939-0802-41b2-b81e-04e8982270ec", { street: "Avenida Siempre Viva", exterior_number: "742" })
141
+ => Creditario::Application
142
+
143
+ ### Ingresos
144
+
145
+ Las operaciones que puedes realizar sobre Ingresos son: obtener, crear y eliminar.
146
+
147
+ #### Obtener un Ingreso
148
+
149
+ Creditario::Incomes.retrieve("0b19e3b6-9fae-40e1-a7c2-f2db1cae8a5a")
150
+ => Creditario::Income
151
+
152
+ #### Crear un Ingreso
153
+
154
+ result = Creditario::Incomes.create(classification: "Trabajo", amount_cents: 45000, credit_application_id: "636264b1-77a2-45ef-b643-e44cfbc84d40")
155
+ => Creditario::Income
156
+
157
+ #### Eliminar un Ingreso
158
+
159
+ result = Creditario::Incomes.delete("0b19e3b6-9fae-40e1-a7c2-f2db1cae8a5a")
160
+ => true
161
+
162
+ ### Egresos
163
+
164
+ Las operaciones que puedes realizar sobre Egresos son: obtener, crear y eliminar.
165
+
166
+ #### Obtener un Egreso
167
+
168
+ Creditario::Expenses.retrieve("eeedba2e-fc96-4f96-bd2e-bd046b256f96")
169
+ => Creditario::Expense
170
+
171
+ #### Crear un Egreso
172
+
173
+ result = Creditario::Expenses.create(classification: "Renta", amount_cents: 25000, credit_application_id: "636264b1-77a2-45ef-b643-e44cfbc84d40")
174
+ => Creditario::Expense
175
+
176
+ #### Eliminar un Egreso
177
+
178
+ result = Creditario::Expenses.delete("eeedba2e-fc96-4f96-bd2e-bd046b256f96")
179
+ => true
180
+
181
+ ### Referencias
182
+
183
+ Las operaciones que puedes realizar sobre Referencias son: obtener, crear y eliminar.
184
+
185
+ #### Obtener una Referencia
186
+
187
+ Creditario::References.retrieve("0b19e3b6-9fae-40e1-a7c2-f2db1cae8a5a")
188
+ => Creditario::Reference
189
+
190
+ #### Crear una Referencia
191
+
192
+ result = Creditario::References.create(classification: "Amistad", name: "Diane Nguyen", phone: "3129743789", credit_application_id: "636264b1-77a2-45ef-b643-e44cfbc84d40")
193
+ => Creditario::Reference
194
+
195
+ #### Eliminar una Referencia
196
+
197
+ result = Creditario::References.delete("0b19e3b6-9fae-40e1-a7c2-f2db1cae8a5a")
198
+ => true
199
+
200
+ ### Catálogos
201
+
202
+ Las operaciones que puedes realizar sobre Catálogos son: listar y obtener.
203
+
204
+ #### Listar Catálogos disponibles
205
+
206
+ result = Creditario::Catalogs.list
207
+ => Creditario::ResourcesCollection
208
+
209
+ result.items
210
+ => [Creditario::Catalog, Creditario::Catalog, ...]
211
+
212
+ #### Obtener valores de un Catálogo
213
+
214
+ Creditario::Catalog.retrieve(resource: "customer", field: "source")
215
+ => Creditario::ResourcesCollection
216
+
217
+ ### Estimaciones de Crédito
218
+
219
+ La operación que puedes realizar sobre Estimaciones de Crédito es: obtener.
220
+
221
+ #### Obtener una Estimación de Crédito
222
+
223
+ result = Creditario::CreditEstimates.retrieve(nil, product_id: "c005b7f7-a44a-4ec0-bf7f-73d15d806fd9", amount_cents: "5000000", installments_number: "12")
224
+ => Creditario::CreditEstimate
225
+
226
+ ### Créditos
227
+
228
+ Las operaciones que puedes realizar sobre Créditos son: listar y obtener.
229
+
230
+ #### Listar Créditos de un Cliente
231
+
232
+ result = Creditario::Credits.list(customer_id: "f916636d-e045-43e4-898d-14e6dddf13f9")
233
+ => Creditario::ResourcesCollection
234
+
235
+ result.items
236
+ => [Creditario::Credit, Creditario::Credit, ...]
237
+
238
+ #### Obtener un Crédito
239
+
240
+ result = Creditario::Credits.retrieve("33ca13b7-9910-430c-b5d7-7ba12a9b18a5")
241
+ => Creditario::Credit