The backend actually POST's a form
This commit is contained in:
parent
34a80217e4
commit
f169c758a0
1 changed files with 4 additions and 9 deletions
13
main.py
13
main.py
|
@ -69,15 +69,10 @@ def ok(**kwargs):
|
|||
|
||||
|
||||
@app.post("/revbank_plugin_backend")
|
||||
async def rb_backend(request: Request):
|
||||
body = await request.json()
|
||||
|
||||
action = body.get("action", None)
|
||||
payment_id = body.get("id", None)
|
||||
if not payment_id:
|
||||
raise HTTPException(status_code=400, detail="missing id")
|
||||
|
||||
payment = mollie_client.payments.get(payment_id)
|
||||
async def rb_backend(
|
||||
id: Annotated[str, Form()], action: Annotated[str | None, Form()] = None
|
||||
):
|
||||
payment = mollie_client.payments.get(id)
|
||||
|
||||
if not payment.is_paid():
|
||||
return not_ok(f"payment {payment.status}")
|
||||
|
|
Loading…
Add table
Reference in a new issue