belvo 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c1dcb245d74ddc040cd5e0f820ff9ecefa761e0135ee16fe5b08a6bf89dae26
4
- data.tar.gz: d2a243cd3f86fd7bb295a8fd85dab1e7226aa95f60ee5d8c30a5b3905dcd9918
3
+ metadata.gz: 8746f7636ac5bd7c67d0041ec84aa9240d9477687d98f826c28ea22135beb9c7
4
+ data.tar.gz: 91849cb78edce6d00eb636c29334b6eb4c958cf4e089ce734e5bda2f74fe3f54
5
5
  SHA512:
6
- metadata.gz: 96a5bafd4609f9502bb7d228b7fab60064560d35b10b78250c525981e797b2d052cce96e89ce3aa5edfd017a6fbafde24a44c6f96a8f63b392f27ec3c0b599d7
7
- data.tar.gz: ac7a333d2ef31d24d9563dd63eabbfb9cc187140df38b6c0044d641a748d2d6326690d0222152e66810464371c43dcf92310677bbf32662c603e555558701a18
6
+ metadata.gz: 7e9f1c00f82387e356be66ce824cf97b0eb11472e8eb738e5e5db759317e957b9908238187f199b74844587fac9db3f4f4854c7eaf855b58cbf46ee1a395c886
7
+ data.tar.gz: 4d88c38fca8ca0e206844f7e0bedd33b323e6fba76f14cc30aa1adee405d252978cd373282952dacb581aede77af9b6db8046078e90c054545b6af88e179bbed
@@ -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'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- belvo (0.6.0)
4
+ belvo (0.6.1)
5
5
  faraday
6
6
  faraday_middleware
7
7
  typhoeus
@@ -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 = ['hello@belvo.co']
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
@@ -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
@@ -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.
@@ -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
- password2: password2,
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Belvo
4
4
  # belvo-ruby current version
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
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.6.0
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-05-25 00:00:00.000000000 Z
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
- - hello@belvo.co
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.1.2
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