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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '038fbaeb161f1c341855ded020989160dc8ebbbcea33f5fe05fa0c92c81d0bcf'
4
- data.tar.gz: 4eee5f78d13eb4fff6a3a01ed50aa673a4b62b0bb10b45b86795d8e980f1a48d
3
+ metadata.gz: 6b7f8335b754a94a4223c81da12e6968e3dfe266a39e3b20e10f2d20a129a3dc
4
+ data.tar.gz: 1ac5dc601938bd343f480c391f3951b6e1e8cc2261397c38c540094b6bd78428
5
5
  SHA512:
6
- metadata.gz: 4845b72c9a053c7bc8fabe97d6990cd1006fc75b4493f42944aac21cc3aea72860a2d9d7ab0cc0ae56f1a68f465c9c0aff1c9ca76c39e3ee82a4f638862f955b
7
- data.tar.gz: d41485f0c38659baa74b675d9220f3f1a07086d62c0ead42c886e3dedd06d0c4bcaab7ee878cc5cbe1dcf06e01eb7cd0d71413925be407c26af1617b596e1e1f
6
+ metadata.gz: 683c82016ad8b0c264d3c76b9559a432986a639645416f6ee82ff7925810c0a004325ddc880841ff6a4f140a268e6b01863a1a395bf1d790f34b43391871e89d
7
+ data.tar.gz: a4072bb4ffe6d220deefddcebdef857e0e9c9d06cdd0f6255520b5bbea72223e9a4451c0f93c5dbfc4485c9e2f9dbc43723d5916cd304fd63e02e97225310dd8
@@ -11,7 +11,7 @@ jobs:
11
11
  - name: Checkout Code
12
12
  uses: actions/checkout@v2
13
13
  with:
14
- fetch-depth: 1
14
+ fetch-depth: 10
15
15
 
16
16
  # Setup ruby
17
17
  - name: Set up Ruby 2.6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- belvo (0.14.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.7.0)
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
- 'af6e69ff-43fa-4e10-8d90-3d217309a1e5',
43
- 'gdi64m68Lc6xUjIKN3aJF2fZd51wD36lTjGVyJO5xQBfL7PRsgFef-ADXBxIhUnd',
44
- 'https://sandbox.belvo.com'
45
+ 'your-secret-id',
46
+ 'your-secret-password',
47
+ 'sandbox'
45
48
  )
46
49
 
47
50
  begin
48
- new_link = belvo.links.register(
49
- institution: 'banamex_mx_retail',
50
- username: 'janedoe',
51
- password: 'super-secret',
52
- options: { access_mode: Belvo::Link::AccessMode::SINGLE }
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
- belvo.accounts.retrieve(link: new_link['id'])
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
- puts belvo.accounts.list
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
- puts e.status_code
60
- puts e.detail
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
 
@@ -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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Belvo
4
4
  # belvo-ruby current version
5
- VERSION = '0.14.0'
5
+ VERSION = '0.15.0'
6
6
  end
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.14.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-07-05 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday