#Suren.subscription-active
1 messages · Page 1 of 1 (latest)
well, for example, there is an option when I update the subscription plan and do not pay, then the status becomes past_due
but in fact he has an active old subscription
Yep, that is expected. You can configure that behaviour with Stripe
Not sure I understand
for example i have a subscription for month plan
I am switching to a new years subscription plan
and then the subscription status becomes past_due
how to handle it?
Yep, this is expected if payment fails: https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
What part do you need to handle?Payments would be re-attempted as per your retry schedule
the problem is that on webhooke I can not check past_due this and because the subscription plan it was update
or is it for the fact that the end of the subscription period was not charged
As I said, it'll be past_due as payment for the invoice generated from the subscription update failed
Can you share the invoice ID?
and then what should be done if the subscription plan is going to downgrade
and what should be done when the subscription has simply not been paid
How can I find out
i just need to understand past_due after renewing my subscription plan or after not being paid
Hey there 👋 stepping in and getting caught up here.
hi
So I'm a little confused by what you're looking for. Would you mind taking a moment to try rephrasing your question?
status past due will be set when the subscription plan tries to renew from month to year and is not paid
and even then when just at the end of the period, the end of the subscription does not learn to pay
I don’t understand how to define it
To clarify, are we talking about the concept of a subscription being past due, or are you referring to our past_due status that subscriptions can go into?
https://stripe.com/docs/api/subscriptions/object#subscription_object-status
let's first
how to return past due to active if the user tried to upgrade to a new plan and did not pay, I just need to return to the old plan
When you're moving from monthly to yearly, are you creating a new subscription or updating the existing one?
yes
Which one?
So it sounds like what you're looking for is:
- you update the subscription
- if the payments for that fail the subscription goes into a
past_duestate (depending on your account settings) - Listen for
customer.subscription.updatedevents, and if the subscription has gone into apast_duestate then: - Update the subscription again to revert the update made in step 1
yes I got it
now another question
I have a monthly subscription and at the end of the month I can't make a payment and there is no money for the balance
and again go to the past_due status
then how am I going to distinguish all this?
Good question, and there are several possible paths.
You could keep track of the subscriptions that you upgrade, and then if a sub goes past_due reference against your list of upgraded subscriptions to see if it's one of them.
You could also add metadata to the subscription when you update it.
yes, but the fact is that if I update the metadata when the subscription is renewed, then this metadata remains
But you can update the value associated with the provided key in the metadata field. So you could have a key like upgrading and set to in_progress initially, and then once the payment is successful change it to completed.
We don't have a pre-built way to track this and you'll need to develop an approach to do so.