feat: billing cancel

This commit is contained in:
2024-08-09 05:22:39 +03:00
parent 97f835ffde
commit 2c9ff3b373
5 changed files with 49 additions and 1 deletions

View File

@@ -21,6 +21,11 @@ class BillingClient:
response = await self._method('POST', '/create', json=json_data)
return CreateBillingResponseSchema.model_validate(response)
async def delete(self, request: DeleteBillRequestSchema) -> DeleteBillResponseSchema:
method = f'/delete/{request.listener_transaction_id}'
response = await self._method('POST', method)
return DeleteBillResponseSchema.model_validate(response)
async def notify_received(self, request: NotifyReceivedBillRequestSchema) -> NotifyReceivedBillResponseSchema:
json_data = request.model_dump()
response = await self._method('POST', '/notify-received', json=json_data)

View File

@@ -45,6 +45,14 @@ class CreateBillRequestSchema(BaseSchema):
return None
class DeleteBillRequestSchema(BaseSchema):
listener_transaction_id: int
class DeleteBillResponseSchema(BaseSchema):
ok: bool
class NotifyReceivedBillRequestSchema(BaseSchema):
listener_transaction_id: int
channel: NotificationChannel