mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-12-05 07:33:41 +00:00
fix(billing): only adopt live subscriptions from created events
This commit is contained in:
@@ -140,7 +140,11 @@ export default async function handler(
|
||||
const subscription = await stripe.subscriptions.retrieve(
|
||||
newSubscription.id,
|
||||
);
|
||||
if (hasEnded(subscription)) {
|
||||
// A late event of an older subscription must not replace the current one.
|
||||
if (
|
||||
subscription.status !== "active" &&
|
||||
subscription.status !== "trialing"
|
||||
) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user