I am creating a payment gateway using Stripe.
I want to set my localhost url localhost/stripe/webhook.php
as my webhook url. Is it possible to set a localhost address as a webhook url? This will be used to create a mail service that is triggered on every successful charge in Stripe.
Setting up the webhook to use localhost. run. To set up a webhook in GitHub, navigate to the Webhooks tab in your repository settings, and choose "Add webhook". Under "Payload URL", enter the localhost.
Steps to receive webhooksCreate a webhook endpoint as an HTTP endpoint (URL) on your local server. Handle requests from Stripe by parsing each event object and returning 2xx response status codes. Test that your webhook endpoint is working properly using the Stripe CLI.
Stripe now has an official tool, the Stripe CLI that makes this easy (but still requires installing another tool).
See this answer below or the official Stripe CLI docs.
Alternatively, the another way to achieve this is with http://www.ultrahook.com which allows you to receive webhooks on localhost. This alternative will work with all webhooks, not just Stripe's
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With