How to test Stripe webhooks locally
Learn how to run local tests of the webhooks setup with the Stripe payment provider.
Last updated
Was this helpful?
Learn how to run local tests of the webhooks setup with the Stripe payment provider.
Last updated
Was this helpful?
The Stripe payment provider uses webhooks to finalize payments. Due to this, it can be tricky to test payments locally as Mollie must have a public-facing URL to be able to notify you.
You could expose your website through your network's firewall or use tools to create temporary tunnels through your network. Below you can find two options to create temporary tunnels through your network:
Go to the and install the stripe CLI.
Go to the and log in to the CLI.
While running the site locally, make a note of your local store domain. For example: https://localhost:44321
. Using the Stripe CLI, you can configure Stripe to forward any events to that URL.
To do so, run the following from the command line.
The {payment_method_id}
is configured as part of the Stripe step.
e.g.
With the Stripe CLI running, you can now test the site using your local dev domain. You will see any configured stripe events configured for the webhook displayed in the console window and can debug them using Visual Studio.
Download and install the tool on your system.
You can either launch ngrok from the command line or use the steps below to create a batch file to be run at any time.
Open NotePad.
Type the following:
Swap the local domain/port number at the end according to the configuration of your site.
Save the file as ngrok.bat
at the root of your web project.
You can run the batch file at any time to launch ngrok and create a publicly accessible tunnel to your website.
You will see webhook requests displayed in the console window, and you can debug them using Visual Studio.
When you start listening to Stripe events, the command line will give you a webhook signing secret. This should be used to set the Test Webhook Signing Secret
setting, shown in the Umbraco step.
Go to the .
With ngrok running you can now test the site using the URLs displayed in the console window. Use these URLs (preferably the secure https
one) for your Stripe and you should now be able to test your Stripe webhooks locally.