#Suren.subscription-active

1 messages · Page 1 of 1 (latest)

candid wagon
#

Hey! What do you mean by 'still active'?

onyx lark
#

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

candid wagon
candid wagon
onyx lark
#

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?

candid wagon
candid wagon
onyx lark
#

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

candid wagon
#

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?

onyx lark
#

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

dusk python
#

Hey there 👋 stepping in and getting caught up here.

onyx lark
#

hi

dusk python
#

So I'm a little confused by what you're looking for. Would you mind taking a moment to try rephrasing your question?

onyx lark
#

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

dusk python
onyx lark
#

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

dusk python
#

When you're moving from monthly to yearly, are you creating a new subscription or updating the existing one?

onyx lark
#

yes

dusk python
#

Which one?

onyx lark
#

if i update i don't need past_due to remain in case of unsuccessful payment

#

updating

dusk python
#

So it sounds like what you're looking for is:

  1. you update the subscription
  2. if the payments for that fail the subscription goes into a past_due state (depending on your account settings)
  3. Listen for customer.subscription.updated events, and if the subscription has gone into a past_due state then:
  4. Update the subscription again to revert the update made in step 1
onyx lark
#

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?

dusk python
#

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.

onyx lark
#

yes, but the fact is that if I update the metadata when the subscription is renewed, then this metadata remains

dusk python
#

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.