#tayz_api

1 messages ¡ Page 1 of 1 (latest)

thorny scarabBOT
#

👋 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/1217443395857809510

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

steady lagoonBOT
distant fable
#

Hi, let me help you with this.

timid frigate
#

for further details, I paused a subscription for a user for a year, and then 2 weeks later, it still shows it as active

I tried reading the docs but it didn't give much information on adjusting the active / inactive

#

Hi Vanya, thanks

distant fable
#

What behavior do you want to achieve exactly?

timid frigate
#

actually sorry, I should clarify

#

I want to know when the customer.subscription.paused would be sent, but based on my knowledge if its marked as Active still, then it will never get sent?

#

basically I want to monitor when a subscription gets paused after the current invoice has been paid for

so if the user paid for this month but then paused for 1 year, at the end of this month, I want to be able to mointor that

distant fable
#

Maybe you want to just cancel the Subscription instead? You can always "resume" it by creating a new one.

timid frigate
#

hmm thats an option -- but then I'd have to set a cron job on my end right?

distant fable
#

Why?

timid frigate
#

for the resuming creating a new one part

distant fable
#

Wouldn't the customer request to resume it manually? Or you want to pause for a specific duration?

timid frigate
#

yes for the later, we had a frontend where the user picks how long to pause

distant fable
#

Oh, yeah, that's one difference that you can specify pause_collection.resumes_at.

#

However, the name pause_collection suggests it only pauses the payment collection, and not the Subscription itself. That's why the status is still active. If you also want to pause the Subscription, it's better to cancel it and run a cron job to re-create it later.
Alternatively, you can check for the presence of pause_collection on the Subscription object as well as status: active, to determine if you should provide your services: https://docs.stripe.com/api/subscriptions/object#subscription_object-pause_collection

timid frigate
#

ah I see, thank you, I'll take a look

#

I have resumes_at set but from this discussion I realized I can track cancelling on my backend manually and then when resumes_at triggers, it would send an invoice.paid again right and that should give them their plan again on my backend