From 1970a105a977d412cdbb64765543f0b6af22090e Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Mon, 7 Apr 2025 21:41:27 -0400 Subject: [PATCH] Webhook --- src/pages/api/webhooks/mollie.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/api/webhooks/mollie.ts b/src/pages/api/webhooks/mollie.ts index 1c3611bf..65f7990a 100644 --- a/src/pages/api/webhooks/mollie.ts +++ b/src/pages/api/webhooks/mollie.ts @@ -19,7 +19,7 @@ export const POST = defineApiRoute({ // Wir holen uns die Transaktion von Mollie. const payment = await mollieClient.payments.get(id); - const metadata = payment.metadata as { rechnung_uid: string } + const metadata = payment.metadata as { rechnung_id: string } if (!payment) { throw new APIError({ @@ -28,7 +28,7 @@ export const POST = defineApiRoute({ }); } - if (!metadata.rechnung_uid) { + if (!metadata.rechnung_id) { throw new APIError({ code: "BAD_REQUEST", message: "Rechnung UID nicht gefunden.", @@ -38,7 +38,7 @@ export const POST = defineApiRoute({ // Wir holen uns die Rechnung aus unserer Datenbank. const rechnung = await prisma.rechnung.findUnique({ where: { - uid: metadata.rechnung_uid, + id: metadata.rechnung_id, }, });