From f169c758a0c333480135876a1851ae17a3d7c897 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sat, 12 Apr 2025 22:11:33 +0200 Subject: [PATCH] The backend actually POST's a form --- main.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index f25388f..bcb91ea 100644 --- a/main.py +++ b/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}")