fintoc
Advanced tools
| """Module to hold the payment_links manager.""" | ||
| from fintoc.mixins import ManagerMixin | ||
| class PaymentLinksManager(ManagerMixin): | ||
| """Represents a payment_links manager.""" | ||
| resource = "payment_link" | ||
| methods = ["list", "get", "create", "cancel"] | ||
| def _cancel(self, identifier, **kwargs): | ||
| """Cancel a payment link.""" | ||
| path = f"{self._build_path(**kwargs)}/{identifier}/cancel" | ||
| return self._update(identifier, path_=path, **kwargs) |
| """Module to hold the PaymentLink resource.""" | ||
| from fintoc.mixins import ResourceMixin | ||
| class PaymentLink(ResourceMixin): | ||
| """Represents a Fintoc PaymentLink.""" |
+2
-0
@@ -14,2 +14,3 @@ """ | ||
| PaymentIntentsManager, | ||
| PaymentLinksManager, | ||
| RefreshIntentsManager, | ||
@@ -54,2 +55,3 @@ RefundsManager, | ||
| ) | ||
| self.payment_links = PaymentLinksManager("/v1/payment_links", self._client) | ||
| self.refunds = RefundsManager("/v1/refunds", self._client) | ||
@@ -56,0 +58,0 @@ self.subscriptions = SubscriptionsManager("/v1/subscriptions", self._client) |
@@ -10,2 +10,3 @@ """Init file for the managers module of the SDK.""" | ||
| from .payment_intents_manager import PaymentIntentsManager | ||
| from .payment_links_manager import PaymentLinksManager | ||
| from .refresh_intents_manager import RefreshIntentsManager | ||
@@ -12,0 +13,0 @@ from .refunds_manager import RefundsManager |
@@ -11,3 +11,3 @@ """Module to hold the payment_intents manager.""" | ||
| resource = "payment_intent" | ||
| methods = ["list", "get", "create", "expire"] | ||
| methods = ["list", "get", "create", "expire", "check_eligibility"] | ||
@@ -18,1 +18,6 @@ def _expire(self, identifier, **kwargs): | ||
| return self._create(path_=path, **kwargs) | ||
| def _check_eligibility(self, **kwargs): | ||
| """Check eligibility for a payment intent.""" | ||
| path = f"{self._build_path(**kwargs)}/check_eligibility" | ||
| return self._create(path_=path, **kwargs) |
@@ -121,3 +121,3 @@ """Module to hold the mixin for the managers.""" | ||
| @can_raise_fintoc_error | ||
| def _update(self, identifier, **kwargs): | ||
| def _update(self, identifier, path_=None, **kwargs): | ||
| """ | ||
@@ -129,2 +129,3 @@ Update an instance of the resource being handled by the manager, | ||
| klass = get_resource_class(self.__class__.resource) | ||
| custom_path = path_ if path_ else None | ||
| object_ = resource_update( | ||
@@ -138,2 +139,3 @@ client=self._client, | ||
| params=kwargs, | ||
| custom_path=custom_path, | ||
| ) | ||
@@ -140,0 +142,0 @@ return self.post_update_handler(object_, identifier, **kwargs) |
@@ -64,4 +64,6 @@ """Module to hold the mixin for the resources.""" | ||
| @can_raise_fintoc_error | ||
| def _update(self, **kwargs): | ||
| def _update(self, path_=None, **kwargs): | ||
| """Update the resource.""" | ||
| id_ = getattr(self, self.__class__.resource_identifier) | ||
| custom_path = path_ if path_ else None | ||
| object_ = resource_update( | ||
@@ -75,2 +77,3 @@ client=self._client, | ||
| params=kwargs, | ||
| custom_path=custom_path, | ||
| ) | ||
@@ -77,0 +80,0 @@ object_ = self._handlers.get("update")(object_, id_, **kwargs) |
@@ -62,5 +62,8 @@ """Module for the methods that handle te resources.""" | ||
| def resource_update(client, path, id_, klass, handlers, methods, params): | ||
| def resource_update( | ||
| client, path, id_, klass, handlers, methods, params, custom_path=None | ||
| ): | ||
| """Update a specific instance of a resource.""" | ||
| data = client.request(f"{path}/{id_}", method="patch", json=params) | ||
| update_path = custom_path if custom_path else f"{path}/{id_}" | ||
| data = client.request(update_path, method="patch", json=params) | ||
| return objetize( | ||
@@ -67,0 +70,0 @@ klass, |
@@ -17,2 +17,3 @@ """Init file for the resources module of the SDK.""" | ||
| from .payment_intent import PaymentIntent | ||
| from .payment_link import PaymentLink | ||
| from .refresh_intent import RefreshIntent | ||
@@ -19,0 +20,0 @@ from .services_invoice import ServicesInvoice |
| """Module to hold the version utilities.""" | ||
| version_info = (2, 13, 0) | ||
| version_info = (2, 14, 0) | ||
| __version__ = ".".join([str(x) for x in version_info]) |
+1
-1
| Metadata-Version: 2.3 | ||
| Name: fintoc | ||
| Version: 2.13.0 | ||
| Version: 2.14.0 | ||
| Summary: The official Python client for the Fintoc API. | ||
@@ -5,0 +5,0 @@ License: BSD-3-Clause |
+1
-1
| [tool.poetry] | ||
| name = "fintoc" | ||
| version = "2.13.0" | ||
| version = "2.14.0" | ||
| description = "The official Python client for the Fintoc API." | ||
@@ -5,0 +5,0 @@ authors = ["Daniel Leal <daniel@fintoc.com>", "Nebil Kawas <nebil@uc.cl>"] |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
76299
1.85%74
2.78%1383
2.22%