Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set localhost as a Stripe webhook URL?

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.

like image 330
DjangoDev Avatar asked Mar 12 '13 09:03

DjangoDev


People also ask

How do I get localhost Webhooks?

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.

How do you implement Webhooks in Stripe?

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.


1 Answers

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

like image 189
Vinay Sahni Avatar answered Sep 25 '22 16:09

Vinay Sahni