Stripe Webhooks & Testing
Laratic is already configured to handle Stripe webhooks. You just need to set up the webhook in your Stripe dashboard.
Set up a local listener with stripe cli
Make sure you have the Stripe CLI installed. Then run the following command to start a local listener, adjust the url to your app url:
stripe listen --forward-to http://127.0.0.1:8000/stripe/webhook
Get Webhook Secret
In your Stripe dashboard, open the developers overlay from the bottom of the page and go to Webhooks tab. Take note of the webhook signing secret.
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXX
Create a Webhook Endpoint in Stripe
In the Stripe dashboard, create a webhook endpoint pointing to:
https://your-app-domain.com/stripe/webhook
Enable these events (the app handles them):
checkout.session.completedinvoice.payment_succeededcharge.updatedcharge.refunded