You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Stripe账单门户中周期末计划降级未触发问题求助

Stripe账单门户中周期末计划降级未触发问题求助

大家好,我现在在配置Stripe账单门户,想实现订阅更新时的周期末计划降级功能,但遇到了一个棘手的问题:当我尝试切换到更低档位、计费周期更短的套餐时,降级操作并没有按照预期在当前计费周期结束时生效,而是系统立刻就要发起扣费。我自认为配置是正确的,想请大家帮忙排查下问题所在。

根据Stripe 2024年10月的官方文档说明:

"现在你可以配置客户门户,让订阅降级在计费周期结束时生效,而不是立即生效。"

我已经确认自己的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' } // 期望让降级在周期末生效,但未生效
                ]
            }
        },
        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`
});

附上当前订阅的状态截图:
Current Subscription

以及切换后的订阅提示截图(可以看到明明是切换到月度套餐,系统却仍要立即扣费):
New subscription

备注:内容来源于stack exchange,提问作者Mnai

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 13:33:01