Payment
Set up Stripe for receiving money.
Basic Setup
- Go to stripe.com, sign up and complete the verification process... see you in few minutes.
- In the Stripe Dashboard, go to Developers → API keys, copy your publishable key and secret key
- Add them to
.env
file:
-
Go to settings/emails and turn on successful payments for customers
-
Navigate to product and create a product
-
Fill in the necessary details (name, description, etc.) and set up the pricing (no worries everything can be change at any time).
Webhooks
Webhooks allow Stripe to notify your application when events happen in your account:
For Local Development
- Install the Stripe CLI: Installation Guide
- Login to your Stripe account via the CLI:
- Start forwarding events to your local server:
- Copy the webhook signing secret displayed by the CLI and add it to your
.env
file:
For Production
- In the Stripe Dashboard, go to Developers → Webhooks
- Click "Add endpoint"
- Enter your webhook URL:
https://your-domain.com/api/webhooks/stripe
- Select the events you want to receive (at minimum: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted)
- Copy the signing secret and update your production environment variables