Testing Webhooks Locally
I wanted to be able to test webhooks locally so I didn’t have to keep deploying to code to test them. The problem with testing webhooks is that the service (Stripe, Braintree, etc.) needs a URL to callback. Ngrok is awesome, free software that allows you to test webhook callbacks locally by creating a tunnel that maps to your localhost address.
- Download ngrok
- Unzip the file
- Run the executable
- In the command prompt that comes up, type ‘ngrok http 3000’ (assuming that your local Rails app is running on port 3000 – i.e. localhost:3000), then enter
- ngrok should return some URLs that map to localhost:3000
- specify one of these URLs as the callback URL in your service’s settings