#sergx_docs

1 messages ¡ Page 1 of 1 (latest)

placid steppeBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222112492117819472

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

heavy meadowBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

hexed raft
#

Which part of what you describe are you struggling with? What is not working as you expect?

mortal willow
#

So I would like to know how to implement this logic on my SaaS:

Imagine the user update their subscription, and stop paying for the add-on.

How can I determine he is not paying for the add-on?

hexed raft
#

Well generally when you make a change to a subscription to add/remove items there is a new invoice generated to reflect that change. So you'd listen for related events (invoice.created, customer.subscription.updated) which would reflect the change

mortal willow
#

I understand. So the logic would be, if the subscription is active and exists a subscription with the price_id (of the add-on), user can have access.

If not, he cannot access to the feature, right?

#

exists a subscription_item*

hexed raft
#

Sounds logical yes. You can infer their 'access' from the items on the subscription and the status

mortal willow
#

Perfect got it! Another doubt I have, is the interval of items have to be the same?

It doesn't make sense a user pays monthly for the plan basic, and yearly for the add-on right?

hexed raft
#

Yes, a single subscription can only have items with the same interval