Stripe working in production but user credits don't update
Hi guys,
Today I tried to make a payment on my SaaS https://www.fueltrackerapp.com and everything worked fine except for one thing, the user credits didn't update! I'm not so sure what's happening because in dev mode everything works fine. Anybody knows what could be happening?
36 Replies
Hi @jordi0lle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, based on the knowledge sources, it seems like other users have experienced similar issues with Stripe and user credits not updating. Here are a few things you could check:
1. Make sure you're running the Stripe CLI and that you're receiving events to the webhook. You can check this in the Stripe testing section of the open SaaS docs.
2. Check if you're importing the correct action on the client. For example, you should be importing
stripeCreditsPayment
.
3. Try to debug by adding console.log lines in your code to see where the issue might be occurring.
4. Ensure that your Stripe product configuration is correct. You should have a one-time payment product set up for buying credits.
5. Check if there's a difference between your development and production environments that could be causing the issue.
If you're still having trouble, it might be helpful to look at the Wasp Discord (https://discord.com/channels/686873244791210014) for more specific advice or to ask the community for help.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @jordi0lle, 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?@Vinny (@Wasp) please take a look 🙃
It’s working in dev but not prod — this sounds like some env variables or configuration got messed up along the way.
Is the webhook configured correctly for prod? Did you create a product for a credits payment just as you did when testing (but not in stripe test mode obviously)?
Also can you check your stripe dashboard and under webhooks look for the webhook event that was sent by stripe when the payment was made?
Stripe Login | Sign in to the Stripe Dashboard
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Successful events will look like this
![No description](https://cdn.answeroverflow.com/1256559329742422126/IMG_9526.png)
If the event isn’t even being sent, then you didn’t configure your webhook to listen for it
![No description](https://cdn.answeroverflow.com/1256559609762545765/1256559329981759518remix-1719657555169.png)
@jordi0lle
I'll try this later today because I just checked and I only have it set in test mode. I'll inform here if the problem is solved after checking it 😄
THX @Vinny (@Wasp)
Hi @Vinny (@Wasp),
I changed added the correct key and the 4 events used for purchasing credits and now I'm not so sure how to solve this:
![No description](https://cdn.answeroverflow.com/1256886330965889054/image.png)
Any idea?
Hmm. If it was working in development than there is some configuration step that you’re missing in production. Did you get the production webhook signing secret? Is the webhook on stripe pointing to the correct url? Are other aspects of your app working? If not maybe you forgot an env variable somewhere else
I got the weebhook signing secret from here
![No description](https://cdn.answeroverflow.com/1256896910707523606/image.png)