fintoc 1.10.0 → 1.12.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: 60e9c0d402a45ce1462059bf4cb5b5f206e7b5a1c79ff2bd61834299af6fce01
4
- data.tar.gz: 89a7c33461389bb3a5190e63d99df22d5afe1c7091fb1cc50595426ff6e84311
3
+ metadata.gz: 46f4a08a0f5729437449360d3a7be048c10c3112ad582f700db63958b09f4285
4
+ data.tar.gz: a406f426788466ed069c2f7ad116c4c088577bdc5bdde6daeeda548e4b5245fe
5
5
  SHA512:
6
- metadata.gz: 28388ad1d43d031493f881874ed5f0a6370c4113500c3e0a8a15ea4bab031c330ab7ed54340aab2ec1852274a1c4615021f8a994a1d61756c89cbd8f6887d918
7
- data.tar.gz: 2d6f01f3d34afc8a68ed2a212734b1f48f5c61381714179c5b6333790abfa4f589486a04206bc56e476b65fdb28014129de60ca727b75be26cda522f07569004
6
+ metadata.gz: 5266af2326900c31d75f62851da55fa2a3184513ac665519108e49d90e593958dfe0eca22dd0d6b9e1527e138871b02ba1c0fe54c61612f876cbc2d3ed6fa875
7
+ data.tar.gz: 2de123ee0036be10999cf75817d947db62b9576306ba9e13ba8e57b4e10ff729c5ab532c8a0572061d3f176bc431c10960cd4c21a67e9581daee3032e05bf4eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintoc (1.10.0)
4
+ fintoc (1.12.0)
5
5
  http
6
6
  money-rails
7
7
  tabulate
data/README.md CHANGED
@@ -435,6 +435,10 @@ accounts = client.v2.accounts.list
435
435
 
436
436
  # Update an account
437
437
  updated_account = client.v2.accounts.update('account_id', description: 'Updated Description')
438
+
439
+ # Get the account certificate (signed download URL)
440
+ certificate = client.v2.accounts.certificate('account_id')
441
+ certificate.download_url
438
442
  ```
439
443
 
440
444
  #### Account Numbers
@@ -461,6 +465,9 @@ updated_account_number = client.v2.account_numbers.update(
461
465
  'account_number_id',
462
466
  description: 'Updated account number'
463
467
  )
468
+
469
+ # Get the certificate for an account number
470
+ certificate = client.v2.account_numbers.certificate('account_number_id')
464
471
  ```
465
472
 
466
473
  #### Transfers
data/lib/fintoc/errors.rb CHANGED
@@ -209,6 +209,7 @@ module Fintoc
209
209
  class InvoiceNotPayableError < FintocError; end
210
210
  class InvoiceNotVoidableError < FintocError; end
211
211
  class LegalRepresentativeRequiredError < FintocError; end
212
+ class LimitExceededError < FintocError; end
212
213
  class MandateLimitExceededError < FintocError; end
213
214
  class MaximumAmountLimitError < FintocError; end
214
215
  class MerchantChargeLimitExceededError < FintocError; end
@@ -1,4 +1,5 @@
1
1
  require 'fintoc/v2/resources/account_number'
2
+ require 'fintoc/v2/resources/account_certificate'
2
3
 
3
4
  module Fintoc
4
5
  module V2
@@ -33,6 +34,11 @@ module Fintoc
33
34
  _delete_account_number(account_number_id)
34
35
  end
35
36
 
37
+ def certificate(account_number_id)
38
+ data = @client.get(version: :v2).call("account_numbers/#{account_number_id}/certificate")
39
+ Fintoc::V2::AccountCertificate.new(**data)
40
+ end
41
+
36
42
  private
37
43
 
38
44
  def _create_account_number(
@@ -1,4 +1,5 @@
1
1
  require 'fintoc/v2/resources/account'
2
+ require 'fintoc/v2/resources/account_certificate'
2
3
 
3
4
  module Fintoc
4
5
  module V2
@@ -27,6 +28,11 @@ module Fintoc
27
28
  build_account(data)
28
29
  end
29
30
 
31
+ def certificate(account_id)
32
+ data = @client.get(version: :v2).call("accounts/#{account_id}/certificate")
33
+ Fintoc::V2::AccountCertificate.new(**data)
34
+ end
35
+
30
36
  private
31
37
 
32
38
  def _create_account(entity_id:, description:, idempotency_key: nil, **params)
@@ -54,6 +54,10 @@ module Fintoc
54
54
  refresh_from_account(updated_account)
55
55
  end
56
56
 
57
+ def certificate
58
+ @client.accounts.certificate(@id)
59
+ end
60
+
57
61
  def active?
58
62
  @status == 'active'
59
63
  end
@@ -0,0 +1,26 @@
1
+ module Fintoc
2
+ module V2
3
+ class AccountCertificate
4
+ attr_reader :object, :account_id, :account_number_id, :download_url, :expires_at
5
+
6
+ def initialize(
7
+ object:,
8
+ account_id:,
9
+ account_number_id:,
10
+ download_url:,
11
+ expires_at: nil,
12
+ **
13
+ )
14
+ @object = object
15
+ @account_id = account_id
16
+ @account_number_id = account_number_id
17
+ @download_url = download_url
18
+ @expires_at = expires_at
19
+ end
20
+
21
+ def to_s
22
+ "📄 Account certificate (#{@account_number_id})"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -57,6 +57,10 @@ module Fintoc
57
57
  refresh_from_account_number(updated_account_number)
58
58
  end
59
59
 
60
+ def certificate
61
+ @client.account_numbers.certificate(@id)
62
+ end
63
+
60
64
  def enabled?
61
65
  @status == 'enabled'
62
66
  end
@@ -1,3 +1,3 @@
1
1
  module Fintoc
2
- VERSION = '1.10.0'
2
+ VERSION = '1.12.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fintoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Ca Sardin
@@ -150,6 +150,7 @@ files:
150
150
  - lib/fintoc/v2/managers/transfer_batches_manager.rb
151
151
  - lib/fintoc/v2/managers/transfers_manager.rb
152
152
  - lib/fintoc/v2/resources/account.rb
153
+ - lib/fintoc/v2/resources/account_certificate.rb
153
154
  - lib/fintoc/v2/resources/account_number.rb
154
155
  - lib/fintoc/v2/resources/account_statement.rb
155
156
  - lib/fintoc/v2/resources/account_verification.rb