paymentsgate 1.5.7__py3-none-any.whl → 1.5.10__py3-none-any.whl
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/client.py +30 -5
- paymentsgate/enums.py +1 -1
- paymentsgate/models.py +18 -16
- {paymentsgate-1.5.7.dist-info → paymentsgate-1.5.10.dist-info}/METADATA +1 -1
- {paymentsgate-1.5.7.dist-info → paymentsgate-1.5.10.dist-info}/RECORD +7 -7
- {paymentsgate-1.5.7.dist-info → paymentsgate-1.5.10.dist-info}/LICENSE +0 -0
- {paymentsgate-1.5.7.dist-info → paymentsgate-1.5.10.dist-info}/WHEEL +0 -0
paymentsgate/client.py
CHANGED
|
@@ -145,14 +145,17 @@ class ApiAsyncClient(BaseClient):
|
|
|
145
145
|
raise APIResponseError(response)
|
|
146
146
|
return response.cast(InvoiceModel, APIResponseError)
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
# dateFrom: str # ISO: 2025-07-10T00:00:00.873+00:00
|
|
149
|
+
# dateTo?: str # ISO: 2025-07-10T00:00:00.873+00:00
|
|
150
|
+
async def List(self, page: int = 0, dateFrom: str = '', dateTo: str = '') -> InvoiceListModelWithMeta:
|
|
149
151
|
# Prepare request
|
|
150
152
|
request = Request(
|
|
151
153
|
method="get",
|
|
152
|
-
path=ApiPaths.invoices_list
|
|
154
|
+
path=ApiPaths.invoices_list,
|
|
153
155
|
content_type='application/json',
|
|
154
156
|
noAuth=False,
|
|
155
157
|
signature=False,
|
|
158
|
+
body={"page": page, "dateFrom": dateFrom, "dateTo": dateTo},
|
|
156
159
|
)
|
|
157
160
|
|
|
158
161
|
# Handle response
|
|
@@ -161,7 +164,6 @@ class ApiAsyncClient(BaseClient):
|
|
|
161
164
|
raise APIResponseError(response)
|
|
162
165
|
return response.cast(InvoiceListModelWithMeta, APIResponseError)
|
|
163
166
|
|
|
164
|
-
|
|
165
167
|
async def get_token(self) -> AccessToken | None:
|
|
166
168
|
# First check if valid token is cached
|
|
167
169
|
token = self.cache.get_token("AccessToken")
|
|
@@ -351,6 +353,7 @@ class ApiClient(BaseClient):
|
|
|
351
353
|
noAuth=False,
|
|
352
354
|
signature=False,
|
|
353
355
|
body=params.model_dump(exclude_none=True),
|
|
356
|
+
# body=GetQuoteTlv(**params).model_dump(exclude_none=True),
|
|
354
357
|
)
|
|
355
358
|
|
|
356
359
|
# Handle response
|
|
@@ -377,6 +380,25 @@ class ApiClient(BaseClient):
|
|
|
377
380
|
|
|
378
381
|
return response.cast(InvoiceModel, APIResponseError)
|
|
379
382
|
|
|
383
|
+
# dateFrom: str # ISO: 2025-07-10T00:00:00.873+00:00
|
|
384
|
+
# dateTo?: str # ISO: 2025-07-10T00:00:00.873+00:00
|
|
385
|
+
def List(self, page: int = 0, dateFrom: str = '', dateTo: str = '') -> InvoiceListModelWithMeta:
|
|
386
|
+
# Prepare request
|
|
387
|
+
request = Request(
|
|
388
|
+
method="get",
|
|
389
|
+
path=ApiPaths.invoices_list,
|
|
390
|
+
content_type='application/json',
|
|
391
|
+
noAuth=False,
|
|
392
|
+
signature=False,
|
|
393
|
+
body={"page": page, "dateFrom": dateFrom, "dateTo": dateTo},
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
# Handle response
|
|
397
|
+
response = self._send_request(request)
|
|
398
|
+
if not response.success:
|
|
399
|
+
raise APIResponseError(response)
|
|
400
|
+
return response.cast(InvoiceListModelWithMeta, APIResponseError)
|
|
401
|
+
|
|
380
402
|
def get_token(self) -> AccessToken | None:
|
|
381
403
|
# First check if valid token is cached
|
|
382
404
|
token = self.cache.get_token('access')
|
|
@@ -431,7 +453,10 @@ class ApiClient(BaseClient):
|
|
|
431
453
|
headers["Authorization"] = f"Bearer {auth.token}"
|
|
432
454
|
|
|
433
455
|
if (request.method == 'get'):
|
|
434
|
-
|
|
456
|
+
if (request.body == None):
|
|
457
|
+
request.body = ''
|
|
458
|
+
|
|
459
|
+
params = urlencode(request.body)
|
|
435
460
|
r = httpx.request(
|
|
436
461
|
method=request.method,
|
|
437
462
|
url=f"{self.baseUrl}{request.path}?{params}",
|
|
@@ -443,7 +468,7 @@ class ApiClient(BaseClient):
|
|
|
443
468
|
method=request.method,
|
|
444
469
|
url=f"{self.baseUrl}{request.path}",
|
|
445
470
|
headers=headers,
|
|
446
|
-
json=body,
|
|
471
|
+
json=request.body,
|
|
447
472
|
timeout=self.timeout
|
|
448
473
|
)
|
|
449
474
|
|
paymentsgate/enums.py
CHANGED
|
@@ -16,7 +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
|
|
19
|
+
invoices_list = "/deals/list"
|
|
20
20
|
assets_list = "/wallet"
|
|
21
21
|
assets_deposit = "/wallet/deposit"
|
|
22
22
|
banks_list = "/banks/find"
|
paymentsgate/models.py
CHANGED
|
@@ -211,27 +211,28 @@ class InvoiceAmountModel(BaseResponseModel):
|
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
class InvoiceMetadataModel(BaseResponseModel):
|
|
214
|
-
invoiceId: Optional[str]
|
|
215
|
-
clientId: Optional[str]
|
|
216
|
-
fiatAmount: Optional[float]
|
|
214
|
+
invoiceId: Optional[str] | None = None
|
|
215
|
+
clientId: Optional[str] | None = None
|
|
216
|
+
fiatAmount: Optional[float] | None = None
|
|
217
217
|
|
|
218
218
|
|
|
219
219
|
class InvoiceModel(BaseResponseModel):
|
|
220
220
|
id: str | None = Field(..., alias='_id')
|
|
221
|
-
orderId: str
|
|
222
|
-
projectId: str
|
|
223
|
-
currencyFrom: CurrencyModel
|
|
224
|
-
currencyTo: CurrencyModel
|
|
225
|
-
direction: InvoiceDirection
|
|
226
|
-
amount: float
|
|
227
|
-
status: InvoiceStatusModel
|
|
228
|
-
amounts: InvoiceAmountModel
|
|
229
|
-
metadata: InvoiceMetadataModel
|
|
230
|
-
receiptUrls: List[str]
|
|
231
|
-
isExpired: bool
|
|
221
|
+
orderId: str | None = None
|
|
222
|
+
projectId: str | None = None
|
|
223
|
+
currencyFrom: CurrencyModel | None = None
|
|
224
|
+
currencyTo: CurrencyModel | None = None
|
|
225
|
+
direction: InvoiceDirection | None = None
|
|
226
|
+
amount: float | None = None
|
|
227
|
+
status: InvoiceStatusModel | None = None
|
|
228
|
+
amounts: InvoiceAmountModel | None = None
|
|
229
|
+
metadata: InvoiceMetadataModel | None = None
|
|
230
|
+
receiptUrls: List[str] | None = None
|
|
231
|
+
isExpired: bool | None = None
|
|
232
232
|
createdAt: datetime.datetime | None = None
|
|
233
233
|
updatedAt: datetime.datetime | None = None
|
|
234
234
|
expiredAt: datetime.datetime | None = None
|
|
235
|
+
model_config = ConfigDict(extra="ignore")
|
|
235
236
|
|
|
236
237
|
|
|
237
238
|
class AssetsAccountModel(BaseResponseModel):
|
|
@@ -307,5 +308,6 @@ class ListMetadata(BaseResponseModel):
|
|
|
307
308
|
total: int
|
|
308
309
|
|
|
309
310
|
class InvoiceListModelWithMeta(BaseResponseModel):
|
|
310
|
-
|
|
311
|
-
rows: List[InvoiceModel]
|
|
311
|
+
meta: ListMetadata
|
|
312
|
+
rows: List[InvoiceModel]
|
|
313
|
+
model_config = ConfigDict(extra="ignore")
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
paymentsgate/__init__.py,sha256=ZEvXcrfobIRRPO6szTwvaNWxx5t9MLGT7KCkB5dJun4,364
|
|
2
2
|
paymentsgate/cache.py,sha256=gkx5Bu_Z8nEr_qDB4_O2tVbCdLmePztaz7iJRZWWn14,1007
|
|
3
|
-
paymentsgate/client.py,sha256=
|
|
4
|
-
paymentsgate/enums.py,sha256=
|
|
3
|
+
paymentsgate/client.py,sha256=EtIpCNQYU43JmmMaEWozlsgk2BmeIV-TaThdibCUbR8,16905
|
|
4
|
+
paymentsgate/enums.py,sha256=B58povNxtPDJTZGbQUm-CJFgdxgooO8nXCaZbVxcqco,6623
|
|
5
5
|
paymentsgate/exceptions.py,sha256=HtQf0aRF5aKlXUh9uJyxHciJzXYC2zRxz9-HUIl2wDA,1525
|
|
6
6
|
paymentsgate/logger.py,sha256=4Xs2R18au88LRUvF3Ll6xf8ziz4xyq65UU3pcgXPg8g,220
|
|
7
7
|
paymentsgate/mappers.py,sha256=Rr4LM7lAPI1sQgaVirgm2LREvO-7vV4yEUsu6W_ARIw,162
|
|
8
|
-
paymentsgate/models.py,sha256=
|
|
8
|
+
paymentsgate/models.py,sha256=qokxHu4esFBp5rk0TA1-bQyNKeieprWZda1ZQw4nJ6U,9882
|
|
9
9
|
paymentsgate/signature.py,sha256=FCF9GKvVyXQAEpUylt3i3vJKhCWjEHgqfVqyA5l7WPY,2996
|
|
10
10
|
paymentsgate/tokens.py,sha256=ZK_xKj8GWTlXjl-8ZlU216dZdxjFFEKsRp41XR1cUQA,914
|
|
11
11
|
paymentsgate/transport.py,sha256=KA4Ro48s_6PzJ5ZRLf-eygYKjNUJ8OReiBWAVi8rHM8,852
|
|
12
12
|
paymentsgate/types.py,sha256=AoMJ4eFpTAAZ_n4ZeUIJY4hUD_E9tFgoBUqKy18FJ44,130
|
|
13
|
-
paymentsgate-1.5.
|
|
14
|
-
paymentsgate-1.5.
|
|
15
|
-
paymentsgate-1.5.
|
|
16
|
-
paymentsgate-1.5.
|
|
13
|
+
paymentsgate-1.5.10.dist-info/LICENSE,sha256=4xWMZLmqNJ6602DZLEg0A9v03uT4xMq_-XSIxvXvfYM,1075
|
|
14
|
+
paymentsgate-1.5.10.dist-info/WHEEL,sha256=bbU3AyvhQ312rVm7zzRQjs6axI1UYWC3nmFA2E6FFSI,88
|
|
15
|
+
paymentsgate-1.5.10.dist-info/METADATA,sha256=My3IwdgE4KsiLo8oNEpW_8bO5UgO33iUaXvARKZX_iY,4056
|
|
16
|
+
paymentsgate-1.5.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|