belvo 0.6.0 → 0.6.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 +4 -4
- data/.travis.yml +9 -1
- data/Gemfile.lock +1 -1
- data/belvo.gemspec +1 -1
- data/lib/belvo.rb +6 -0
- data/lib/belvo/options.rb +14 -0
- data/lib/belvo/resources.rb +25 -9
- data/lib/belvo/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8746f7636ac5bd7c67d0041ec84aa9240d9477687d98f826c28ea22135beb9c7
|
4
|
+
data.tar.gz: 91849cb78edce6d00eb636c29334b6eb4c958cf4e089ce734e5bda2f74fe3f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e9f1c00f82387e356be66ce824cf97b0eb11472e8eb738e5e5db759317e957b9908238187f199b74844587fac9db3f4f4854c7eaf855b58cbf46ee1a395c886
|
7
|
+
data.tar.gz: 4d88c38fca8ca0e206844f7e0bedd33b323e6fba76f14cc30aa1adee405d252978cd373282952dacb581aede77af9b6db8046078e90c054545b6af88e179bbed
|
data/.travis.yml
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
---
|
2
1
|
language: ruby
|
3
2
|
cache: bundler
|
4
3
|
rvm:
|
@@ -7,3 +6,12 @@ before_install: gem install bundler -v 2.1.4
|
|
7
6
|
script:
|
8
7
|
- bundle exec rubocop
|
9
8
|
- bundle exec rspec spec
|
9
|
+
deploy:
|
10
|
+
provider: rubygems
|
11
|
+
api_key:
|
12
|
+
secure: nsKurIEds1W6zwyj0mDmYx77amlDJOycegZV9o+OrBOzRRcpT+O3oFHGouMzAQyIbdUtmWyXp9uJHBEz7Q6Zc5fy6iG05sGO7tFoJMlKiPE5piiOTM5y6qt1GjZ1MYIU0rpnsp9QDsVUR1ATGpoD9O/zzn/lOPbxp2FoWHqWra84D/1jvVXPTqslLgup+GDsxseiAfwTMoTy65TXodISkvoYtlPL3EBV4/XQVBjVGGtM5mdjDJg+YA4yVA2NwCCjhFcj88fRxBmqWRnG/pzmX3nyRlMGjtUBm8OpLSR1NiXXqgzYUAVMD8/8VL/h3OsBqvwqgjZKMO6rXqNKFJQAxYUqvJaLcHP8D05dxWlumqwxlHzscKWLjAe7JbVo2DiAMvMTR8NTJOI7LOraU10iFHtmwAVnyBOaSJUVJuFgAoybq9tqYoZ/uZ7shCuWVNUIWIQM7HN9v99tfvemXMB+2RIN565bzBWSorn5MvXsApvqCLLDFuRnt7urR+0ZyT4dKXgvWRhnNOQgiMwEE/8+Y66nKVB7iNxFDw6LtittyoOZ0HvbHQDtqXOkzT/yaq2Ff2zwuUNYrCHqcdnxg5TBOYg5ndurcFxAc77ZlNSvidEC9tgXHA1m+r0Vq+ZCWOiyyohX33ZfA/UsAIStKr7a6ZLZZywuiqXasg1O9XoRB74=
|
13
|
+
gem: belvo
|
14
|
+
on:
|
15
|
+
tags: true
|
16
|
+
repo: belvo-finance/belvo-ruby
|
17
|
+
skip_cleanup: 'true'
|
data/Gemfile.lock
CHANGED
data/belvo.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'belvo'
|
7
7
|
spec.version = Belvo::VERSION
|
8
8
|
spec.authors = ['Belvo Finance S.L.']
|
9
|
-
spec.email = ['
|
9
|
+
spec.email = ['sdks@belvo.co']
|
10
10
|
spec.license = 'MIT'
|
11
11
|
spec.summary = 'The Ruby gem for the Belvo API'
|
12
12
|
spec.description = %(Belvo is the leading Open Banking API platform in Latin
|
data/lib/belvo.rb
CHANGED
@@ -63,6 +63,12 @@ module Belvo
|
|
63
63
|
@statements = Statement.new @session
|
64
64
|
end
|
65
65
|
|
66
|
+
# Provides access to Incomes resource
|
67
|
+
# @return [Income]
|
68
|
+
def incomes
|
69
|
+
@incomes = Income.new @session
|
70
|
+
end
|
71
|
+
|
66
72
|
# Provides access to Invoices resource
|
67
73
|
# @return [Invoice]
|
68
74
|
def invoices
|
data/lib/belvo/options.rb
CHANGED
@@ -7,11 +7,15 @@ module Belvo
|
|
7
7
|
# Contains the configurable properties for a Link
|
8
8
|
# @!attribute access_mode [rw] Link access mode (SINGLE or RECURRENT)
|
9
9
|
# @!attribute token [rw] OTP token required by the institution
|
10
|
+
# @!attribute username2 [rw] End-user secondary username, if any
|
11
|
+
# @!attribute password2 [rw] End-user secondary password, if any
|
10
12
|
# @!attribute encryption_key [rw] Custom encryption key
|
11
13
|
# @!attribute username_type [rw] Type of the username provided
|
12
14
|
class LinkOptions < Faraday::Options.new(
|
13
15
|
:access_mode,
|
14
16
|
:token,
|
17
|
+
:username2,
|
18
|
+
:password2,
|
15
19
|
:encryption_key,
|
16
20
|
:username_type,
|
17
21
|
:certificate,
|
@@ -86,6 +90,16 @@ module Belvo
|
|
86
90
|
)
|
87
91
|
end
|
88
92
|
|
93
|
+
# @!class IncomeOptions < Faraday::Options
|
94
|
+
# Contains configurable properties of an Income
|
95
|
+
# @!attribute save_data [rw] Should data be persisted or not.
|
96
|
+
# @!attribute encryption_key [rw] Custom encryption key
|
97
|
+
class IncomeOptions < Faraday::Options.new(
|
98
|
+
:encryption_key,
|
99
|
+
:save_data
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
89
103
|
# @!class InvoiceOptions < Faraday::Options
|
90
104
|
# Contains configurable properties of an Invoice
|
91
105
|
# @!attribute save_data [rw] Should data be persisted or not.
|
data/lib/belvo/resources.rb
CHANGED
@@ -77,7 +77,6 @@ module Belvo
|
|
77
77
|
# @param institution [String] Institution name
|
78
78
|
# @param username [String] End-user username
|
79
79
|
# @param password [String] End-user password
|
80
|
-
# @param password2 [String, nil] End-user secondary password, if any
|
81
80
|
# @param options [LinkOptions] Configurable properties
|
82
81
|
# @return [Hash] created link details
|
83
82
|
# @raise [RequestError] If response code is different than 2XX
|
@@ -85,7 +84,6 @@ module Belvo
|
|
85
84
|
institution:,
|
86
85
|
username:,
|
87
86
|
password:,
|
88
|
-
password2: nil,
|
89
87
|
options: nil
|
90
88
|
)
|
91
89
|
options = LinkOptions.from(options)
|
@@ -95,13 +93,7 @@ module Belvo
|
|
95
93
|
institution: institution,
|
96
94
|
username: username,
|
97
95
|
password: password,
|
98
|
-
|
99
|
-
token: options.token,
|
100
|
-
encryption_key: options.encryption_key,
|
101
|
-
access_mode: options.access_mode || AccessMode::SINGLE,
|
102
|
-
username_type: options.username_type,
|
103
|
-
certificate: options.certificate,
|
104
|
-
private_key: options.private_key
|
96
|
+
access_mode: options.access_mode || AccessMode::SINGLE
|
105
97
|
}.merge(options)
|
106
98
|
body = clean body: body
|
107
99
|
@session.post(@endpoint, body)
|
@@ -277,6 +269,30 @@ module Belvo
|
|
277
269
|
end
|
278
270
|
end
|
279
271
|
|
272
|
+
# A Income contains a resume of monthly Transactions inside an Account.
|
273
|
+
class Income < Resource
|
274
|
+
def initialize(session)
|
275
|
+
super(session)
|
276
|
+
@endpoint = 'incomes/'
|
277
|
+
end
|
278
|
+
|
279
|
+
# Retrieve incomes information from a specific banking link.
|
280
|
+
# @param link [String] Link UUID
|
281
|
+
# @param options [IncomesOptions] Configurable properties
|
282
|
+
# @return [Hash] created incomes details
|
283
|
+
# @raise [RequestError] If response code is different than 2XX
|
284
|
+
def retrieve(link:, options: nil)
|
285
|
+
options = IncomeOptions.from(options)
|
286
|
+
body = {
|
287
|
+
link: link,
|
288
|
+
encryption_key: options.encryption_key,
|
289
|
+
save_data: options.save_data || true
|
290
|
+
}.merge(options)
|
291
|
+
body = clean body: body
|
292
|
+
@session.post(@endpoint, body)
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
280
296
|
# An Invoice is the representation of an electronic invoice, that can be
|
281
297
|
# received or sent, by a business or an individual and has been uploaded
|
282
298
|
# to the fiscal institution website
|
data/lib/belvo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: belvo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Belvo Finance S.L.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -141,7 +141,7 @@ description: |-
|
|
141
141
|
America and the easiest way for users to connect their
|
142
142
|
account to an app
|
143
143
|
email:
|
144
|
-
-
|
144
|
+
- sdks@belvo.co
|
145
145
|
executables: []
|
146
146
|
extensions: []
|
147
147
|
extra_rdoc_files: []
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
194
|
+
rubygems_version: 3.0.8
|
195
195
|
signing_key:
|
196
196
|
specification_version: 4
|
197
197
|
summary: The Ruby gem for the Belvo API
|