Add new response if request contains account id (#2629)

Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/2674/head
Joe Au-Yeung 2022-04-27 17:34:04 -04:00 committed by Omar López
parent e76fafdccf
commit c4dbab2637
1 changed files with 4 additions and 0 deletions

View File

@ -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);