fintoc 2.2.2__tar.gz → 2.4.0__tar.gz

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.
Files changed (53) hide show
  1. {fintoc-2.2.2 → fintoc-2.4.0}/PKG-INFO +41 -23
  2. {fintoc-2.2.2 → fintoc-2.4.0}/README.md +38 -19
  3. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/client.py +12 -3
  4. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/core.py +15 -3
  5. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/__init__.py +2 -0
  6. fintoc-2.4.0/fintoc/managers/charges_manager.py +11 -0
  7. fintoc-2.4.0/fintoc/managers/subscription_intents_manager.py +11 -0
  8. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/__init__.py +2 -0
  9. fintoc-2.4.0/fintoc/resources/charge.py +7 -0
  10. fintoc-2.4.0/fintoc/resources/subscription_intent.py +7 -0
  11. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/version.py +1 -1
  12. {fintoc-2.2.2 → fintoc-2.4.0}/pyproject.toml +3 -3
  13. fintoc-2.4.0/setup.py +30 -0
  14. fintoc-2.2.2/setup.py +0 -30
  15. {fintoc-2.2.2 → fintoc-2.4.0}/LICENSE.md +0 -0
  16. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/__init__.py +0 -0
  17. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/constants.py +0 -0
  18. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/errors.py +0 -0
  19. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/accounts_manager.py +0 -0
  20. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/invoices_manager.py +0 -0
  21. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/links_manager.py +0 -0
  22. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/movements_manager.py +0 -0
  23. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/payment_intents_manager.py +0 -0
  24. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/refresh_intents_manager.py +0 -0
  25. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/subscriptions_manager.py +0 -0
  26. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/tax_returns_manager.py +0 -0
  27. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/managers/webhook_endpoints_manager.py +0 -0
  28. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/mixins/__init__.py +0 -0
  29. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/mixins/manager_mixin.py +0 -0
  30. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/mixins/resource_mixin.py +0 -0
  31. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/paginator.py +0 -0
  32. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resource_handlers.py +0 -0
  33. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/account.py +0 -0
  34. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/balance.py +0 -0
  35. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/generic_fintoc_resource.py +0 -0
  36. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/income.py +0 -0
  37. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/institution.py +0 -0
  38. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/institution_invoice.py +0 -0
  39. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/institution_tax_return.py +0 -0
  40. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/invoice.py +0 -0
  41. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/link.py +0 -0
  42. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/movement.py +0 -0
  43. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/other_taxes.py +0 -0
  44. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/payment_intent.py +0 -0
  45. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/refresh_intent.py +0 -0
  46. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/services_invoice.py +0 -0
  47. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/subscription.py +0 -0
  48. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/tax_return.py +0 -0
  49. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/taxpayer.py +0 -0
  50. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/tobacco_taxes.py +0 -0
  51. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/transfer_account.py +0 -0
  52. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/resources/webhook_endpoint.py +0 -0
  53. {fintoc-2.2.2 → fintoc-2.4.0}/fintoc/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fintoc
3
- Version: 2.2.2
3
+ Version: 2.4.0
4
4
  Summary: The official Python client for the Fintoc API.
5
5
  Home-page: https://fintoc.com/
6
6
  License: BSD-3-Clause
@@ -8,14 +8,13 @@ Author: Daniel Leal
8
8
  Author-email: daniel@fintoc.com
9
9
  Maintainer: Daniel Leal
10
10
  Maintainer-email: daniel@fintoc.com
11
- Requires-Python: >=3.6,<4.0
11
+ Requires-Python: >=3.7,<4.0
12
12
  Classifier: License :: OSI Approved :: BSD License
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.6
16
14
  Classifier: Programming Language :: Python :: 3.7
17
15
  Classifier: Programming Language :: Python :: 3.8
18
16
  Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
19
18
  Requires-Dist: httpx (>=0.16,<1.0)
20
19
  Project-URL: Issue Tracker, https://github.com/fintoc-com/fintoc-python/issues
21
20
  Project-URL: Repository, https://github.com/fintoc-com/fintoc-python
@@ -47,14 +46,6 @@ Description-Content-Type: text/markdown
47
46
  </a>
48
47
  </p>
49
48
 
