#Ivan Araujo
1 messages · Page 1 of 1 (latest)
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?
@elder compass are you still looking for help here?
What problems are you having with the current_period_end here?
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.
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?
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
I don't think that that is how that field is supposed to work. You might want to check out the cancelled_at property, that field should say when the subscription ended https://stripe.com/docs/api/subscriptions/object#subscription_object-canceled_at
no, i cant use the cancelled, because the subscription was cancelled 1 week after
This is something that you can configure in your dashboard settings in the "Manage failed payments" section https://dashboard.stripe.com/settings/billing/automatic
So is the issue that your integration doesn't know when to cut off access to these users?
I did that
Also do you have the ID of this subscription (sub_123)? It could be helpful for me to look in to this
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?
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
That is because current_period_end is for something else (tracking the next renewal), it doesn't reflect when the subscription will end.
ok, i undesrtand, but, a subscription cancelled has no (tracking the next renewal)
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
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
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
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.
Hello! I'm taking over and catching up...
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
It sounds like you're using the Subscription's current_period_end to determine when your customer has access, is that correct?
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
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.
If a subscription is cancelled, why the current period end is so far way?
and, why this happens only stripes cancel?
Because they've been invoiced for that period.
because if I cancel trow API, it not happend!
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.