#Ivan Araujo

1 messages · Page 1 of 1 (latest)

timber kindleBOT
karmic hawk
#

I'm having problemas with the current_period_end after a status past_due in any subscription

#

Hello, what problems are you having with the current_period_end here?

karmic hawk
#

@elder compass are you still looking for help here?

elder compass
#

Ei, estou sim

#

Yes, I am

karmic hawk
#

What problems are you having with the current_period_end here?

elder compass
#

The current_period_end is been setting a month forward.

#

Like, the start data of the subscription is 01/11/2022, and at the data of 01/12/2022 stripe tried to charge a for a new month os use of the subscription.

#

The credit card of customer have no funds, so, the status os subscription gone to past_due.... and after all the trying of charges (1 week), the status changed to Canceled.

#

the problem is, the current_period_end must be setted to 01/12/2022, but was setted to 01/01/2023

#

every customer that I have, on trying to charge a subscription for a new month of use, in case of not success on the charges, is "guiving" to the customer a month free so use the system.

karmic hawk
#

I think you are seeing this because current_period_end refers to when your subscription will next try to renew, it doesn't take in to account whether the user has currently paid.

#

You have a couple of options for cancelling these subscriptions sooner. Can you tell me how much sooner you want these subscriptions to be cancelled here?

elder compass
#

the subscription is already cancelled. so, in that case, the current_period_end should be setted as 01/12/2022

#

after 4 trys, the subscription was cancelled. so , the reight to use is not avalible anymore

karmic hawk
elder compass
#

no, i cant use the cancelled, because the subscription was cancelled 1 week after

karmic hawk
#

So is the issue that your integration doesn't know when to cut off access to these users?

elder compass
#

I did that

karmic hawk
#

Also do you have the ID of this subscription (sub_123)? It could be helpful for me to look in to this

elder compass
karmic hawk
#

So it sounds like you are seeing expected behavior for those settings.

#

I am still a bit unclear on your underlying current_period_end, is that the field that you are checking to see how long a user should have access? Or how long they did have access for in the past?

elder compass
#

yes, i use to see that

#

see how long a user should have access

#

my only problem is when the status is setted as past_due, and after that, cancelled.

#

All the other status, there is no changed in the current_period_end

#

you asked for the id of the subscription.. here are some exemples:

#

all are cancelled after a past_due status

karmic hawk
#

That is because current_period_end is for something else (tracking the next renewal), it doesn't reflect when the subscription will end.

elder compass
#

ok, i undesrtand, but, a subscription cancelled has no (tracking the next renewal)

karmic hawk
#

So when you finally get that cancelled status after a week, can you just cancel the subscription in your system then? Or do you want to cut off access before or after then

elder compass
#

when i get cancelled, the access is cuted

#

or shoul be cuted, but as the current_period_end is been setting foward, the client keep using the system for 1 month more.

#

without paying.....

#

that is the problem

karmic hawk
#

Is there a reason you are using current_period_end instead of cancelled_at here? I think cancelled_at lines up more closely with what you are trying to do here

elder compass
#

i have both in my database.

#

we use that way because the customer can cancel a subscription em still have access to the system for the period he paid for.

ripe grail
#

Hello! I'm taking over and catching up...

elder compass
#

exemple: custumer made a subscription at 20/12/2022, but canceled at 26/12/2022. the subscription is cancelled, and will not try to charge him at 20/01/2022. But. I can not cut his access to the system, because he has the right to use until 20/01/2023

#

so i store the canceled_at, so know that is cancelled, but is still valid until january

#

and I know that because the current_period_end

ripe grail
#

It sounds like you're using the Subscription's current_period_end to determine when your customer has access, is that correct?

elder compass
#

yes

#

and works most of times

#

as the exemple i show

#

but do not work after a past_due status

#

the problem is the past_due status....

#

tha changes the date

ripe grail
#

The problem, really, is that you're using current_period_end on the Subscription for this. current_period_end defines the end of the period the customer has been Invoiced for, not the period they've paid for. You need to look at the status of the Subscription's latest_invoice to determine if that period of time has been paid for or not.

elder compass
#

If a subscription is cancelled, why the current period end is so far way?

#

and, why this happens only stripes cancel?

ripe grail
#

Because they've been invoiced for that period.

elder compass
#

because if I cancel trow API, it not happend!

ripe grail
#

Again, current_period_end defines the end of the period they've been invoiced for, not the end of the period they have paid for.