Join our community

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

7-11 Create CoursePurchase in the Database

In this lesson, we solve step one by creating the CoursePurchase object.

First, we add the model to our Prisma schema. The key fields here are verified, which defaults to false, the paymentId, and the userEmail.

Then, we create the CoursePurchase object in the paymentIntent endpoint. This way we can be sure that it exists before the Stripe webhook fires (we implement the webhook in the next lesson).