Согласно документация Stripe от октября 2024 г.:
"Теперь вы можете настроить клиентский портал так, чтобы понижение подписки происходило в конце платежного цикла, а не сразу. "
Я также убедился, что мой Stripe SDK обновлен до последней версии.
Код: Выделить всё
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2024-12-18.acacia'
});
const configuration = await stripe.billingPortal.configurations.create({
features: {
payment_method_update: { enabled: true },
subscription_cancel: { enabled: true, mode: 'at_period_end' },
subscription_update: {
enabled: true,
proration_behavior: 'none',
default_allowed_updates: ['price'],
products: subscriptionUpdateProducts,
schedule_at_period_end: {
conditions: [
{ type: 'shortening_interval' } // Schedule downgrades at period end (Not working)
]
}
},
invoice_history: { enabled: true }
},
business_profile: {
headline: 'Manage your subscription'
}
});
const session = await stripe.billingPortal.sessions.create({
customer: customerId,
configuration: configuration.id,
return_url: `${process.env.FRONTEND_URL}/app/price/price1`
});

Новая подписка обновлена, явно с сокращенным интервалом, поскольку это ежемесячная подписка, но все равно пытается немедленно списать с меня плату

Подробнее здесь: https://stackoverflow.com/questions/793 ... ing-portal