scb_service.py 356 Bytes
Newer Older
Ai-Sasit's avatar
Ai-Sasit committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
from fastapi import APIRouter, Request

scb = APIRouter()
temp = []

@scb.post("/scb/confirm_payment")
async def confirm_payment(req: Request):
    temp.append(req.json())
    return await req.json()

@scb.get("/scb/await_callback")
def await_callback():
    if temp:
        temp.pop(0)
        return {"SCB": True}
    else:
        return {"SCB": False}