W
Wasp4w ago
BeReal

stripe webhook

I am in the process of trying to deploy but running into an issue with my stripe webhook. Locally when testing I was running stripe listen --forward-to localhost:3001/payments-webhook and this was working correct. I have tried following the docs and creating a https://myapp-server.fly.dev/payments-webhook and https://myapp-server.fly.dev/stripe-webhook. I have selected the correct events to listen to but in my server logs i can see it is not working correctly. I also updated my STRIPE_WEBHOOK_SECRET env var, what else could I check or be doing wrong?
3 Replies
kapa.ai
kapa.ai4w ago
Hi @BeReal. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the knowledge sources, I can offer some guidance on setting up Stripe webhooks for your deployed Wasp application. Here are some key points to check: 1. Webhook URL: According to the documentation, your webhook endpoint should be set to {your-fly-server-domain}/stripe-webhook. Make sure you're using this exact path in your Stripe Dashboard settings. Discord support thread (https://discord.com/channels/686873244791210014/1220115828012351529) 2. Webhook Secret: You mentioned updating the STRIPE_WEBHOOK_SECRET env var, which is correct. Ensure that you've added the new Webhook Secret found on the Stripe dashboard to your .env settings on your deployed environment. Discord support thread (https://discord.com/channels/686873244791210014/1220115828012351529) 3. Stripe API Version: One user encountered issues due to using a newer Stripe API version (2023-10-16). Make sure your API version matches the one expected by the Wasp template you're using. Discord support thread (https://discord.com/channels/686873244791210014/1214979650803998781) 4. Event Types: Confirm that you've selected all the necessary event types in your Stripe Dashboard for the webhook to listen to. The specific events needed may depend on your application's requirements. 5. Server Logs: Since you mentioned seeing issues in your server logs, it would be helpful to add more detailed logging in your webhook handling code. For example, you could add console.log(event.type) statements to see which events are being received. 6. Testing: After deployment, you can use the Stripe CLI to test your webhook by triggering events. This can help isolate whether the issue is with the webhook configuration or the event handling in your code. Stripe Testing Guide (https://docs.opensaas.sh/guides/stripe-testing/#testing-webhooks-via-the-stripe-cli) If you're still encountering issues after checking these points, it might be helpful to share more specific error messages or logs from your server to get more targeted assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @BeReal, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
BeReal
BeRealOP4w ago
I found the issue, I was still running in test mode but my webhook was a production webhook, creating a webhook in test mode confirmed my code was workign
Filip
Filip4w ago
Glad you fixed it @BeReal!

Did you find this page helpful?