From 62c38b92bd86eb976e7b253d08deadd61ab25d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:00:59 +0900 Subject: [PATCH] =?UTF-8?q?fix(stripe/webhook):=20Customer=20ID=E3=81=AB?= =?UTF-8?q?=E8=A9=B2=E5=BD=93=E3=81=99=E3=82=8B=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=81=8C=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=82=BF=E3=82=A4=E3=83=A0=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/StripeWebhookServerService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/StripeWebhookServerService.ts b/packages/backend/src/server/StripeWebhookServerService.ts index 2518d97de973..b554836f24f6 100644 --- a/packages/backend/src/server/StripeWebhookServerService.ts +++ b/packages/backend/src/server/StripeWebhookServerService.ts @@ -90,13 +90,14 @@ export class StripeWebhookServerService { if (!userProfile) { this.logger.warn(`CustomerId: "${customer}" has no user profile found.`); - return reply.code(400); + throw new Error(); } - reply.code(204); // Stripeへの応答を設定 + return { userProfile, subscription: eventData }; }; const { userProfile, subscription } = await preprocessEvent(event.data.object); + reply.code(204); // Stripeへの応答を設定 // Handle the event. switch (event.type) {