#brettski-subscription-webhook
1 messages · Page 1 of 1 (latest)
Hello again Koopajah
@open viper have you looked at https://stripe.com/docs/billing/testing ?
it covers many cases. We don't support "fast forwarding time" yet (working on it!) but you basically simulate a renewal by having a subscription's period end soon either via trial_end or billing_cycle_anchor set to a few minutes in the future
and then you wait for renewal
Ah, so read more of the manual Brett 🤦♂️
haha I share that link so often I have it bookmarked
we are working on a Test mode feature that lets you "fast forward time" which would let you see renewals the year after and the year after so that will make discoverability a lot easier
Okay, I just read the definition of the billing cycle anchor. I can update this to force a new billing cycle no now
Does, current_period_end have any affect on this? Can it be updated, or simply focus on the billing_cycle_anchor?
you can't touch current_period_end, you'll see in https://stripe.com/docs/api/subscriptions/update it's not a parameter. So only billing_cycle_anchor
but you don't want to set it to now really, that's the wrong approach
you want to create a subscription with billing_cycle_anchor set to a timestamp a few minutes in the future. And then you wait for the subscription to renew
Yeah, you said a few minutes in the future
setting bca on update only supports the value now and it changes the billing cycle synchronously and so it doesn't mirror a normal renewal behaviour
I see, so a new subscription with a short billing_cycle_anchor. The term of the subscription, I assume, is irrelevant then
yep
I am using the cli to create a subscription, what is the items it asks for?
can I say "did you read docs?" :p
Subscriptions can have multiple prices, and so it comes in items which is an array of all the Price you associate with a subscription
https://stripe.com/docs/api/subscriptions/create#create_subscription-items (and then mentioned on every doc about Billing since that's how you create a Subscription)
hahaha
How many minutes in the future do you recommend?
happy to help 🙂
What does this mean where invoices take an hour to finalize?
It seems the invoice wont get auto-paid until after this time
yep that's how billing works https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
new invoices are automatically created but not paid immediately
you can explicitly finalize and/or pay those invoices via the API