vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
5.83k stars 1.19k forks source link

Handles unsupported Stripe events sent to webhook. #254

Closed kevinkatzke closed 5 months ago

kevinkatzke commented 9 months ago

This commit adds and handler that throws and error when Stripe sends unsupported events to the applications webhook endpoint <project-url/api/webhooks>. The error messages can be obtained from the Vercel logs.

Use case: I tried to delete products in Stripe and wondered why the Supabase DB wasn't reflecting the changes. I noticed that app/webhooks/route.ts doesn't support the Stripe event product.deleted when it is sent to the webhook. This commit adds a relevant error message, making it easier for users to debug such cases.

vercel[bot] commented 9 months ago

@kevinkatzke is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

chriscarrollsmith commented 7 months ago

Deletion of products and sensible error handling are supported by this PR: https://github.com/vercel/nextjs-subscription-payments/pull/271

leerob commented 5 months ago

https://github.com/vercel/nextjs-subscription-payments/pull/278