User Tier doesn't update
Hello fellas,
I am trying to test stripe in production and even though the transaction is shown as successful and i am redirected, the user's properties does not update that is it stays the same. It however works perfectly fine on my own machine. I cannot seem to see where this is going wrong does anyone have an idea? Is it not possible to do this?
11 Replies
Wohooo @Ertan Köse, you just became a Waspeteer level 2!
Hi @Ertan Köse. 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, there could be a few reasons why the user's properties are not updating after a successful Stripe transaction.
1. Webhook Events: Ensure that your application is correctly listening for and handling the necessary Stripe webhook events. In one of the discussions, a user had a similar issue where the
invoice.paid
event was not being triggered because the webhook was not listening for that event. You can test if your webhook is listening for the invoice.paid
event by running the command stripe trigger invoice.paid
in another terminal window. source (https://discord.com/channels/686873244791210014/1214979650803998781)
2. User Update Function: Another issue could be with the user update function. In one of the discussions, a user was advised to define the user update function to a variable and log that to the console. This could help you debug if the function is working as expected. source (https://discord.com/channels/686873244791210014/1214979650803998781)
3. UserStripeId: Ensure that the userStripeId
is correctly defined. In one of the discussions, a user had an issue where the userStripeId
was not defined, which was causing issues with updating the user's properties. source (https://discord.com/channels/686873244791210014/1214979650803998781)
4. Stripe API Version: Check the version of the Stripe API you are using. In one of the discussions, a user was using a newer version of the API which was causing issues. source (https://discord.com/channels/686873244791210014/1214979650803998781)
If you're still having issues, it might be helpful to add more console.log
lines to your code to help debug the issue. source (https://discord.com/channels/686873244791210014/1200182362449907813)
Remember, these are just possible issues based on the information provided in the knowledge sources. The actual issue could be different based on your specific implementation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Ertan Köse, 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?Okey the issue was that i did not create a webhook for my production server, i also changed the secret to the one displayed by the webhook.
Hey @Ertan Köse Thanks for sharing the solution!
I am having this same issue, did you laucnh via fly.io?
@Ertan Köse you are not the only one that missed that! I do believe we mention in docs about what needs to be done get webhook working in the production but people seem to miss it. Do you have any idea why is that so, what could we improve?
FYI @Vinny (@Wasp)
you mean the Signing Secret?
This is all outligned here in https://docs.opensaas.sh/guides/deploying/#setting-up-your-stripe-webhook, specifically the "Creating Your Production Wehbook" section.
Is there something that could be explained more clearly?
OpenSaaS.sh
Deploying
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
@kapa.ai my subscription status on my production setup only updates the database and front end if I cancel the user subscription. WHen the user purchases a plan, there is no update to the database. ALl webhooks are working fine from what I can see in logs. What could be the issue
Let me check the knowledge base for you. One moment! :books:
----------------------
Based on the information provided in the knowledge sources, there could be a few reasons why the user's subscription status is not updating after a successful Stripe transaction.
1. Webhook Events: Ensure that your application is correctly listening for and handling the necessary Stripe webhook events. In one of the discussions, a user had a similar issue where the
invoice.paid
event was not being triggered because the webhook was not listening for that event. You can test if your webhook is listening for the invoice.paid
event by running the command stripe trigger invoice.paid
in another terminal window. source (https://discord.com/channels/686873244791210014/1214979650803998781)
2. User Update Function: Another issue could be with the user update function. In one of the discussions, a user was advised to define the user update function to a variable and log that to the console. This could help you debug if the function is working as expected. source (https://discord.com/channels/686873244791210014/1214979650803998781)
3. UserStripeId: Ensure that the userStripeId
is correctly defined. In one of the discussions, a user had an issue where the userStripeId
was not defined, which was causing issues with updating the user's properties. source (https://discord.com/channels/686873244791210014/1214979650803998781)
4. Stripe API Version: Check the version of the Stripe API you are using. In one of the discussions, a user was using a newer version of the API which was causing issues. source (https://discord.com/channels/686873244791210014/1214979650803998781)
If you're still having issues, it might be helpful to add more console.log
lines to your code to help debug the issue. source (https://discord.com/channels/686873244791210014/1200182362449907813)
Remember, these are just possible issues based on the information provided in the knowledge sources. The actual issue could be different based on your specific implementation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sherm, 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?Sorry i have not looked at wasp in a minute, the ordering of sections under deployment mislead my brain to think i was done as i was completely naive to webhooks at the time, eg. after reading "Deploying to fly.io" "Deploying Manually / to Other Providers" and etc. comes up. Perhaps a general solution could be a preamble providing an overview of steps to take?
Also i had a similar problem with server and client environment variables, the section "Setting Environment Variables" is hard to read(more precisely the command example) and could very explicitly state environment variables have to be passed manually. Btw thanks for wasp 🙏🏾 provides motivation for learning about monads.
Thanks @Ertan Köse , captured this feedback here https://github.com/wasp-lang/open-saas/issues/275 !
Ha glad to hear about the monads :D! They are quite a unique concep, and now when I look back, I think I really got to undersatnd purely through usage -> after some usage they just start making sense, even if one doesn't know how to super easily describe them. Good luck with learning, it will be fun!