#ali-raza_cancel-subscription-proration

1 messages ยท Page 1 of 1 (latest)

rich ravineBOT
#

๐Ÿ‘‹ 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/1292828204318457866

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

trim wyvern
#

hi there!

#

what's your question?

grim plover
#

hi @trim wyvern sub_1P0lp9Hswjr8bdMVlmNxFpoc
with this subscription can you check why they charge less amount in last invoice

trim wyvern
#

thanks! give me a few minutes to look into this.

grim plover
#

please

rich ravineBOT
grim plover
#

anyone looking?

small axle
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needed to step away. The last Invoice was prorated because the Subscription was scheduled to cancel before the end of it's billing period. Since the Subscription ended early the amount charged for the last billing period was prorated to account for that.

grim plover
#

but there is difference of hour we done it same day

#

@small axle

small axle
#

That's still a difference

#

You need to be second-precise with when you set cancel_at if you want to avoid prorations

grim plover
#

$keys=env('STRIPE_SECRET');
$stripe = new \Stripe\StripeClient($this->DecKeys());
$subscription=$stripe->subscriptions->update(
$payment->subscription_id,
['cancel_at' => $stop_at]
);
this is my API that i am using

#

what is second-precise?

small axle
#

The timestamp you provide for the cancel_at parameter needs to be the same as the end time of the billing period, and those need to match down to the second (not to the day).

#

Are you scheduling these Subscriptions to cancel while they're in their final billing period?

rich ravineBOT
#

ali-raza_cancel-subscription-proration

grim plover
#

we have use case
for example if today i am going to cancel subscription so we are adding 1 month notice
so this full month and next full month cancel date according to today is 30 November 2024

small axle
#

What time on Nov 30th you set it to cancel is important

#

You're providing a second-precise timestamp, not just a date.

grim plover
#

so we need to prive date + time

small axle
#

Yes. You're already providing a timestamp, you just need to better align it to when the billing period will naturally end.

grim plover
#

so if subscription star time is 1st October 2024 : 13:50 then end date shoud 1st November 2024 : 13:50

small axle
#

Correct, but you need to go down to the second, those times seem to only go down to the minute.

grim plover
#

ohh seconds as well

#

right

#

thanks for expalingn