Gemäß die Stripe-Dokumentation vom Oktober 2024:
„Sie können das Kundenportal jetzt so konfigurieren, dass Abonnement-Downgrades am Ende des Abrechnungszyklus und nicht sofort erfolgen.“ "
Ich habe dafür gesorgt, dass auch mein Stripe SDK auf die neueste Version aktualisiert ist.
Code: Select all
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`
});

Neues Abonnement aktualisiert auf, offensichtlich mit einem verkürzten Intervall, da es sich um ein monatliches Abonnement handelt, aber ich versuche immer noch, mir sofort die Kosten zu berechnen
