Payments
Learn how to set up and use Stripe for handling payments and subscriptions
Dirstarter uses Stripe for payment processing and subscription management. This integration handles expedited listings, featured spots, and recurring subscriptions.
Stripe Setup
- Create a Stripe account at stripe.com
- Get your API keys from the dashboard
- Add the following environment variables:
We only use the secret key. No need to create a publishable key.
Product Configuration
We recommend creating the following products in your Stripe dashboard:
Free
Expedited (One-time payment)
Featured (Subscription)
Create these products in your Stripe dashboard and add their IDs in your environment variables.
The icons at the beginning of each feature are optional, but recommended for better readability. They are rendered using proper colors and icons.
Webhook Setup
Stripe webhooks are used to handle asynchronous events like successful payments and subscription changes.
Local Development
In local development, you can use the Stripe CLI to forward events to your local server.
Install Stripe CLI
Login to Stripe
Forward Events
The webhook secret is printed in the terminal. Copy it and add it to your environment variables.
Trigger Test Events
Production
Add endpoint: https://your-domain.com/api/stripe/webhooks
Select events to listen for:
checkout.session.completed
customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
Copy the webhook secret and add it to your environment variables.
Webhook Events
The boilerplate handles these webhook events:
-
Expedited Listings
app/api/stripe/webhooks/route.ts -
Featured Listings
Last updated on