can Stripe's period_end be overwritten?
Stripe plugin and Sveltekit question. I am building an app where a free 7-day trial triggers on first log in using the better-auth stripe plugin. the period_start and period_end in the schema get correctly set on first login. When the user goes to Stripe.com to complete checkout, the period_start and period_end resets with a new timestamp so this could turn the 7-day free trial into a 14-day free trial if they complete the stripe checkout at the end of the first 7 days. I set trial_end to match the first login timestamp and I'm trying to configure period_end to trial_end instead after the redirect but it won't stick. Is there a hook or even that fires before better-auth updates the subscription? I've tried onEvent hook, onSubscriptionUpdate hook and before hooks and out of ideas.
Solution:Jump to solution
why not just only rely on
trail_end
for the trail period and if have have non-trail subscription, you'll start usnig period start and end as a flag instead.2 Replies