50
- ## Why?
51
-
52
- You can think of [Fintoc API](https://fintoc.com/docs) as a piscola.
53
- And the key ingredient to a properly made piscola are the ice cubes.
54
- Sure, you can still have a [piscola without ice cubes](https://curl.haxx.se/).
55
- But hey… that’s not enjoyable -- why would you do that?
56
- Do yourself a favor: go grab some ice cubes by installing this refreshing library.
57
-
58
49
  ## Installation
59
50
 
60
51
  Install using pip!
@@ -346,17 +337,6 @@ for tax_return in link.tax_returns.all():
346
337
  print(tax_return.id)
347
338
  ```
348
339
 
349
- #### The `subscriptions` manager
350
-
351
- Available methods: `all`, `get`.
352
-
353
- Once you have a Link, you can use the `subscriptions` manager to get all the subscriptions associated to a link!
354
-
355
- ```python
356
- for subscription in link.subscriptions.all():
357
- print(subscription.id)
358
- ```
359
-
360
340
  #### The `refresh_intents` manager
361
341
 
362
342
  Available methods: `all`, `get`, `create`.
@@ -415,6 +395,44 @@ for movement in account.movements.all():
415
395
  print(movement.id)
416
396
  ```
417
397
 
398
+ #### The `subscription_intents` manager
399
+
400
+ Available methods: `all`, `get`, `create`
401
+
402
+ Subscription intents allow you to start a subscription using Fintoc!:
403
+
404
+ ```python
405
+ subscription_intent = fintoc_client.subscription_intents.create()
406
+
407
+ print(subscription_intent.id) # si_BO381oEATXonG6bj
408
+ print(subscription_intent.widget_token) # si_BO381oEATXonG6bj_sec_a4xK32BanKWYn
409
+ ```
410
+
411
+ #### The `subscriptions` manager
412
+
413
+ Available methods: `all`, `get`
414
+
415
+ You can check the status of the created subscription with the `subscriptions` manager
416
+
417
+ ```python
418
+ subscription = fintoc_client.subscriptions.get('<subscription_id>')
419
+ print(subscription.status)
420
+ ```
421
+
422
+ #### The `charges` manager
423
+
424
+ Available methods: `all`, `get`, `create`
425
+
426
+ Once you have active subscriptions, you can use the `charges` manager to create charges to thosse subscriptions
427
+
428
+ ```python
429
+ charge = fintoc_client.charges.create(
430
+ currency='CLP',
431
+ amount=1250,
432
+ subscription_id='<subscription_id>',
433
+ )
434
+ ```
435
+
418
436
  ### Serialization
419
437
 
420
438
  Any resource of the SDK can be serialized! To get the serialized resource, just call the `serialize` method!
@@ -24,14 +24,6 @@
24
24
  </a>
25
25
  </p>
26
26
 
27
- ## Why?
28
-
29
- You can think of [Fintoc API](https://fintoc.com/docs) as a piscola.
30
- And the key ingredient to a properly made piscola are the ice cubes.
31
- Sure, you can still have a [piscola without ice cubes](https://curl.haxx.se/).
32
- But hey… that’s not enjoyable -- why would you do that?
33
- Do yourself a favor: go grab some ice cubes by installing this refreshing library.
34
-
35
27
  ## Installation
36
28
 
37
29
  Install using pip!
@@ -323,17 +315,6 @@ for tax_return in link.tax_returns.all():
323
315
  print(tax_return.id)
324
316
  ```
325
317
 
326
- #### The `subscriptions` manager
327
-
328
- Available methods: `all`, `get`.
329
-
330
- Once you have a Link, you can use the `subscriptions` manager to get all the subscriptions associated to a link!
331
-
332
- ```python
333
- for subscription in link.subscriptions.all():
334
- print(subscription.id)
335
- ```
336
-
337
318
  #### The `refresh_intents` manager
338
319
 
339
320
  Available methods: `all`, `get`, `create`.
@@ -392,6 +373,44 @@ for movement in account.movements.all():
392
373
  print(movement.id)
393
374
  ```
394
375
 
376
+ #### The `subscription_intents` manager
377
+
378
+ Available methods: `all`, `get`, `create`
379
+
380
+ Subscription intents allow you to start a subscription using Fintoc!:
381
+
382
+ ```python
383
+ subscription_intent = fintoc_client.subscription_intents.create()
384
+
385
+ print(subscription_intent.id) # si_BO381oEATXonG6bj
386
+ print(subscription_intent.widget_token) # si_BO381oEATXonG6bj_sec_a4xK32BanKWYn
387
+ ```
388
+
389
+ #### The `subscriptions` manager
390
+
391
+ Available methods: `all`, `get`
392
+
393
+ You can check the status of the created subscription with the `subscriptions` manager
394
+
395
+ ```python
396
+ subscription = fintoc_client.subscriptions.get('<subscription_id>')
397
+ print(subscription.status)
398
+ ```
399
+
400
+ #### The `charges` manager
401
+
402
+ Available methods: `all`, `get`, `create`
403
+
404
+ Once you have active subscriptions, you can use the `charges` manager to create charges to thosse subscriptions
405
+
406
+ ```python
407
+ charge = fintoc_client.charges.create(
408
+ currency='CLP',
409
+ amount=1250,
410
+ subscription_id='<subscription_id>',
411
+ )
412
+ ```
413
+
395
414
  ### Serialization
396
415
 
397
416
  Any resource of the SDK can be serialized! To get the serialized resource, just call the `serialize` method!
@@ -10,15 +10,15 @@ from fintoc.paginator import paginate
10
10
 
11
11
 
12
12
  class Client:
13
-
14
13
  """Encapsulates the client behaviour and methods."""
15
14
 
16
- def __init__(self, base_url, api_key, user_agent, params={}):
15
+ def __init__(self, base_url, api_key, api_version, user_agent, params={}):
17
16
  self.base_url = base_url
18
17
  self.api_key = api_key
19
18
  self.user_agent = user_agent
20
19
  self.params = params
21
20
  self.__client = None
21
+ self.api_version = api_version
22
22
 
23
23
  @property
24
24
  def _client(self):
@@ -33,7 +33,15 @@ class Client:
33
33
  @property
34
34
  def headers(self):
35
35
  """Return the appropriate headers for every request."""
36
- return {"Authorization": self.api_key, "User-Agent": self.user_agent}
36
+ headers = {
37
+ "Authorization": self.api_key,
38
+ "User-Agent": self.user_agent,
39
+ }
40
+
41
+ if self.api_version is not None:
42
+ headers["Fintoc-Version"] = self.api_version
43
+
44
+ return headers
37
45
 
38
46
  def request(self, path, paginated=False, method="get", params=None, json=None):
39
47
  """
@@ -62,6 +70,7 @@ class Client:
62
70
  return Client(
63
71
  base_url=base_url or self.base_url,
64
72
  api_key=api_key or self.api_key,
73
+ api_version=self.api_version,
65
74
  user_agent=user_agent or self.user_agent,
66
75
  params={**self.params, **params} if params else self.params,
67
76
  )
@@ -4,22 +4,34 @@ Core module to house the Fintoc object of the Fintoc Python SDK.
4
4
 
5
5
  from fintoc.client import Client
6
6
  from fintoc.constants import API_BASE_URL, API_VERSION
7
- from fintoc.managers import LinksManager, PaymentIntentsManager, WebhookEndpointsManager
7
+ from fintoc.managers import (
8
+ ChargesManager,
9
+ LinksManager,
10
+ PaymentIntentsManager,
11
+ SubscriptionIntentsManager,
12
+ SubscriptionsManager,
13
+ WebhookEndpointsManager,
14
+ )
8
15
  from fintoc.version import __version__
9
16
 
10
17
 
11
18
  class Fintoc:
12
-
13
19
  """Encapsulates the core object's behaviour and methods."""
14
20
 
15
- def __init__(self, api_key):
21
+ def __init__(self, api_key, api_version=None):
16
22
  self._client = Client(
17
23
  base_url=f"{API_BASE_URL}/{API_VERSION}",
18
24
  api_key=api_key,
25
+ api_version=api_version,
19
26
  user_agent=f"fintoc-python/{__version__}",
20
27
  )
28
+ self.charges = ChargesManager("/charges", self._client)
21
29
  self.links = LinksManager("/links", self._client)
22
30
  self.payment_intents = PaymentIntentsManager("/payment_intents", self._client)
31
+ self.subscriptions = SubscriptionsManager("/subscriptions", self._client)
32
+ self.subscription_intents = SubscriptionIntentsManager(
33
+ "/subscription_intents", self._client
34
+ )
23
35
  self.webhook_endpoints = WebhookEndpointsManager(
24
36
  "/webhook_endpoints", self._client
25
37
  )
@@ -1,11 +1,13 @@
1
1
  """Init file for the managers module of the SDK."""
2
2
 
3
3
  from .accounts_manager import AccountsManager
4
+ from .charges_manager import ChargesManager
4
5
  from .invoices_manager import InvoicesManager
5
6
  from .links_manager import LinksManager
6
7
  from .movements_manager import MovementsManager
7
8
  from .payment_intents_manager import PaymentIntentsManager
8
9
  from .refresh_intents_manager import RefreshIntentsManager
10
+ from .subscription_intents_manager import SubscriptionIntentsManager
9
11
  from .subscriptions_manager import SubscriptionsManager
10
12
  from .tax_returns_manager import TaxRetunsManager
11
13
  from .webhook_endpoints_manager import WebhookEndpointsManager
@@ -0,0 +1,11 @@
1
+ """Module to hold the charges manager."""
2
+
3
+ from fintoc.mixins import ManagerMixin
4
+
5
+
6
+ class ChargesManager(ManagerMixin):
7
+
8
+ """Represents a charges manager."""
9
+
10
+ resource = "charge"
11
+ methods = ["all", "get", "create"]
@@ -0,0 +1,11 @@
1
+ """Module to hold the subscription_intents manager."""
2
+
3
+ from fintoc.mixins import ManagerMixin
4
+
5
+
6
+ class SubscriptionIntentsManager(ManagerMixin):
7
+
8
+ """Represents a subscription_intents manager."""
9
+
10
+ resource = "subscription_intent"
11
+ methods = ["all", "get", "create"]
@@ -2,6 +2,7 @@
2
2
 
3
3
  from .account import Account
4
4
  from .balance import Balance
5
+ from .charge import Charge
5
6
  from .generic_fintoc_resource import GenericFintocResource
6
7
  from .income import Income
7
8
  from .institution import Institution
@@ -15,6 +16,7 @@ from .payment_intent import PaymentIntent
15
16
  from .refresh_intent import RefreshIntent
16
17
  from .services_invoice import ServicesInvoice
17
18
  from .subscription import Subscription
19
+ from .subscription_intent import SubscriptionIntent
18
20
  from .tax_return import TaxReturn
19
21
  from .taxpayer import Taxpayer
20
22
  from .tobacco_taxes import TobaccoTaxes
@@ -0,0 +1,7 @@
1
+ """Module to hold the Charge resource."""
2
+
3
+ from fintoc.mixins import ResourceMixin
4
+
5
+
6
+ class Charge(ResourceMixin):
7
+ """Represents a Fintoc Charge."""
@@ -0,0 +1,7 @@
1
+ """Module to hold the SubscriptionIntent resource."""
2
+
3
+ from fintoc.mixins import ResourceMixin
4
+
5
+
6
+ class SubscriptionIntent(ResourceMixin):
7
+ """Represents a Fintoc Subscription Intent."""
@@ -1,4 +1,4 @@
1
1
  """Module to hold the version utilities."""
2
2
 
3
- version_info = (2, 2, 2)
3
+ version_info = (2, 4, 0)
4
4
  __version__ = ".".join([str(x) for x in version_info])
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "fintoc"
3
- version = "2.2.2"
3
+ version = "2.4.0"
4
4
  description = "The official Python client for the Fintoc API."
5
5
  authors = ["Daniel Leal <daniel@fintoc.com>", "Nebil Kawas <nebil@uc.cl>"]
6
6
  maintainers = ["Daniel Leal <daniel@fintoc.com>"]
@@ -19,11 +19,11 @@ exclude = [
19
19
  ]
20
20
 
21
21
  [tool.poetry.dependencies]
22
- python = "^3.6"
22
+ python = "^3.7"
23
23
  httpx = ">=0.16, < 1.0"
24
24
 
25
25
  [tool.poetry.dev-dependencies]
26
- black = "^20.8b1"
26
+ black = "^22.10.0"
27
27
  flake8 = "^3.8.4"
28
28
  isort = "^5.6.4"
29
29
  pylint = "^2.6.0"
fintoc-2.4.0/setup.py ADDED
@@ -0,0 +1,30 @@
1
+ # -*- coding: utf-8 -*-
2
+ from setuptools import setup
3
+
4
+ packages = \
5
+ ['fintoc', 'fintoc.managers', 'fintoc.mixins', 'fintoc.resources']
6
+
7
+ package_data = \
8
+ {'': ['*']}
9
+
10
+ install_requires = \
11
+ ['httpx>=0.16,<1.0']
12
+
13
+ setup_kwargs = {
14
+ 'name': 'fintoc',
15
+ 'version': '2.4.0',
16
+ 'description': 'The official Python client for the Fintoc API.',
17
+ 'long_description': '<h1 align="center">Fintoc meets Python 🐍</h1>\n\n<p align="center">\n <em>\n You have just found the Python-flavored client of <a href="https://fintoc.com/" target="_blank">Fintoc</a>.\n </em>\n</p>\n\n<p align="center">\n<a href="https://pypi.org/project/fintoc" target="_blank">\n <img src="https://img.shields.io/pypi/v/fintoc?label=version&logo=python&logoColor=%23fff&color=306998" alt="PyPI - Version">\n</a>\n\n<a href="https://github.com/fintoc-com/fintoc-python/actions?query=workflow%3Atests" target="_blank">\n <img src="https://img.shields.io/github/workflow/status/fintoc-com/fintoc-python/tests?label=tests&logo=python&logoColor=%23fff" alt="Tests">\n</a>\n\n<a href="https://codecov.io/gh/fintoc-com/fintoc-python" target="_blank">\n <img src="https://img.shields.io/codecov/c/gh/fintoc-com/fintoc-python?label=coverage&logo=codecov&logoColor=ffffff" alt="Coverage">\n</a>\n\n<a href="https://github.com/fintoc-com/fintoc-python/actions?query=workflow%3Alinters" target="_blank">\n <img src="https://img.shields.io/github/workflow/status/fintoc-com/fintoc-python/linters?label=linters&logo=github" alt="Linters">\n</a>\n</p>\n\n## Installation\n\nInstall using pip!\n\n```sh\npip install fintoc\n```\n\n**Note:** This SDK requires [**Python 3.6+**](https://docs.python.org/3/whatsnew/3.6.html).\n\n## Usage\n\nThe idea behind this SDK is to stick to the API design as much as possible, so that it feels ridiculously natural to use even while only reading the raw API documentation.\n\n### Quickstart\n\nTo be able to use this SDK, you first need to have a [Fintoc](https://app.fintoc.com/login) account. You will need to get your secret API key from the dashboard to be able to use the SDK. Once you have your API key, all you need to do is initialize a `Fintoc` object with it and you\'re ready to start enjoying Fintoc!\n\n```python\nfrom fintoc import Fintoc\n\nfintoc_client = Fintoc("your_api_key")\n```\n\nNow you can start using the SDK!\n\n### Managers\n\nTo make the usage of the SDK feel natural, resources are managed by **managers** (_wow_). These **managers** correspond to objects with some methods that allow you to get the resources that you want. Each manager is _attached_ to another resource, following the API structure. For example, the `Fintoc` object has `links` and `webhook_endpoints` managers, while `Link` objects have an `accounts` manager (we will see more examples soon). Notice that **not every manager has all of the methods**, as they correspond to the API capabilities. The methods of the managers are the following (we will use the `webhook_endpoints` manager as an example):\n\n#### `all`\n\nYou can use the `all` method of the managers as follows:\n\n```python\nwebhook_endpoints = fintoc_client.webhook_endpoints.all()\n```\n\nThe `all` method of the managers returns **a generator** with all the instances of the resource. This method can also receive `kwargs`! The arguments that can be passed are the arguments that the API receives for that specific resource! For example, the `Movement` resource can be filtered using `since` and `until`, so if you wanted to get a range of `movements` from an `account`, all you need to do is to pass the parameters to the method!\n\n```python\nmovements = account.movements.all(since="2019-07-24", until="2021-05-12")\n```\n\nYou can also pass the `lazy=False` parameter to the method to force the SDK to return a list of all the instances of the resource instead of the generator. **Beware**: this could take **very long**, depending on the amount of instances that exist of said resource:\n\n```python\nwebhook_endpoints = fintoc_client.webhook_endpoints.all(lazy=False)\n\nisinstance(webhook_endpoints, list) # True\n```\n\n#### `get`\n\nYou can use the `get` method of the managers as follows:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\n```\n\nThe `get` method of the managers returns an existing instance of the resource using its identifier to find it.\n\n#### `create`\n\nYou can use the `create` method of the managers as follows:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.create(\n url="https://webhook.site/58gfb429-c33c-20c7-584b-d5ew3y3202a0",\n enabled_events=["link.credentials_changed"],\n description="Fantasting webhook endpoint",\n)\n```\n\nThe `create` method of the managers creates and returns a new instance of the resource. The attributes of the created object are passed as `kwargs`, and correspond to the parameters specified by the API documentation for the creation of said resource.\n\n#### `update`\n\nYou can use the `update` method of the managers as follows:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.update(\n "we_8anqVLlBC8ROodem",\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n```\n\nThe `update` method of the managers updates and returns an existing instance of the resource using its identifier to find it. The first parameter of the method corresponds to the identifier being used to find the existing instance of the resource. The attributes to be modified are passed as `kwargs`, and correspond to the parameters specified by the API documentation for the update action of said resource.\n\nNotice that using the manager to update an instance of a resource is equivalent (in terms of outcome) to calling the `update` directly on the object itself:\n\n\n```python\n# Using the manager\nwebhook_endpoint = fintoc_client.webhook_endpoints.update(\n "we_8anqVLlBC8ROodem",\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n\n# Using the object\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\nwebhook_endpoint.update(\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n```\n\nWhen using the SDK, you will probably almost always want to use the object directly to update, just because it is way less verbose if you already have the object itself. Also, using the `update` method from the manager first needs to `get` the resource and then updates it, so it translates to 2 API calls. If you already have the object to update, using the `update` method directly from the object just updates it, so it translates to just 1 API call.\n\n#### `delete`\n\nYou can use the `delete` method of the managers as follows:\n\n```python\ndeleted_identifier = fintoc_client.webhook_endpoints.delete("we_8anqVLlBC8ROodem")\n```\n\nThe `delete` method of the managers deletes an existing instance of the resource using its identifier to find it and returns the identifier.\n\nNotice that using the manager to delete an instance of a resource is equivalent (in terms of outcome) to calling the `delete` directly on the object itself:\n\n\n```python\n# Using the manager\ndeleted_identifier = fintoc_client.webhook_endpoints.delete("we_8anqVLlBC8ROodem")\n\n# Using the object\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\ndeleted_identifier = webhook_endpoint.delete()\n```\n\nWhen using the SDK, you will probably almost always want to use the object directly to delete, just because it is way less verbose if you already have the object itself. Also, using the `delete` method from the manager first needs to `get` the resource and then deletes it, so it translates to 2 API calls. If you already have the object to delete, using the `delete` method directly from the object just deletes it, so it translates to just 1 API call.\n\n### The shape of the SDK\n\nFor complete information about the API, head to [the docs](https://fintoc.com/docs). You will notice that the shape of the SDK is very similar to the shape of the API. Let\'s start with the `Fintoc` object.\n\n#### The `Fintoc` object\n\nTo create a `Fintoc` object, instantiate it using your secret API key:\n\n```python\nfrom fintoc import Fintoc\n\nfintoc_client = Fintoc("your_api_key")\n```\n\nThis gives us access to a bunch of operations already. The object created using this _snippet_ contains three [managers](#managers): `links`, `payment_intents` and `webhook_endpoints`.\n\n#### The `webhook_endpoints` manager\n\nAvailable methods: `all`, `get`, `create`, `update`, `delete`.\n\nFrom the Fintoc client, you can manage your webhook endpoints swiftly! Start by creating a new Webhook Endpoint!\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.create(\n url="https://webhook.site/58gfb429-c33c-20c7-584b-d5ew3y3202a0",\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n\nprint(webhook_endpoint.id) # we_8anqVLlBC8ROodem\n```\n\nYou can update this webhook endpoint any time you want! Just run the following command:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.update(\n "we_8anqVLlBC8ROodem",\n enabled_events=["link.credentials_changed"],\n description="Fantasting webhook endpoint",\n)\n\nprint(webhook_endpoint.status) # disabled\n```\n\nMaybe you no longer want this webhook endpoint. Let\'s delete it!\n\n```python\nfintoc_client.webhook_endpoints.delete("we_8anqVLlBC8ROodem")\n```\n\nNow, let\'s list every webhook endpoint we have:\n\n```python\nfor webhook_endpoint in fintoc_client.webhook_endpoints.all():\n print(webhook_endpoint.id)\n```\n\nIf you see a webhook endpoint you want to use, just use the `get` method!\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\n\nprint(webhook_endpoint.id) # we_8anqVLlBC8ROodem\n```\n\n#### The `payment_intents` manager\n\nAvailable methods: `all`, `get`, `create`.\n\nPayment intents allow you to start a payment using Fintoc! Start by creating a new payment intent:\n\n```python\npayment_intent = fintoc_client.payment_intents.create(\n currency="CLP",\n amount=5990,\n recipient_account={\n "holder_id": "111111111",\n "number": "123123123",\n "type": "checking_account",\n "institution_id": "cl_banco_de_chile",\n }\n)\n\nprint(payment_intent.id) # pi_BO381oEATXonG6bj\nprint(payment_intent.widget_token) # pi_BO381oEATXonG6bj_sec_a4xK32BanKWYn\n```\n\nNotice that the success of this payment intent will be notified through a Webhook. Now, let\'s list every payment intent we have:\n\n```python\nfor payment_intent in fintoc_client.payment_intents.all():\n print(payment_intent.id)\n```\n\nIf you see a payment intent you want to use, just use the `get` method!\n\n```python\npayment_intent = fintoc_client.payment_intents.get("pi_BO381oEATXonG6bj")\n\nprint(payment_intent.id) # pi_BO381oEATXonG6bj\nprint(payment_intent.status) # succeeded\n```\n\n#### The `links` manager\n\nAvailable methods: `all`, `get`, `update`, `delete`.\n\nLinks are probably the most importat resource. Let\'s list them!\n\n```python\nprint(len(fintoc_client.links.all(lazy=False))) # 3\n\nfor link in fintoc_client.links.all():\n print(link.id)\n```\n\nLinks are a bit different than the rest of the resources, because their identifier is not really their `id`, but their `link_token`. This means that, in order to `get`, `update` or `delete` a link, you need to pass the `link_token`!\n\n```python\nlink = fintoc_client.links.get("link_Y75EXAKiIVj7w489_token_NCqjwRVoTX3cmnx8pnbpqd11")\n```\n\nNotice that the Link objects generated from the `all` method will won\'t be able to execute `update` or `delete` operations, while any Link object generated from `get` or `update` will have permission to `update` or `delete` (given that the link token is necessary to `get` or `update` in the first place).\n\nThe Link resource has a lot of **managers**!\n\n```python\ninvoices = link.invoices.all() # Invoices\ntax_returns = link.tax_returns.all() # Tax Returns\nsubscriptions = link.subscriptions.all() # Subscriptions\nrefresh_intents = link.refresh_intents.all() # Refresh Intents\naccounts = link.accounts.all() # Accounts\n```\n\n#### The `invoices` manager\n\nAvailable methods: `all`.\n\nOnce you have a Link, you can use the `invoices` manager to get all the invoices associated to a link!\n\n```python\nfor invoice in link.invoices.all():\n print(invoice.id)\n```\n\n#### The `tax_returns` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have a Link, you can use the `tax_returns` manager to get all the tax returns associated to a link!\n\n```python\nfor tax_return in link.tax_returns.all():\n print(tax_return.id)\n```\n\n#### The `refresh_intents` manager\n\nAvailable methods: `all`, `get`, `create`.\n\nRefresh intents allow you to control how an account gets refreshed on Fintoc! Once you have a Link, you can use the `refresh_intents` manager to create a new refresh intent:\n\n```python\nrefresh_intent = link.refresh_intents.create()\n\nprint(refresh_intent.id) # ri_5A94DVCJ7xNM3MEo\n```\n\nNotice that the success of this refresh intent will be notified through a Webhook. Now, let\'s list every refresh intent we have:\n\n```python\nfor refresh_intent in link.refresh_intents.all():\n print(refresh_intent.id)\n```\n\nIf you see a refresh intent you want to use, just use the `get` method!\n\n```python\nrefresh_intent = link.refresh_intents.get("ri_5A94DVCJ7xNM3MEo")\n\nprint(refresh_intent.id) # ri_5A94DVCJ7xNM3MEo\nprint(refresh_intent.status) # succeeded\n```\n\n#### The `accounts` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have a Link, you can use the `accounts` manager to get all the accounts associated to a link!\n\n```python\nfor account in link.accounts.all():\n print(account.id)\n```\n\nNotice that accounts also have a `movements` manager, to get all of the movements of an account:\n\n```python\naccount = link.accounts.all(lazy=False)[0]\n\nmovements = account.movements.all(lazy=False)\n```\n\n#### The `movements` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have an Account, you can use the `movements` manager to get all the movements associated to that account!\n\n```python\nfor movement in account.movements.all():\n print(movement.id)\n```\n\n#### The `subscription_intents` manager\n\nAvailable methods: `all`, `get`, `create`\n\nSubscription intents allow you to start a subscription using Fintoc!:\n\n```python\nsubscription_intent = fintoc_client.subscription_intents.create()\n\nprint(subscription_intent.id) # si_BO381oEATXonG6bj\nprint(subscription_intent.widget_token) # si_BO381oEATXonG6bj_sec_a4xK32BanKWYn\n```\n\n#### The `subscriptions` manager\n\nAvailable methods: `all`, `get`\n\nYou can check the status of the created subscription with the `subscriptions` manager\n\n```python\nsubscription = fintoc_client.subscriptions.get(\'<subscription_id>\')\nprint(subscription.status)\n```\n\n#### The `charges` manager\n\nAvailable methods: `all`, `get`, `create`\n\nOnce you have active subscriptions, you can use the `charges` manager to create charges to thosse subscriptions\n\n```python\ncharge = fintoc_client.charges.create(\n currency=\'CLP\',\n amount=1250,\n subscription_id=\'<subscription_id>\',\n)\n```\n\n### Serialization\n\nAny resource of the SDK can be serialized! To get the serialized resource, just call the `serialize` method!\n\n```python\naccount = link.accounts.all(lazy=False)[0]\n\nserialization = account.serialize()\n```\n\nThe serialization corresponds to a dictionary with only simple types, that can be JSON-serialized.\n\n## Acknowledgements\n\nThe first version of this SDK was originally designed and handcrafted by [**@nebil**](https://github.com/nebil),\n[ad](https://en.wikipedia.org/wiki/Ad_honorem) [piscolem](https://en.wiktionary.org/wiki/piscola).\nHe built it with the help of Gianni Roberto’s [Picchi 2](https://www.youtube.com/watch?v=WqjUlmkYr2g).\n',
18
+ 'author': 'Daniel Leal',
19
+ 'author_email': 'daniel@fintoc.com',
20
+ 'maintainer': 'Daniel Leal',
21
+ 'maintainer_email': 'daniel@fintoc.com',
22
+ 'url': 'https://fintoc.com/',
23
+ 'packages': packages,
24
+ 'package_data': package_data,
25
+ 'install_requires': install_requires,
26
+ 'python_requires': '>=3.7,<4.0',
27
+ }
28
+
29
+
30
+ setup(**setup_kwargs)
fintoc-2.2.2/setup.py DELETED
@@ -1,30 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- packages = \
5
- ['fintoc', 'fintoc.managers', 'fintoc.mixins', 'fintoc.resources']
6
-
7
- package_data = \
8
- {'': ['*']}
9
-
10
- install_requires = \
11
- ['httpx>=0.16,<1.0']
12
-
13
- setup_kwargs = {
14
- 'name': 'fintoc',
15
- 'version': '2.2.2',
16
- 'description': 'The official Python client for the Fintoc API.',
17
- 'long_description': '<h1 align="center">Fintoc meets Python 🐍</h1>\n\n<p align="center">\n <em>\n You have just found the Python-flavored client of <a href="https://fintoc.com/" target="_blank">Fintoc</a>.\n </em>\n</p>\n\n<p align="center">\n<a href="https://pypi.org/project/fintoc" target="_blank">\n <img src="https://img.shields.io/pypi/v/fintoc?label=version&logo=python&logoColor=%23fff&color=306998" alt="PyPI - Version">\n</a>\n\n<a href="https://github.com/fintoc-com/fintoc-python/actions?query=workflow%3Atests" target="_blank">\n <img src="https://img.shields.io/github/workflow/status/fintoc-com/fintoc-python/tests?label=tests&logo=python&logoColor=%23fff" alt="Tests">\n</a>\n\n<a href="https://codecov.io/gh/fintoc-com/fintoc-python" target="_blank">\n <img src="https://img.shields.io/codecov/c/gh/fintoc-com/fintoc-python?label=coverage&logo=codecov&logoColor=ffffff" alt="Coverage">\n</a>\n\n<a href="https://github.com/fintoc-com/fintoc-python/actions?query=workflow%3Alinters" target="_blank">\n <img src="https://img.shields.io/github/workflow/status/fintoc-com/fintoc-python/linters?label=linters&logo=github" alt="Linters">\n</a>\n</p>\n\n## Why?\n\nYou can think of [Fintoc API](https://fintoc.com/docs) as a piscola.\nAnd the key ingredient to a properly made piscola are the ice cubes.\nSure, you can still have a [piscola without ice cubes](https://curl.haxx.se/).\nBut hey… that’s not enjoyable -- why would you do that?\nDo yourself a favor: go grab some ice cubes by installing this refreshing library.\n\n## Installation\n\nInstall using pip!\n\n```sh\npip install fintoc\n```\n\n**Note:** This SDK requires [**Python 3.6+**](https://docs.python.org/3/whatsnew/3.6.html).\n\n## Usage\n\nThe idea behind this SDK is to stick to the API design as much as possible, so that it feels ridiculously natural to use even while only reading the raw API documentation.\n\n### Quickstart\n\nTo be able to use this SDK, you first need to have a [Fintoc](https://app.fintoc.com/login) account. You will need to get your secret API key from the dashboard to be able to use the SDK. Once you have your API key, all you need to do is initialize a `Fintoc` object with it and you\'re ready to start enjoying Fintoc!\n\n```python\nfrom fintoc import Fintoc\n\nfintoc_client = Fintoc("your_api_key")\n```\n\nNow you can start using the SDK!\n\n### Managers\n\nTo make the usage of the SDK feel natural, resources are managed by **managers** (_wow_). These **managers** correspond to objects with some methods that allow you to get the resources that you want. Each manager is _attached_ to another resource, following the API structure. For example, the `Fintoc` object has `links` and `webhook_endpoints` managers, while `Link` objects have an `accounts` manager (we will see more examples soon). Notice that **not every manager has all of the methods**, as they correspond to the API capabilities. The methods of the managers are the following (we will use the `webhook_endpoints` manager as an example):\n\n#### `all`\n\nYou can use the `all` method of the managers as follows:\n\n```python\nwebhook_endpoints = fintoc_client.webhook_endpoints.all()\n```\n\nThe `all` method of the managers returns **a generator** with all the instances of the resource. This method can also receive `kwargs`! The arguments that can be passed are the arguments that the API receives for that specific resource! For example, the `Movement` resource can be filtered using `since` and `until`, so if you wanted to get a range of `movements` from an `account`, all you need to do is to pass the parameters to the method!\n\n```python\nmovements = account.movements.all(since="2019-07-24", until="2021-05-12")\n```\n\nYou can also pass the `lazy=False` parameter to the method to force the SDK to return a list of all the instances of the resource instead of the generator. **Beware**: this could take **very long**, depending on the amount of instances that exist of said resource:\n\n```python\nwebhook_endpoints = fintoc_client.webhook_endpoints.all(lazy=False)\n\nisinstance(webhook_endpoints, list) # True\n```\n\n#### `get`\n\nYou can use the `get` method of the managers as follows:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\n```\n\nThe `get` method of the managers returns an existing instance of the resource using its identifier to find it.\n\n#### `create`\n\nYou can use the `create` method of the managers as follows:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.create(\n url="https://webhook.site/58gfb429-c33c-20c7-584b-d5ew3y3202a0",\n enabled_events=["link.credentials_changed"],\n description="Fantasting webhook endpoint",\n)\n```\n\nThe `create` method of the managers creates and returns a new instance of the resource. The attributes of the created object are passed as `kwargs`, and correspond to the parameters specified by the API documentation for the creation of said resource.\n\n#### `update`\n\nYou can use the `update` method of the managers as follows:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.update(\n "we_8anqVLlBC8ROodem",\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n```\n\nThe `update` method of the managers updates and returns an existing instance of the resource using its identifier to find it. The first parameter of the method corresponds to the identifier being used to find the existing instance of the resource. The attributes to be modified are passed as `kwargs`, and correspond to the parameters specified by the API documentation for the update action of said resource.\n\nNotice that using the manager to update an instance of a resource is equivalent (in terms of outcome) to calling the `update` directly on the object itself:\n\n\n```python\n# Using the manager\nwebhook_endpoint = fintoc_client.webhook_endpoints.update(\n "we_8anqVLlBC8ROodem",\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n\n# Using the object\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\nwebhook_endpoint.update(\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n```\n\nWhen using the SDK, you will probably almost always want to use the object directly to update, just because it is way less verbose if you already have the object itself. Also, using the `update` method from the manager first needs to `get` the resource and then updates it, so it translates to 2 API calls. If you already have the object to update, using the `update` method directly from the object just updates it, so it translates to just 1 API call.\n\n#### `delete`\n\nYou can use the `delete` method of the managers as follows:\n\n```python\ndeleted_identifier = fintoc_client.webhook_endpoints.delete("we_8anqVLlBC8ROodem")\n```\n\nThe `delete` method of the managers deletes an existing instance of the resource using its identifier to find it and returns the identifier.\n\nNotice that using the manager to delete an instance of a resource is equivalent (in terms of outcome) to calling the `delete` directly on the object itself:\n\n\n```python\n# Using the manager\ndeleted_identifier = fintoc_client.webhook_endpoints.delete("we_8anqVLlBC8ROodem")\n\n# Using the object\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\ndeleted_identifier = webhook_endpoint.delete()\n```\n\nWhen using the SDK, you will probably almost always want to use the object directly to delete, just because it is way less verbose if you already have the object itself. Also, using the `delete` method from the manager first needs to `get` the resource and then deletes it, so it translates to 2 API calls. If you already have the object to delete, using the `delete` method directly from the object just deletes it, so it translates to just 1 API call.\n\n### The shape of the SDK\n\nFor complete information about the API, head to [the docs](https://fintoc.com/docs). You will notice that the shape of the SDK is very similar to the shape of the API. Let\'s start with the `Fintoc` object.\n\n#### The `Fintoc` object\n\nTo create a `Fintoc` object, instantiate it using your secret API key:\n\n```python\nfrom fintoc import Fintoc\n\nfintoc_client = Fintoc("your_api_key")\n```\n\nThis gives us access to a bunch of operations already. The object created using this _snippet_ contains three [managers](#managers): `links`, `payment_intents` and `webhook_endpoints`.\n\n#### The `webhook_endpoints` manager\n\nAvailable methods: `all`, `get`, `create`, `update`, `delete`.\n\nFrom the Fintoc client, you can manage your webhook endpoints swiftly! Start by creating a new Webhook Endpoint!\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.create(\n url="https://webhook.site/58gfb429-c33c-20c7-584b-d5ew3y3202a0",\n enabled_events=["account.refresh_intent.succeeded"],\n disabled=True,\n)\n\nprint(webhook_endpoint.id) # we_8anqVLlBC8ROodem\n```\n\nYou can update this webhook endpoint any time you want! Just run the following command:\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.update(\n "we_8anqVLlBC8ROodem",\n enabled_events=["link.credentials_changed"],\n description="Fantasting webhook endpoint",\n)\n\nprint(webhook_endpoint.status) # disabled\n```\n\nMaybe you no longer want this webhook endpoint. Let\'s delete it!\n\n```python\nfintoc_client.webhook_endpoints.delete("we_8anqVLlBC8ROodem")\n```\n\nNow, let\'s list every webhook endpoint we have:\n\n```python\nfor webhook_endpoint in fintoc_client.webhook_endpoints.all():\n print(webhook_endpoint.id)\n```\n\nIf you see a webhook endpoint you want to use, just use the `get` method!\n\n```python\nwebhook_endpoint = fintoc_client.webhook_endpoints.get("we_8anqVLlBC8ROodem")\n\nprint(webhook_endpoint.id) # we_8anqVLlBC8ROodem\n```\n\n#### The `payment_intents` manager\n\nAvailable methods: `all`, `get`, `create`.\n\nPayment intents allow you to start a payment using Fintoc! Start by creating a new payment intent:\n\n```python\npayment_intent = fintoc_client.payment_intents.create(\n currency="CLP",\n amount=5990,\n recipient_account={\n "holder_id": "111111111",\n "number": "123123123",\n "type": "checking_account",\n "institution_id": "cl_banco_de_chile",\n }\n)\n\nprint(payment_intent.id) # pi_BO381oEATXonG6bj\nprint(payment_intent.widget_token) # pi_BO381oEATXonG6bj_sec_a4xK32BanKWYn\n```\n\nNotice that the success of this payment intent will be notified through a Webhook. Now, let\'s list every payment intent we have:\n\n```python\nfor payment_intent in fintoc_client.payment_intents.all():\n print(payment_intent.id)\n```\n\nIf you see a payment intent you want to use, just use the `get` method!\n\n```python\npayment_intent = fintoc_client.payment_intents.get("pi_BO381oEATXonG6bj")\n\nprint(payment_intent.id) # pi_BO381oEATXonG6bj\nprint(payment_intent.status) # succeeded\n```\n\n#### The `links` manager\n\nAvailable methods: `all`, `get`, `update`, `delete`.\n\nLinks are probably the most importat resource. Let\'s list them!\n\n```python\nprint(len(fintoc_client.links.all(lazy=False))) # 3\n\nfor link in fintoc_client.links.all():\n print(link.id)\n```\n\nLinks are a bit different than the rest of the resources, because their identifier is not really their `id`, but their `link_token`. This means that, in order to `get`, `update` or `delete` a link, you need to pass the `link_token`!\n\n```python\nlink = fintoc_client.links.get("link_Y75EXAKiIVj7w489_token_NCqjwRVoTX3cmnx8pnbpqd11")\n```\n\nNotice that the Link objects generated from the `all` method will won\'t be able to execute `update` or `delete` operations, while any Link object generated from `get` or `update` will have permission to `update` or `delete` (given that the link token is necessary to `get` or `update` in the first place).\n\nThe Link resource has a lot of **managers**!\n\n```python\ninvoices = link.invoices.all() # Invoices\ntax_returns = link.tax_returns.all() # Tax Returns\nsubscriptions = link.subscriptions.all() # Subscriptions\nrefresh_intents = link.refresh_intents.all() # Refresh Intents\naccounts = link.accounts.all() # Accounts\n```\n\n#### The `invoices` manager\n\nAvailable methods: `all`.\n\nOnce you have a Link, you can use the `invoices` manager to get all the invoices associated to a link!\n\n```python\nfor invoice in link.invoices.all():\n print(invoice.id)\n```\n\n#### The `tax_returns` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have a Link, you can use the `tax_returns` manager to get all the tax returns associated to a link!\n\n```python\nfor tax_return in link.tax_returns.all():\n print(tax_return.id)\n```\n\n#### The `subscriptions` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have a Link, you can use the `subscriptions` manager to get all the subscriptions associated to a link!\n\n```python\nfor subscription in link.subscriptions.all():\n print(subscription.id)\n```\n\n#### The `refresh_intents` manager\n\nAvailable methods: `all`, `get`, `create`.\n\nRefresh intents allow you to control how an account gets refreshed on Fintoc! Once you have a Link, you can use the `refresh_intents` manager to create a new refresh intent:\n\n```python\nrefresh_intent = link.refresh_intents.create()\n\nprint(refresh_intent.id) # ri_5A94DVCJ7xNM3MEo\n```\n\nNotice that the success of this refresh intent will be notified through a Webhook. Now, let\'s list every refresh intent we have:\n\n```python\nfor refresh_intent in link.refresh_intents.all():\n print(refresh_intent.id)\n```\n\nIf you see a refresh intent you want to use, just use the `get` method!\n\n```python\nrefresh_intent = link.refresh_intents.get("ri_5A94DVCJ7xNM3MEo")\n\nprint(refresh_intent.id) # ri_5A94DVCJ7xNM3MEo\nprint(refresh_intent.status) # succeeded\n```\n\n#### The `accounts` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have a Link, you can use the `accounts` manager to get all the accounts associated to a link!\n\n```python\nfor account in link.accounts.all():\n print(account.id)\n```\n\nNotice that accounts also have a `movements` manager, to get all of the movements of an account:\n\n```python\naccount = link.accounts.all(lazy=False)[0]\n\nmovements = account.movements.all(lazy=False)\n```\n\n#### The `movements` manager\n\nAvailable methods: `all`, `get`.\n\nOnce you have an Account, you can use the `movements` manager to get all the movements associated to that account!\n\n```python\nfor movement in account.movements.all():\n print(movement.id)\n```\n\n### Serialization\n\nAny resource of the SDK can be serialized! To get the serialized resource, just call the `serialize` method!\n\n```python\naccount = link.accounts.all(lazy=False)[0]\n\nserialization = account.serialize()\n```\n\nThe serialization corresponds to a dictionary with only simple types, that can be JSON-serialized.\n\n## Acknowledgements\n\nThe first version of this SDK was originally designed and handcrafted by [**@nebil**](https://github.com/nebil),\n[ad](https://en.wikipedia.org/wiki/Ad_honorem) [piscolem](https://en.wiktionary.org/wiki/piscola).\nHe built it with the help of Gianni Roberto’s [Picchi 2](https://www.youtube.com/watch?v=WqjUlmkYr2g).\n',
18
- 'author': 'Daniel Leal',
19
- 'author_email': 'daniel@fintoc.com',
20
- 'maintainer': 'Daniel Leal',
21
- 'maintainer_email': 'daniel@fintoc.com',
22
- 'url': 'https://fintoc.com/',
23
- 'packages': packages,
24
- 'package_data': package_data,
25
- 'install_requires': install_requires,
26
- 'python_requires': '>=3.6,<4.0',
27
- }
28
-
29
-
30
- setup(**setup_kwargs)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes