belvo 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +6 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +18 -0
- data/.github/pull_request_template.md +10 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +27 -0
- data/.travis.yml +9 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +103 -0
- data/LICENSE +21 -0
- data/README.md +67 -0
- data/Rakefile +8 -0
- data/belvo.gemspec +42 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/belvo.rb +84 -0
- data/lib/belvo/exceptions.rb +31 -0
- data/lib/belvo/http.rb +165 -0
- data/lib/belvo/options.rb +114 -0
- data/lib/belvo/resources.rb +344 -0
- data/lib/belvo/version.rb +6 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 50dc56e84a0e3da9460063b4d5589044ad4d88d29f8182ac21d106953e169d55
|
4
|
+
data.tar.gz: 50d11079afd1b518d03e30b75d5b1dc5a44e725d7c449cf0036ecc36294a404e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '01414806db87f0512b9c8fe0ff9c611e2e248edb18c24a368173b35b439da0a7fa10b29e25d8e5c86048e4b67936e1d2359b886d94cb2a55ffb558bcc05f1cb0'
|
7
|
+
data.tar.gz: 97053b093f9ac116decbad414b859da65de6b3ee2d18a53dfca5bd896db2a302be3c15f8d3c2823d144d7078ab14f92d09775cc16e1249d24e2113c3cf081c42
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
## Description of the problem
|
11
|
+
|
12
|
+
## Expected impact
|
13
|
+
|
14
|
+
## Proposed solution
|
15
|
+
In this story, we will ...
|
16
|
+
This is precisely how we will do it:
|
17
|
+
|
18
|
+
- ...
|
@@ -0,0 +1,10 @@
|
|
1
|
+
:question: What
|
2
|
+
---
|
3
|
+
<!-- Let us know what did you change in the code -->
|
4
|
+
|
5
|
+
|
6
|
+
:speech_balloon: Why
|
7
|
+
---
|
8
|
+
<!-- Are there any arguments that will help to understand these changes? Okay, put'em here... -->
|
9
|
+
|
10
|
+
<!-- If this PR Relates or Fixes an issue, please also add it -->
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
3
|
+
RSpec/ExampleLength:
|
4
|
+
Max: 20
|
5
|
+
|
6
|
+
Metrics/MethodLength:
|
7
|
+
Max: 20
|
8
|
+
|
9
|
+
Metrics/BlockLength:
|
10
|
+
Exclude:
|
11
|
+
- 'spec/**/*.rb'
|
12
|
+
- '*.gemspec'
|
13
|
+
|
14
|
+
Lint/RaiseException:
|
15
|
+
Enabled: true
|
16
|
+
|
17
|
+
Lint/StructNewOverride:
|
18
|
+
Enabled: true
|
19
|
+
|
20
|
+
Style/HashEachMethods:
|
21
|
+
Enabled: true
|
22
|
+
|
23
|
+
Style/HashTransformKeys:
|
24
|
+
Enabled: true
|
25
|
+
|
26
|
+
Style/HashTransformValues:
|
27
|
+
Enabled: true
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -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 hello@belvo.co. 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 [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in belvo.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem 'coveralls', require: false
|
9
|
+
gem 'faraday'
|
10
|
+
gem 'faraday_middleware'
|
11
|
+
gem 'rake', '~> 12.0'
|
12
|
+
gem 'rspec', '~> 3.0'
|
13
|
+
gem 'rubocop', '~> 0.81.0', require: false
|
14
|
+
gem 'rubocop-rspec', require: false
|
15
|
+
gem 'typhoeus'
|
16
|
+
gem 'webmock'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
belvo (0.3.1)
|
5
|
+
faraday
|
6
|
+
faraday_middleware
|
7
|
+
typhoeus
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
addressable (2.7.0)
|
13
|
+
public_suffix (>= 2.0.2, < 5.0)
|
14
|
+
ast (2.4.0)
|
15
|
+
coveralls (0.8.23)
|
16
|
+
json (>= 1.8, < 3)
|
17
|
+
simplecov (~> 0.16.1)
|
18
|
+
term-ansicolor (~> 1.3)
|
19
|
+
thor (>= 0.19.4, < 2.0)
|
20
|
+
tins (~> 1.6)
|
21
|
+
crack (0.4.3)
|
22
|
+
safe_yaml (~> 1.0.0)
|
23
|
+
diff-lcs (1.3)
|
24
|
+
docile (1.3.2)
|
25
|
+
ethon (0.12.0)
|
26
|
+
ffi (>= 1.3.0)
|
27
|
+
faraday (1.0.1)
|
28
|
+
multipart-post (>= 1.2, < 3)
|
29
|
+
faraday_middleware (1.0.0)
|
30
|
+
faraday (~> 1.0)
|
31
|
+
ffi (1.12.2)
|
32
|
+
hashdiff (1.0.1)
|
33
|
+
jaro_winkler (1.5.4)
|
34
|
+
json (2.3.0)
|
35
|
+
multipart-post (2.1.1)
|
36
|
+
parallel (1.19.1)
|
37
|
+
parser (2.7.1.0)
|
38
|
+
ast (~> 2.4.0)
|
39
|
+
public_suffix (4.0.4)
|
40
|
+
rainbow (3.0.0)
|
41
|
+
rake (12.3.3)
|
42
|
+
rexml (3.2.4)
|
43
|
+
rspec (3.9.0)
|
44
|
+
rspec-core (~> 3.9.0)
|
45
|
+
rspec-expectations (~> 3.9.0)
|
46
|
+
rspec-mocks (~> 3.9.0)
|
47
|
+
rspec-core (3.9.1)
|
48
|
+
rspec-support (~> 3.9.1)
|
49
|
+
rspec-expectations (3.9.1)
|
50
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
+
rspec-support (~> 3.9.0)
|
52
|
+
rspec-mocks (3.9.1)
|
53
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
+
rspec-support (~> 3.9.0)
|
55
|
+
rspec-support (3.9.2)
|
56
|
+
rubocop (0.81.0)
|
57
|
+
jaro_winkler (~> 1.5.1)
|
58
|
+
parallel (~> 1.10)
|
59
|
+
parser (>= 2.7.0.1)
|
60
|
+
rainbow (>= 2.2.2, < 4.0)
|
61
|
+
rexml
|
62
|
+
ruby-progressbar (~> 1.7)
|
63
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
64
|
+
rubocop-rspec (1.38.1)
|
65
|
+
rubocop (>= 0.68.1)
|
66
|
+
ruby-progressbar (1.10.1)
|
67
|
+
safe_yaml (1.0.5)
|
68
|
+
simplecov (0.16.1)
|
69
|
+
docile (~> 1.1)
|
70
|
+
json (>= 1.8, < 3)
|
71
|
+
simplecov-html (~> 0.10.0)
|
72
|
+
simplecov-html (0.10.2)
|
73
|
+
sync (0.5.0)
|
74
|
+
term-ansicolor (1.7.1)
|
75
|
+
tins (~> 1.0)
|
76
|
+
thor (1.0.1)
|
77
|
+
tins (1.24.1)
|
78
|
+
sync
|
79
|
+
typhoeus (1.3.1)
|
80
|
+
ethon (>= 0.9.0)
|
81
|
+
unicode-display_width (1.7.0)
|
82
|
+
webmock (3.8.3)
|
83
|
+
addressable (>= 2.3.6)
|
84
|
+
crack (>= 0.3.2)
|
85
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
86
|
+
|
87
|
+
PLATFORMS
|
88
|
+
ruby
|
89
|
+
|
90
|
+
DEPENDENCIES
|
91
|
+
belvo!
|
92
|
+
coveralls
|
93
|
+
faraday
|
94
|
+
faraday_middleware
|
95
|
+
rake (~> 12.0)
|
96
|
+
rspec (~> 3.0)
|
97
|
+
rubocop (~> 0.81.0)
|
98
|
+
rubocop-rspec
|
99
|
+
typhoeus
|
100
|
+
webmock
|
101
|
+
|
102
|
+
BUNDLED WITH
|
103
|
+
2.1.4
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Belvo
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
<h1 align="center">Belvo Ruby Gem</h1>
|
2
|
+
<p align="center">
|
3
|
+
<a href="https://rubygems.org/gems/belvo"><img alt="Rubygems.org" src="https://img.shields.io/gem/v/belvo?style=for-the-badge"></a>
|
4
|
+
<a href="https://travis-ci.com/belvo-finance/belvo-ruby"><img alt="Travis (.com)" src="https://img.shields.io/travis/com/belvo-finance/belvo-ruby/master?style=for-the-badge"></a>
|
5
|
+
<a href="https://coveralls.io/github/belvo-finance/belvo-ruby"><img alt="Coveralls github" src="https://img.shields.io/coveralls/github/belvo-finance/belvo-ruby?style=for-the-badge"></a>
|
6
|
+
<a href="https://codeclimate.com/github/belvo-finance/belvo-ruby"><img alt="CodeClimate maintainability" src="https://img.shields.io/codeclimate/maintainability/belvo-finance/belvo-ruby?style=for-the-badge"></a>
|
7
|
+
</p>
|
8
|
+
<p align="center"><a href="https://developers.belvo.co">Developers portal</a> | <a href="https://belvo-finance.github.io/belvo-ruby">Documentation</a></p>
|
9
|
+
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'belvo'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle install
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install belvo
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'belvo'
|
31
|
+
|
32
|
+
belvo = Belvo::Client.new(
|
33
|
+
'af6e69ff-43fa-4e10-8d90-3d217309a1e5',
|
34
|
+
'gdi64m68Lc6xUjIKN3aJF2fZd51wD36lTjGVyJO5xQBfL7PRsgFef-ADXBxIhUnd',
|
35
|
+
'https://sandbox.belvo.co'
|
36
|
+
)
|
37
|
+
|
38
|
+
begin
|
39
|
+
new_link = belvo.links.register(
|
40
|
+
institution: 'banamex_mx_retail',
|
41
|
+
username: 'janedoe',
|
42
|
+
password: 'super-secret'
|
43
|
+
)
|
44
|
+
|
45
|
+
belvo.accounts.retrieve(link: new_link['id'])
|
46
|
+
|
47
|
+
puts belvo.accounts.list
|
48
|
+
rescue Belvo::RequestError => e
|
49
|
+
puts e.status_code
|
50
|
+
puts e.detail
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
## Development
|
55
|
+
|
56
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
57
|
+
|
58
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
59
|
+
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/belvo-finance/belvo-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/belvo-finance/belvo-ruby/blob/master/CODE_OF_CONDUCT.md).
|
63
|
+
|
64
|
+
|
65
|
+
## Code of Conduct
|
66
|
+
|
67
|
+
Everyone interacting in the Belvo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/belvo-finance/belvo-ruby/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/belvo.gemspec
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/belvo/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'belvo'
|
7
|
+
spec.version = Belvo::VERSION
|
8
|
+
spec.authors = ['Belvo Finance S.L.']
|
9
|
+
spec.email = ['hello@belvo.co']
|
10
|
+
spec.license = 'MIT'
|
11
|
+
spec.summary = 'The Ruby gem for the Belvo API'
|
12
|
+
spec.description = %(Belvo is the leading Open Banking API platform in Latin
|
13
|
+
America and the easiest way for users to connect their
|
14
|
+
account to an app)
|
15
|
+
spec.homepage = 'https://github.com/belvo-finance/belvo-ruby'
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
17
|
+
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/belvo-finance/belvo-ruby'
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/belvo-finance/belvo-ruby/blob/master/README.md'
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
f.match(%r{^(test|spec|features)/})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
spec.bindir = 'exe'
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
|
32
|
+
spec.add_dependency 'faraday'
|
33
|
+
spec.add_dependency 'faraday_middleware'
|
34
|
+
spec.add_dependency 'typhoeus'
|
35
|
+
|
36
|
+
spec.add_development_dependency 'coveralls'
|
37
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
38
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
|
+
spec.add_development_dependency 'rubocop', '~> 0.81.0'
|
40
|
+
spec.add_development_dependency 'rubocop-rspec'
|
41
|
+
spec.add_development_dependency 'webmock'
|
42
|
+
end
|
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 'belvo'
|
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__)
|