#nihilist_subscription-events

1 messages ยท Page 1 of 1 (latest)

acoustic irisBOT
#

๐Ÿ‘‹ 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. Thank you for your patience!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

๐Ÿ”— 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/1214598606192119858

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

strange glacierBOT
modest musk
#

Hi ๐Ÿ‘‹ you will need to adjust the billing_cycle_anchor for that. When you were testing this approach, did you try setting proration_behavior to none when updating the Subscription and setting the billing_cycle_anchor?

shadow breach
#

yes, i set proration_behavior to none and it charges the user again for the full price of the period

#

for more information i update the subscription using these params {billing_cycle_anchor:'now', proration_behavior:'none'}, i tried entering an exact date instead of 'now' but i dont think Stripe support that

modest musk
shadow breach
#

yeah i guess the best option here is to update subscription with {trial_end: (2025-03-06).to_unix, proration_behavior: 'none'}. So how to update the subscription to trial only when the subscription was in past_due state when the invoice is paid? I can retrieve subscription from invoice object from invoice.paid event but i think the subscription.status might be already changed to active ?

modest musk
#

You can watch for customer.subscription.updated Events, where you see the status changing from past_due to active, and then trigger the billing cycle anchor update from that.

shadow breach
#

This makes sense, thanks for the answer. But out of curiosity which event is triggered first when automatic renewal is successful: invoice.paid or customer.subscription.updated

modest musk
#

It doesn't matter, you should never rely on receiving Events in a specific order, they could get mixed up as they move from our system to yours.

strange glacierBOT