Question

I have stripe all set accepting payments and the stripe_event gem installed. In the docs for the gem it says to just do something like this in routes.rb:

mount StripeEvent::Engine => '/stripe'

but that is failing to show anything at that route. What else do I need to do to get the webhook working in my development environment? Is it even possible? (I did set the stripe webhook to be sent to 0.0.0.0:3000 but I am sure that is wrong.

Thank you!

Was it helpful?

Solution 2

The webhook endpoint you set with Stripe needs to be a live url, not 0.0.0.0 or localhost. The routes appear to be setup correctly. You can test locally using curl:

$ curl -X POST -H "Content-type: application/json" -H "Accept: application/json" -d '{"id":"evt_REPLACEME"}' localhost:3000/your-webhook-path

OTHER TIPS

For anyone else trying to receive webhooks on localhost with a Rails application I highly recommend this tool I just came across. Setup and running in seconds:

http://www.ultrahook.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top