asaas-python-sdk 1.0.1__tar.gz → 1.1.1__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.
- {asaas_python_sdk-1.0.1/src/asaas_python_sdk.egg-info → asaas_python_sdk-1.1.1}/PKG-INFO +1 -1
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/pyproject.toml +1 -1
- asaas_python_sdk-1.1.1/src/asaas/apis/webhooks.py +19 -0
- asaas_python_sdk-1.1.1/src/asaas/dtos/webhook.py +19 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1/src/asaas_python_sdk.egg-info}/PKG-INFO +1 -1
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas_python_sdk.egg-info/SOURCES.txt +2 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/LICENSE +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/README.md +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/setup.cfg +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/__init__.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/__init__.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/api.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/apis/__init__.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/apis/accounts.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/apis/credit_cards.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/apis/customers.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/apis/payments.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/apis/subscriptions.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/dtos/__init__.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/dtos/account.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/dtos/credit_card.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/dtos/customer.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/dtos/payment.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas/dtos/subscription.py +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas_python_sdk.egg-info/dependency_links.txt +0 -0
- {asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas_python_sdk.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import logging, jsonpickle
|
|
2
|
+
from http import HTTPMethod
|
|
3
|
+
from fmconsult.utils.url import UrlUtil
|
|
4
|
+
from asaas.api import AsaasApi
|
|
5
|
+
from asaas.dtos.account import Webhook
|
|
6
|
+
|
|
7
|
+
class Webhooks(AsaasApi):
|
|
8
|
+
|
|
9
|
+
def __init__(self):
|
|
10
|
+
super().__init__()
|
|
11
|
+
self.endpoint_url = UrlUtil().make_url(self.base_url, ['v3', 'webhooks'])
|
|
12
|
+
|
|
13
|
+
def create(self, data:Webhook):
|
|
14
|
+
try:
|
|
15
|
+
logging.info(f'generating webhook...')
|
|
16
|
+
res = self.call_request(HTTPMethod.POST, self.endpoint_url, None, payload=data.__dict__)
|
|
17
|
+
return jsonpickle.decode(res)
|
|
18
|
+
except:
|
|
19
|
+
raise
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from fmconsult.utils.enum import CustomEnum
|
|
3
|
+
from fmconsult.utils.object import CustomObject
|
|
4
|
+
|
|
5
|
+
class SendType(CustomEnum):
|
|
6
|
+
SEQUENTIALLY = 'SEQUENTIALLY'
|
|
7
|
+
NON_SEQUENTIALLY = 'NON_SEQUENTIALLY'
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Webhook(CustomObject):
|
|
11
|
+
name: str
|
|
12
|
+
url: str
|
|
13
|
+
email: str
|
|
14
|
+
events: list[str]
|
|
15
|
+
enabled: bool = True
|
|
16
|
+
authToken: str = None
|
|
17
|
+
apiVersion: str = "3"
|
|
18
|
+
interrupted: bool = False
|
|
19
|
+
sendType: SendType = SendType.SEQUENTIALLY
|
|
@@ -10,12 +10,14 @@ src/asaas/apis/credit_cards.py
|
|
|
10
10
|
src/asaas/apis/customers.py
|
|
11
11
|
src/asaas/apis/payments.py
|
|
12
12
|
src/asaas/apis/subscriptions.py
|
|
13
|
+
src/asaas/apis/webhooks.py
|
|
13
14
|
src/asaas/dtos/__init__.py
|
|
14
15
|
src/asaas/dtos/account.py
|
|
15
16
|
src/asaas/dtos/credit_card.py
|
|
16
17
|
src/asaas/dtos/customer.py
|
|
17
18
|
src/asaas/dtos/payment.py
|
|
18
19
|
src/asaas/dtos/subscription.py
|
|
20
|
+
src/asaas/dtos/webhook.py
|
|
19
21
|
src/asaas_python_sdk.egg-info/PKG-INFO
|
|
20
22
|
src/asaas_python_sdk.egg-info/SOURCES.txt
|
|
21
23
|
src/asaas_python_sdk.egg-info/dependency_links.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas_python_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{asaas_python_sdk-1.0.1 → asaas_python_sdk-1.1.1}/src/asaas_python_sdk.egg-info/top_level.txt
RENAMED
|
File without changes
|