1
Create Stripe Account
Before you start, make sure you have a Stripe accountYou can create a free account here
2
Get API Keys
You can get your API keys from https://dashboard.stripe.com/test/developersAdd the following keys to your
.env
file3
Create Products
- Head over to https://dashboard.stripe.com/products
- Click Create product
- Enter the name of the product, set the price, and add a description
- Set the billing period
- You can create 2 variants for the product. One for the yearly plan and one for the monthly plan.
4
Webhook
- Head over to https://dashboard.stripe.com/test/webhooks
- Click Add endpoint
-
Set the Endpoint URL to
https://your-domain.com/api/payment/webhook/stripe
- Select events to listen for: ✅ customer.subscription.created ✅ customer.subscription.updated ✅ customer.subscription.deleted
-
Copy the Signing secret and add it to your
.env
file
🎉 Congrats! You can make your first $ with Stripe now!