W
Wasp-langβ€’3mo ago
Gwain

Stripe Webhook Server in production

Hi! How should set up Open-Saas on Fly.io to also have my Webhook Server running? Do I need to run another fly machine that is just for the webhook server? Or can I run it in my same Server instance?
10 Replies
Gwain
Gwainβ€’3mo ago
OR, should I use stripe webhook that points to a URL? And if so I think I need to update the WASP webhook logic.
uglybeanhead
uglybeanheadβ€’3mo ago
in Stripe Dashboard you can set webhook endpoint to your server domain
No description
uglybeanhead
uglybeanheadβ€’3mo ago
it should look something like {your-fly-server-domain}/stripe-webhook
Gwain
Gwainβ€’3mo ago
Great! Can we get some documentation on that on the readme?
uglybeanhead
uglybeanheadβ€’3mo ago
they linked it in the stripe testing section https://stripe.com/docs/webhooks#test-webhook
Receive Stripe events in your webhook endpoint
Listen to events in your Stripe account on your webhook endpoint so your integration can automatically trigger reactions.
No description
Gwain
Gwainβ€’3mo ago
Using that method I get No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? I wonder if it's an issue with the Stipe API version conflict? OR I need to add different webhook key for using the webhook endpoint? UPDATE OK figured it out. The Stripe CLI that the Open-Saas Docs reference has to do with local Dev, once you deploy to Fly.io for example, you have to change the webhook secret in the Stripe -> Dev -> Webhooks section, create a new webhook by URL pointing to your server url/stripe-webhook endpoint, and then add the Webhook Secret found on the stripe dashboard to your .env settings. Hope this helps someone!
miho
mihoβ€’3mo ago
Nice work @Gwain and @uglybeanhead I'm sure this will help someone in the future 😊
Vinny (@Wasp)
Vinny (@Wasp)β€’3mo ago
Hey @Gwain & @uglybeanhead. Thanks for bringing this issue up πŸ™ I've added a guide for setting up the stripe webhook in prod. Mind taking a look and letting me know if I've missed anything? https://docs.opensaas.sh/guides/deploying/#setting-up-your-stripe-webhook
OpenSaaS.sh
Deploying
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
Gwain
Gwainβ€’3mo ago
So impressed Vinny with your response and docs. Yes that's perfect! You guys are awesome
Vinny (@Wasp)
Vinny (@Wasp)β€’3mo ago
oh, thanks πŸ™ just trying to help out our users and thanks again for making us aware of that issue