feat: billing cancel
This commit is contained in:
5
external/billing/billing_client.py
vendored
5
external/billing/billing_client.py
vendored
@@ -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)
|
||||
|
||||
8
external/billing/schemas.py
vendored
8
external/billing/schemas.py
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user