paymentsgate 1.5.6__py3-none-any.whl → 1.5.9__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 +41 -2
- paymentsgate/enums.py +2 -0
- paymentsgate/models.py +26 -14
- {paymentsgate-1.5.6.dist-info → paymentsgate-1.5.9.dist-info}/METADATA +1 -1
- {paymentsgate-1.5.6.dist-info → paymentsgate-1.5.9.dist-info}/RECORD +7 -7
- {paymentsgate-1.5.6.dist-info → paymentsgate-1.5.9.dist-info}/LICENSE +0 -0
- {paymentsgate-1.5.6.dist-info → paymentsgate-1.5.9.dist-info}/WHEEL +0 -0
paymentsgate/client.py
CHANGED
|
@@ -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 = 0) -> InvoiceListModelWithMeta:
|
|
149
|
+
# Prepare request
|
|
150
|
+
request = Request(
|
|
151
|
+
method="get",
|
|
152
|
+
path=ApiPaths.invoices_list,
|
|
153
|
+
content_type='application/json',
|
|
154
|
+
noAuth=False,
|
|
155
|
+
signature=False,
|
|
156
|
+
body={"page": page},
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
# Handle response
|
|
160
|
+
response = await self._send_request(request)
|
|
161
|
+
if not response.success:
|
|
162
|
+
raise APIResponseError(response)
|
|
163
|
+
return response.cast(InvoiceListModelWithMeta, APIResponseError)
|
|
146
164
|
|
|
147
165
|
async def get_token(self) -> AccessToken | None:
|
|
148
166
|
# First check if valid token is cached
|
|
@@ -333,6 +351,7 @@ class ApiClient(BaseClient):
|
|
|
333
351
|
noAuth=False,
|
|
334
352
|
signature=False,
|
|
335
353
|
body=params.model_dump(exclude_none=True),
|
|
354
|
+
# body=GetQuoteTlv(**params).model_dump(exclude_none=True),
|
|
336
355
|
)
|
|
337
356
|
|
|
338
357
|
# Handle response
|
|
@@ -359,6 +378,23 @@ class ApiClient(BaseClient):
|
|
|
359
378
|
|
|
360
379
|
return response.cast(InvoiceModel, APIResponseError)
|
|
361
380
|
|
|
381
|
+
def List(self, page: int = 0) -> InvoiceListModelWithMeta:
|
|
382
|
+
# Prepare request
|
|
383
|
+
request = Request(
|
|
384
|
+
method="get",
|
|
385
|
+
path=ApiPaths.invoices_list,
|
|
386
|
+
content_type='application/json',
|
|
387
|
+
noAuth=False,
|
|
388
|
+
signature=False,
|
|
389
|
+
body={"page": page},
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
# Handle response
|
|
393
|
+
response = self._send_request(request)
|
|
394
|
+
if not response.success:
|
|
395
|
+
raise APIResponseError(response)
|
|
396
|
+
return response.cast(InvoiceListModelWithMeta, APIResponseError)
|
|
397
|
+
|
|
362
398
|
def get_token(self) -> AccessToken | None:
|
|
363
399
|
# First check if valid token is cached
|
|
364
400
|
token = self.cache.get_token('access')
|
|
@@ -413,7 +449,10 @@ class ApiClient(BaseClient):
|
|
|
413
449
|
headers["Authorization"] = f"Bearer {auth.token}"
|
|
414
450
|
|
|
415
451
|
if (request.method == 'get'):
|
|
416
|
-
|
|
452
|
+
if (request.body == None):
|
|
453
|
+
request.body = ''
|
|
454
|
+
|
|
455
|
+
params = urlencode(request.body)
|
|
417
456
|
r = httpx.request(
|
|
418
457
|
method=request.method,
|
|
419
458
|
url=f"{self.baseUrl}{request.path}?{params}",
|
|
@@ -425,7 +464,7 @@ class ApiClient(BaseClient):
|
|
|
425
464
|
method=request.method,
|
|
426
465
|
url=f"{self.baseUrl}{request.path}",
|
|
427
466
|
headers=headers,
|
|
428
|
-
json=body,
|
|
467
|
+
json=request.body,
|
|
429
468
|
timeout=self.timeout
|
|
430
469
|
)
|
|
431
470
|
|
paymentsgate/enums.py
CHANGED
|
@@ -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"
|
|
19
20
|
assets_list = "/wallet"
|
|
20
21
|
assets_deposit = "/wallet/deposit"
|
|
21
22
|
banks_list = "/banks/find"
|
|
@@ -244,6 +245,7 @@ class InvoiceTypes(StrEnum):
|
|
|
244
245
|
banktransferdop = ("banktransferdop",)
|
|
245
246
|
sinpemovil = ("sinpemovil",)
|
|
246
247
|
tryqr = ("tryqr",)
|
|
248
|
+
inrqr = ("inrqr",)
|
|
247
249
|
bsb = ("bsb",)
|
|
248
250
|
banktransfermnt = ("banktransfermnt",)
|
|
249
251
|
stcpay = ("stcpay",)
|
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):
|
|
@@ -289,6 +290,7 @@ class QuoteTlvResponse(BaseResponseModel):
|
|
|
289
290
|
qrVersion: int # qr code version, 1 - nspk, 2 - tlv encoded, 3 - tlv plain
|
|
290
291
|
rate: float # exchange rate
|
|
291
292
|
tlv: TLVExtended | None = None
|
|
293
|
+
isStatic: bool | None = None
|
|
292
294
|
# merchant: Optional[str] = Field(default=None) # merchant title
|
|
293
295
|
# logo: Optional[str] = Field(default=None) # merchant logo
|
|
294
296
|
|
|
@@ -299,3 +301,13 @@ class PayOutTlvRequest(BaseRequestModel):
|
|
|
299
301
|
clientId: Optional[str] = Field(default=None)
|
|
300
302
|
src_amount: Optional[float] = Field(default=None)
|
|
301
303
|
sender_personal: Optional[PayOutSenderModel] = Field(default=None)
|
|
304
|
+
|
|
305
|
+
class ListMetadata(BaseResponseModel):
|
|
306
|
+
page: int
|
|
307
|
+
limit: int
|
|
308
|
+
total: int
|
|
309
|
+
|
|
310
|
+
class InvoiceListModelWithMeta(BaseResponseModel):
|
|
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=Mvu0egkKl1oOGEe5WuhfTNLIIWC76lpFDSwyeWF--8s,16523
|
|
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.9.dist-info/LICENSE,sha256=4xWMZLmqNJ6602DZLEg0A9v03uT4xMq_-XSIxvXvfYM,1075
|
|
14
|
+
paymentsgate-1.5.9.dist-info/WHEEL,sha256=bbU3AyvhQ312rVm7zzRQjs6axI1UYWC3nmFA2E6FFSI,88
|
|
15
|
+
paymentsgate-1.5.9.dist-info/METADATA,sha256=XNuGEYODZV4Dkh1xH2FIvlh_7Bx5inU0xCJefLcM10g,4055
|
|
16
|
+
paymentsgate-1.5.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|