diff --git a/apps/dokploy/pages/api/stripe/webhook.ts b/apps/dokploy/pages/api/stripe/webhook.ts index f1a33507b..f950eb344 100644 --- a/apps/dokploy/pages/api/stripe/webhook.ts +++ b/apps/dokploy/pages/api/stripe/webhook.ts @@ -15,7 +15,6 @@ const STARTUP_BASE_PRICE_IDS = [ const STARTUP_SERVERS_INCLUDED = 3; -/** Total de servidores: ítem "Startup base" (qty 1) = 3 servidores; el resto = quantity por ítem. */ function getSubscriptionServersQuantity( items: Stripe.SubscriptionItem[], ): number { diff --git a/apps/dokploy/server/api/routers/stripe.ts b/apps/dokploy/server/api/routers/stripe.ts index b69716951..c910b1d58 100644 --- a/apps/dokploy/server/api/routers/stripe.ts +++ b/apps/dokploy/server/api/routers/stripe.ts @@ -65,7 +65,6 @@ export const stripeRouter = createTRPCRouter({ expand: ["data.items.data.price"], }); - // Detectar plan actual para mostrar upgrade a usuarios legacy type CurrentPlan = "legacy" | "hobby" | "startup"; let currentPlan: CurrentPlan = "legacy"; let isAnnualCurrent = false; @@ -96,7 +95,6 @@ export const stripeRouter = createTRPCRouter({ | Stripe.Price | undefined; isAnnualCurrent = firstPrice?.recurring?.interval === "year"; - // Precio actual total del intervalo (mes o año) desde Stripe const totalCents = activeSub.items.data.reduce((sum, item) => { const price = item.price as Stripe.Price; const amount = price.unit_amount ?? 0; @@ -202,7 +200,6 @@ export const stripeRouter = createTRPCRouter({ } }), - /** Cambiar de plan o cantidad de servidores (legacy→Hobby/Startup, o Hobby/Startup→cambiar tier/cantidad). Portal deshabilitado para esto; se hace desde la app. */ upgradeSubscription: adminProcedure .input( z diff --git a/apps/dokploy/server/utils/stripe.ts b/apps/dokploy/server/utils/stripe.ts index 23e9a6b8f..078885a98 100644 --- a/apps/dokploy/server/utils/stripe.ts +++ b/apps/dokploy/server/utils/stripe.ts @@ -3,19 +3,16 @@ export const WEBSITE_URL = ? "http://localhost:3000" : process.env.SITE_URL; -// Legacy: precios/productos actuales. No borrar; usuarios existentes siguen con estos. export const BASE_PRICE_MONTHLY_ID = process.env.BASE_PRICE_MONTHLY_ID!; export const BASE_ANNUAL_MONTHLY_ID = process.env.BASE_ANNUAL_MONTHLY_ID!; export const PRODUCT_MONTHLY_ID = process.env.PRODUCT_MONTHLY_ID!; export const PRODUCT_ANNUAL_ID = process.env.PRODUCT_ANNUAL_ID!; -/** Price IDs legacy: suscripciones con estos IDs no se migran y siguen con los mismos beneficios. */ export const LEGACY_PRICE_IDS = [ process.env.BASE_PRICE_MONTHLY_ID, process.env.BASE_ANNUAL_MONTHLY_ID, ].filter(Boolean) as string[]; -// Nuevos planes (opcionales hasta que crees los productos en Stripe) export const HOBBY_PRODUCT_ID = process.env.HOBBY_PRODUCT_ID ?? ""; export const HOBBY_PRICE_MONTHLY_ID = process.env.HOBBY_PRICE_MONTHLY_ID ?? ""; export const HOBBY_PRICE_ANNUAL_ID = process.env.HOBBY_PRICE_ANNUAL_ID ?? ""; @@ -28,7 +25,6 @@ export const STARTUP_BASE_PRICE_ANNUAL_ID = export type BillingTier = "legacy" | "hobby" | "startup"; -/** Line items para Stripe Checkout según tier y cantidad de servidores. */ export const getStripeItems = ( tier: BillingTier, serverQuantity: number,