The backend actually POST's a form

This commit is contained in:
polyfloyd 2025-04-12 22:11:33 +02:00
parent 34a80217e4
commit f169c758a0

13
main.py
View file

@ -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}")