Using Stripe Webhooks with localhost URLs

Stripe, as we know is one of the most convenient Payment gateways not only for the Businesses/Customers but also for the developers since it provides a powerful API to integrate in almost any system regardless of platform or language dependency.

As in any other payment gateway it also provides us with Webhooks to make sure the payments are done in a reliable way.

But the problem comes up when the developer is working on his local setup since Stripe webhooks need publicly accessible URLs to hit and work with. So how do we work around it?
Fortunately, someone has already thought about it and that someone is Vinay Sahni . He created Ultrahook to access URLs behind firewalls.

So to start working we first need Ultrahook. Ultrahook comes as a RubyGem. So if you are on Ubuntu first install RubyGems:

Now install Ultrahooks Gem from Rubygems.com

After you have successfully installed above stuff, go ahead and register at Ultrahook with a new unique subdomain. After successful registration, you will get an API key.
Now run the following command on console by replacing {YOURAPIKEYHERE} with your API key:

There we go, we are all set to route our live URLs to localhost URLs. Now run the ultrahook command like so:

For example:

Ultrahook will try to authenticate your API key and once done it will notify that your requests are being routes from {SUBDOMAIN@ULTRAHOOK}.ultrahook.com to {YOURLOCALHOSTURL}. And don’t close the terminal window since it will show the requests status when they are made (200,500 etc).

Now, you can use your {SUBDOMAIN@ULTRAHOOK}.ultrahook.com URL as an endpoint Stripe and test the webhooks.

alexey

alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.
alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.