Skip to content

Commit 2ef3c9a

Browse files
authored
Merge pull request #84 from fintoc-com/master
Release 2.7.0
2 parents ba59cca + 1e6feb3 commit 2ef3c9a

9 files changed

Lines changed: 66 additions & 3 deletions

File tree

fintoc/core.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
)
1919
from fintoc.managers.v2 import AccountNumbersManager
2020
from fintoc.managers.v2 import AccountsManager as AccountsManagerV2
21-
from fintoc.managers.v2 import EntitiesManager, SimulateManager, TransfersManager
21+
from fintoc.managers.v2 import (
22+
AccountVerificationsManager,
23+
EntitiesManager,
24+
SimulateManager,
25+
TransfersManager,
26+
)
2227
from fintoc.version import __version__
2328

2429

@@ -62,5 +67,8 @@ def __init__(self, client):
6267
self.transfers = TransfersManager("/v2/transfers", client)
6368
self.accounts = AccountsManagerV2("/v2/accounts", client)
6469
self.account_numbers = AccountNumbersManager("/v2/account_numbers", client)
70+
self.account_verifications = AccountVerificationsManager(
71+
"/v2/account_verifications", client
72+
)
6573
self.entities = EntitiesManager("/v2/entities", client)
6674
self.simulate = SimulateManager("/v2/simulate", client)

fintoc/managers/v2/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Init file for the v2 managers module of the SDK."""
22

33
from .account_numbers_manager import AccountNumbersManager
4+
from .account_verifications_manager import AccountVerificationsManager
45
from .accounts_manager import AccountsManager
56
from .entities_manager import EntitiesManager
67
from .simulate_manager import SimulateManager
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Module to hold the account verification manager."""
2+
3+
from fintoc.mixins import ManagerMixin
4+
5+
6+
class AccountVerificationsManager(ManagerMixin):
7+
"""Represents an account verification manager."""
8+
9+
resource = "account_verification"
10+
methods = ["list", "get", "create"]

fintoc/resources/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from .transfer_account import TransferAccount
2424
from .v2.account import Account as AccountV2
2525
from .v2.account_number import AccountNumber
26+
from .v2.account_verification import AccountVerification
2627
from .v2.entity import Entity
2728
from .v2.transfer import Transfer
2829
from .webhook_endpoint import WebhookEndpoint

fintoc/resources/v2/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
from .account import Account
44
from .account_number import AccountNumber
5+
from .account_verification import AccountVerification
56
from .entity import Entity
67
from .transfer import Transfer
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Module to hold the AccountNumber resource."""
2+
3+
from fintoc.mixins import ResourceMixin
4+
5+
6+
class AccountVerification(ResourceMixin):
7+
"""Represents a Fintoc AccountVerification."""

fintoc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Module to hold the version utilities."""
22

3-
version_info = (2, 6, 0)
3+
version_info = (2, 7, 0)
44
__version__ = ".".join([str(x) for x in version_info])

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fintoc"
3-
version = "2.6.0"
3+
version = "2.7.0"
44
description = "The official Python client for the Fintoc API."
55
authors = ["Daniel Leal <daniel@fintoc.com>", "Nebil Kawas <nebil@uc.cl>"]
66
maintainers = ["Daniel Leal <daniel@fintoc.com>"]

tests/test_integration.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,41 @@ def test_v2_account_number_update(self):
563563
assert account_number.url == f"v2/account_numbers/{account_number_id}"
564564
assert account_number.json.metadata.test_key == metadata["test_key"]
565565

566+
def test_v2_account_verification_list(self):
567+
"""Test getting all account verifications using v2 API."""
568+
account_verifications = list(self.fintoc.v2.account_verifications.list())
569+
570+
assert len(account_verifications) > 0
571+
for account_verification in account_verifications:
572+
assert account_verification.method == "get"
573+
assert account_verification.url == "v2/account_verifications"
574+
575+
def test_v2_account_verification_get(self):
576+
"""Test getting a specific account number using v2 API."""
577+
account_verification_id = "test_account_verification_id"
578+
579+
account_verification = self.fintoc.v2.account_verifications.get(
580+
account_verification_id
581+
)
582+
583+
assert account_verification.method == "get"
584+
assert (
585+
account_verification.url
586+
== f"v2/account_verifications/{account_verification_id}"
587+
)
588+
589+
def test_v2_account_verification_create(self):
590+
"""Test creating an account number using v2 API."""
591+
account_number = "123456789"
592+
593+
account_verification = self.fintoc.v2.account_verifications.create(
594+
account_number=account_number
595+
)
596+
597+
assert account_verification.method == "post"
598+
assert account_verification.url == "v2/account_verifications"
599+
assert account_verification.json.account_number == account_number
600+
566601
def test_v2_entities_list(self):
567602
"""Test getting all entities using v2 API."""
568603
entities = list(self.fintoc.v2.entities.list())

0 commit comments

Comments
 (0)