Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

7-12 Verify Purchase with Stripe Webhooks

In this lesson, we create our Stripe webhook handler.

We first create a generic method to handle any event we receive from Stripe. This requires verifying that the request came from Stripe using a signature that Stripe gives us.

Then, we can handle each event type in its own method handler. We handle the payment success and payment failed types. This lets us update the CoursePurchase object to set it as verified or delete it if the payment fails.

Stripe webhooks: https://stripe.com/docs/webhooks

This course was originally built with Nuxt 3, but it's no longer being maintained. You can still follow the lessons, but make sure to use the exact dependency versions listed in the course repository to avoid breaking changes.

If you’re looking for the most up-to-date and fully supported version, we recommend Mastering Nuxt: Full Stack Unleashed , which uses Nuxt 4 and actively being maintained.