From eea40c69f7a5d6cae5723bb8023f5d69edaa2811 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Wed, 27 Apr 2022 17:34:04 -0400 Subject: [PATCH] Add new response if request contains account id (#2629) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Omar López Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/ee/pages/api/integrations/stripepayment/webhook.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/ee/pages/api/integrations/stripepayment/webhook.ts b/apps/web/ee/pages/api/integrations/stripepayment/webhook.ts index 1b29a7e8..7bddc5b3 100644 --- a/apps/web/ee/pages/api/integrations/stripepayment/webhook.ts +++ b/apps/web/ee/pages/api/integrations/stripepayment/webhook.ts @@ -174,6 +174,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const event = stripe.webhooks.constructEvent(payload, sig, process.env.STRIPE_WEBHOOK_SECRET); + if (event.account) { + throw new HttpCode({ statusCode: 202, message: "Incoming connected account" }); + } + const handler = webhookHandlers[event.type]; if (handler) { await handler(event);