paymentsgate 1.5.5__tar.gz → 1.5.7__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.
Potentially problematic release.
This version of paymentsgate might be problematic. Click here for more details.
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/PKG-INFO +1 -1
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/client.py +18 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/enums.py +3 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/models.py +10 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/pyproject.toml +1 -1
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/setup.py +1 -1
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/LICENSE +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/README.md +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/__init__.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/cache.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/exceptions.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/logger.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/mappers.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/signature.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/tokens.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/transport.py +0 -0
- {paymentsgate-1.5.5 → paymentsgate-1.5.7}/paymentsgate/types.py +0 -0
|
@@ -12,6 +12,7 @@ from .models import (
|
|
|
12
12
|
Credentials,
|
|
13
13
|
GetQuoteModel,
|
|
14
14
|
GetQuoteResponseModel,
|
|
15
|
+
InvoiceListModelWithMeta,
|
|
15
16
|
PayInModel,
|
|
16
17
|
PayInResponseModel,
|
|
17
18
|
PayOutModel,
|
|
@@ -143,6 +144,23 @@ class ApiAsyncClient(BaseClient):
|
|
|
143
144
|
if not response.success:
|
|
144
145
|
raise APIResponseError(response)
|
|
145
146
|
return response.cast(InvoiceModel, APIResponseError)
|
|
147
|
+
|
|
148
|
+
async def List(self, page: int | int = 0) -> InvoiceListModelWithMeta:
|
|
149
|
+
# Prepare request
|
|
150
|
+
request = Request(
|
|
151
|
+
method="get",
|
|
152
|
+
path=ApiPaths.invoices_list.replace('$1', page | 10),
|
|
153
|
+
content_type='application/json',
|
|
154
|
+
noAuth=False,
|
|
155
|
+
signature=False,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Handle response
|
|
159
|
+
response = await self._send_request(request)
|
|
160
|
+
if not response.success:
|
|
161
|
+
raise APIResponseError(response)
|
|
162
|
+
return response.cast(InvoiceListModelWithMeta, APIResponseError)
|
|
163
|
+
|
|
146
164
|
|
|
147
165
|
async def get_token(self) -> AccessToken | None:
|
|
148
166
|
# First check if valid token is cached
|
|
@@ -16,6 +16,7 @@ class ApiPaths(StrEnum):
|
|
|
16
16
|
invoices_payout_tlv = "/deals/tlv"
|
|
17
17
|
invoices_info = "/deals/:id"
|
|
18
18
|
invoices_credentials = "/deals/:id/credentials"
|
|
19
|
+
invoices_list = "/deals/list?page=$1"
|
|
19
20
|
assets_list = "/wallet"
|
|
20
21
|
assets_deposit = "/wallet/deposit"
|
|
21
22
|
banks_list = "/banks/find"
|
|
@@ -27,6 +28,7 @@ class ApiPaths(StrEnum):
|
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class Currencies(StrEnum):
|
|
31
|
+
USDT = "USDT"
|
|
30
32
|
RUB = "RUB"
|
|
31
33
|
EUR = "EUR"
|
|
32
34
|
USD = "USD"
|
|
@@ -243,6 +245,7 @@ class InvoiceTypes(StrEnum):
|
|
|
243
245
|
banktransferdop = ("banktransferdop",)
|
|
244
246
|
sinpemovil = ("sinpemovil",)
|
|
245
247
|
tryqr = ("tryqr",)
|
|
248
|
+
inrqr = ("inrqr",)
|
|
246
249
|
bsb = ("bsb",)
|
|
247
250
|
banktransfermnt = ("banktransfermnt",)
|
|
248
251
|
stcpay = ("stcpay",)
|
|
@@ -289,6 +289,7 @@ class QuoteTlvResponse(BaseResponseModel):
|
|
|
289
289
|
qrVersion: int # qr code version, 1 - nspk, 2 - tlv encoded, 3 - tlv plain
|
|
290
290
|
rate: float # exchange rate
|
|
291
291
|
tlv: TLVExtended | None = None
|
|
292
|
+
isStatic: bool | None = None
|
|
292
293
|
# merchant: Optional[str] = Field(default=None) # merchant title
|
|
293
294
|
# logo: Optional[str] = Field(default=None) # merchant logo
|
|
294
295
|
|
|
@@ -299,3 +300,12 @@ class PayOutTlvRequest(BaseRequestModel):
|
|
|
299
300
|
clientId: Optional[str] = Field(default=None)
|
|
300
301
|
src_amount: Optional[float] = Field(default=None)
|
|
301
302
|
sender_personal: Optional[PayOutSenderModel] = Field(default=None)
|
|
303
|
+
|
|
304
|
+
class ListMetadata(BaseResponseModel):
|
|
305
|
+
page: int
|
|
306
|
+
limit: int
|
|
307
|
+
total: int
|
|
308
|
+
|
|
309
|
+
class InvoiceListModelWithMeta(BaseResponseModel):
|
|
310
|
+
metadata: ListMetadata
|
|
311
|
+
rows: List[InvoiceModel]
|
|
@@ -17,7 +17,7 @@ install_requires = \
|
|
|
17
17
|
|
|
18
18
|
setup_kwargs = {
|
|
19
19
|
'name': 'paymentsgate',
|
|
20
|
-
'version': '1.5.
|
|
20
|
+
'version': '1.5.7',
|
|
21
21
|
'description': "PaymentsGate's Python SDK for REST API",
|
|
22
22
|
'long_description': '\n# Paymentsgate Python SDK for Payments REST API\n\n\n## Requirements\n\n- Python >= 3.8.1\n- dependencies:\n - [`requests`](https://github.com/kennethreitz/requests)\n - [`pydantic`](https://docs.pydantic.dev/latest/)\n - [`jwt`](https://pyjwt.readthedocs.io/en/stable/)\n \n## Installation\n\nThe simplest way to install SDK is to use [PIP](https://docs.python.org/3/installing/):\n\n```bash\npip install paymentsgate\n```\n\n## Basic usage\n\n```python\nfrom paymentsgate import ApiClient, Credentials, Currencies\n\n\n# minimal configuration\nconfig = Credentials().fromFile(\'/path/to/credentials.json\');\n\n# create ApiClient\nclient = ApiClient(config, baseUrl=\'https://api.example.com\');\n\n# request quote\nres = cli.Quote(\n {\n "amount": 10.10,\n "currency_from": Currencies.EUR,\n "currency_to": Currencies.AZN,\n }\n)\nprint(res);\n```\n\nThe `credentials.json` file is used to connect to the client and contains all necessary data to use the API. This file can be obtained in your personal cabinet, in the service accounts section. Follow the instructions in the documentation to issue new keys. If you already have keys, but you don\'t feel comfortable storing them in a file, you can use client initialization via variables. In this case, the key data can be stored in external storage instead of on the file system:\n\n```python\nfrom paymentsgate import ApiClient, Credentials\n\nconfig = Credentials(\n account_id="00000000-4000-4000-0000-00000000000a" \n public_key="LS0tLS1CRUdJTiBSU0EgUFJJVkFUNSUlFb3dJQk..."\n)\n\nclient = ApiClient(config, baseUrl=\'https://api.example.com\');\n\n...\n```\n*It is important to note that the data format for key transfer is base46.\n\n## Examples\n\n### create PayIn\n\n```python\nres = cli.PayIn(\n {\n "amount": 10.10,\n "currency": Currencies.AZN,\n "invoiceId": "INVOICE-112123124",\n "clientId": "",\n "successUrl": "https://example.com/success",\n "failUrl": "https://example.com/fail",\n "type": InvoiceTypes.m10\n }\n)\nprint(res);\n```\n\n### create PayOut\n\n```python\nres = cli.PayOut(\n {\n "amount": 5.12,\n "currencyTo": Currencies.EUR,\n "invoiceId": "INVOICE-112123124",\n "clientId": "CLIENT-003010023004",\n "baseCurrency": CurrencyTypes.fiat,\n "feesStrategy": FeesStrategy.add,\n "recipient": {\n "account_number": "4000000000000012",\n "account_owner": "CARD HOLDER",\n "type": CredentialsTypes.card\n }\n }\n)\nprint(res);\n```\n\n### Error handling\n\n```python\ntry:\n res = cli.PayOut(\n {\n "amount": 5.12,\n "currencyTo": Currencies.EUR,\n "invoiceId": "INVOICE-112123124",\n "clientId": "CLIENT-003010023004",\n "baseCurrency": CurrencyTypes.fiat,\n "feesStrategy": FeesStrategy.add,\n "recipient": {\n "account_number": "4000000000000012",\n "account_owner": "CARD HOLDER",\n "type": CredentialsTypes.card\n }\n }\n )\n print(res);\nexcept APIAuthenticationError as err:\n print(f"Authentication fail: {err.message}")\nexcept APIResponseError as err:\n print(f"Exception: {err.error}; Message: {err.message}")\n```',
|
|
23
23
|
'author': 'PaymentsGate',
|
|
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
|