feat: invoice apis

refactor: minor api response
This commit is contained in:
2025-06-02 12:22:41 +05:30
parent 1a0109bebd
commit 532e0a3288
9 changed files with 223 additions and 30 deletions
+8 -1
View File
@@ -26,6 +26,12 @@ stripe_service = StripeServices()
# )
@router.get("/get-invoice", dependencies=[Depends(auth_required)])
async def get_invoice(req:Request):
invoice_url = await stripe_service.get_invoice(req.state.user)
return ApiResponse(data=invoice_url, message="Invoice URL retrieved successfully")
@router.post("/create-payment-session", dependencies=[Depends(auth_required)])
async def create_payment_session(req:Request):
session = await stripe_service.create_payment_session(req.state.user)
@@ -33,4 +39,5 @@ async def create_payment_session(req:Request):
@router.post("/webhook")
async def stripe_webhook(request: Request):
return await stripe_service.handle_webhook(request)
await stripe_service.handle_webhook(request)
return "OK"