Hey. I create an app where every user get tokens if they subscribe. I can schedule an API workflow which add tokens every month to every user. But if the user cancel their subscription i want to cancel the api workflow. I try this with the stripe webhook but i didn’t work. Everything is working good because the status is changed and the other data too. But the workflow is not cancelled. Can somebody help me please?
I got a question. Out of curiosity, are the unused credits being added to the upcoming month’s credits? Or is it fixed credits per month?
Also, your problem is you’re using “Current user” in a webhook. There is no other information about Bubble inside a webhook, you have to search it just like you searched Payments.
You can search the user in 2 ways,
-Since you have payments already searched, you can do result of step 1’s creator.
-You can also search for a User with Stripe customer ID of Request Data Object Customer.
So, for future reference, never use current user in a webhook. It does tend to work for schedule API workflow, but I’d try to avoid it too. Always search and use your previous searches to your advantage, such as “Result of step 1’s Make changes to payment’s created by” .
Cheers
Back to my question about how you handle credits/tokens. I’m asking because I have a similar system on my platform, but I’m not giving tokens, I’m keeping track of how many was “used”, and disabling certain functionality if they reach a certain limit specified in an (Option set). I’m curious to hear your approach.
Also, be sure to secure your Stripe webhook. Checkout @georgecollier 's post
Thank you! It’s help me a lot. For your question I don’t add the credits to the next month. It’s fixed credits per month.
This topic was automatically closed after 70 days. New replies are no longer allowed.