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")
|
@app.post("/revbank_plugin_backend")
|
||||||
async def rb_backend(request: Request):
|
async def rb_backend(
|
||||||
body = await request.json()
|
id: Annotated[str, Form()], action: Annotated[str | None, Form()] = None
|
||||||
|
):
|
||||||
action = body.get("action", None)
|
payment = mollie_client.payments.get(id)
|
||||||
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)
|
|
||||||
|
|
||||||
if not payment.is_paid():
|
if not payment.is_paid():
|
||||||
return not_ok(f"payment {payment.status}")
|
return not_ok(f"payment {payment.status}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue