#macarouns_best-practices

1 messages · Page 1 of 1 (latest)

severe jewelBOT
#

đź‘‹ Welcome to your new thread!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

đź”— 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/1212370922485452800

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

⏲️ 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. Thank you for your patience!

turbid orioleBOT
clear dagger
cerulean kraken
#

Hi, I think my message might have been cut-off. I can set the cancellation date just fine.

The problem comes when cancelling a subscription. I want to end it on a set date and either take no further payments or one more full payment.

No matter when I set the date, it attempts to pro-rata the amount.

I have attempted to update the Subscription object by passing the parameter “proration_behavior” with a value of “none”. This doesn’t seem to do anything.

Likewise, even if I switch off proration through the GUI, there seems to be no cancellation date I can set for the subscription that will charge the full price and not a pro-rata.

clear dagger
#

Ah I see

#

in this case you need to implement a cron on your Side, and call the cancel API

#

With proration_behavior: none

#

at the desired date

cerulean kraken
#

That is where I have got stuck, I have been trying that but it doesn't seem to affect the proration

#

$stripe->subscriptions->update($subs->data[0]->id, ['cancel_at' => $d->getTimestamp(), 'proration_behavior' => 'none']);

#

When I do this, the cancel_at date goes through fine, but the proration doesn't change

#

It wouldn't be anuthing to do with the version of the API I am using would it?

clear dagger
#

No.

cerulean kraken
#

Ah okay

clear dagger
#

and don't forget to pass the proration_behavior: none

cerulean kraken
#

I see what you mean now about using a cron. So it doesn't take a future date to cancel, it would just cancel immediately?

clear dagger
#

yes

cerulean kraken
#

Great thanks. So if say the subscription payment would normally come out on the 1st of the month, if I cancelled it on the day before, then that payment then wouldn't take?

clear dagger
#

Appologies for my late reply

#

if I cancelled it on the day before, then that payment then wouldn't take?
Unless the invoice of the next period wasn't generated, there'll be no payment yes

cerulean kraken
#

Brilliant, thank you for the help, it is much appreciated!