belvo 0.14.0 → 0.15.0
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/.github/workflows/danger-pr-reviews.yml +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +43 -14
- data/lib/belvo/options.rb +5 -1
- data/lib/belvo/resources.rb +3 -1
- data/lib/belvo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b7f8335b754a94a4223c81da12e6968e3dfe266a39e3b20e10f2d20a129a3dc
|
4
|
+
data.tar.gz: 1ac5dc601938bd343f480c391f3951b6e1e8cc2261397c38c540094b6bd78428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 683c82016ad8b0c264d3c76b9559a432986a639645416f6ee82ff7925810c0a004325ddc880841ff6a4f140a268e6b01863a1a395bf1d790f34b43391871e89d
|
7
|
+
data.tar.gz: a4072bb4ffe6d220deefddcebdef857e0e9c9d06cdd0f6255520b5bbea72223e9a4451c0f93c5dbfc4485c9e2f9dbc43723d5916cd304fd63e02e97225310dd8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
belvo (0.
|
4
|
+
belvo (0.15.0)
|
5
5
|
faraday
|
6
6
|
faraday_middleware
|
7
7
|
typhoeus
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
addressable (2.
|
12
|
+
addressable (2.8.0)
|
13
13
|
public_suffix (>= 2.0.2, < 5.0)
|
14
14
|
ast (2.4.1)
|
15
15
|
claide (1.0.3)
|
data/README.md
CHANGED
@@ -33,31 +33,60 @@ Or install it yourself as:
|
|
33
33
|
|
34
34
|
$ gem install belvo
|
35
35
|
|
36
|
-
## Usage
|
36
|
+
## Usage (create link via widget)
|
37
|
+
|
38
|
+
When your user successfully links their account using the [Connect Widget](https://developers.belvo.com/docs/connect-widget), your implemented callback funciton will return the `link_id` required to make further API to retrieve information.
|
39
|
+
|
37
40
|
|
38
41
|
```ruby
|
39
42
|
require 'belvo'
|
40
43
|
|
41
44
|
belvo = Belvo::Client.new(
|
42
|
-
'
|
43
|
-
'
|
44
|
-
'
|
45
|
+
'your-secret-id',
|
46
|
+
'your-secret-password',
|
47
|
+
'sandbox'
|
45
48
|
)
|
46
49
|
|
47
50
|
begin
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
# Get the link_id from the result of your widget callback function
|
52
|
+
link_id = result_from_callback_function.id
|
53
|
+
|
54
|
+
belvo.accounts.retrieve(link: link_id)
|
55
|
+
|
56
|
+
puts belvo.accounts.list
|
57
|
+
rescue Belvo::RequestError => e
|
58
|
+
puts e.status_code
|
59
|
+
puts e.detail
|
60
|
+
end
|
61
|
+
```
|
62
|
+
|
63
|
+
## Usage (create link via SDK)
|
54
64
|
|
55
|
-
|
65
|
+
You can also manually create the link using the SDK. However, for security purposes, we highly recommend, that you use the [Connect Widget](https://developers.belvo.com/docs/connect-widget) to create the link and follow the **Usage (create link via widget)** example.
|
56
66
|
|
57
|
-
|
67
|
+
```ruby
|
68
|
+
require 'belvo'
|
69
|
+
|
70
|
+
belvo = Belvo::Client.new(
|
71
|
+
'your-secret-id',
|
72
|
+
'your-secret-password',
|
73
|
+
'sandbox'
|
74
|
+
)
|
75
|
+
|
76
|
+
begin
|
77
|
+
new_link = belvo.links.register( # Creating the link
|
78
|
+
institution: 'banamex_mx_retail',
|
79
|
+
username: 'janedoe',
|
80
|
+
password: 'super-secret',
|
81
|
+
options: { access_mode: Belvo::Link::AccessMode::SINGLE }
|
82
|
+
)
|
83
|
+
|
84
|
+
belvo.accounts.retrieve(link: new_link['id'])
|
85
|
+
|
86
|
+
puts belvo.accounts.list
|
58
87
|
rescue Belvo::RequestError => e
|
59
|
-
|
60
|
-
|
88
|
+
puts e.status_code
|
89
|
+
puts e.detail
|
61
90
|
end
|
62
91
|
```
|
63
92
|
|
data/lib/belvo/options.rb
CHANGED
@@ -85,8 +85,12 @@ module Belvo
|
|
85
85
|
# @!class IncomeOptions < Faraday::Options
|
86
86
|
# Contains configurable properties of an Income
|
87
87
|
# @!attribute save_data [rw] Should data be persisted or not.
|
88
|
+
# @!attribute date_from [rw] Date string (YYYY-MM-DD)
|
89
|
+
# @!attribute date_to [rw] Date string (YYYY-MM-DD)
|
88
90
|
class IncomeOptions < Faraday::Options.new(
|
89
|
-
:save_data
|
91
|
+
:save_data,
|
92
|
+
:date_from,
|
93
|
+
:date_to
|
90
94
|
)
|
91
95
|
end
|
92
96
|
|
data/lib/belvo/resources.rb
CHANGED
@@ -309,7 +309,9 @@ module Belvo
|
|
309
309
|
options = IncomeOptions.from(options)
|
310
310
|
body = {
|
311
311
|
link: link,
|
312
|
-
save_data: options.save_data || true
|
312
|
+
save_data: options.save_data || true,
|
313
|
+
date_from: options.date_from,
|
314
|
+
date_to: options.date_to
|
313
315
|
}.merge(options)
|
314
316
|
body = clean body: body
|
315
317
|
@session.post(@endpoint, body)
|
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.
|
4
|
+
version: 0.15.0
|
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: 2021-
|
11
|
+
date: 2021-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|