feat(billing): configurable plans from the backoffice and MP payment notifications
Plans: - Plan limits and Pro prices per country live in the database (plan_configs, plan_prices, seeded with the previous constants) and are read through PlanCatalog (30 s cache, defaults as fallback). - /admin/plans edits limits (with the count of accounts that would become read-only) and prices, optionally pushing the new price to live subscriptions from their next charge (MP preapproval amount, Stripe item without proration) via the ApplyPriceChanges job, with an email and a notice on /billing. - GET /billing/plans feeds the onboarding and the billing screen. Mercado Pago: - The Pro checkout returns through GET /billing/return on API_PUBLIC_URL, since MP refuses a back_url on localhost. - The OAuth callback bounces from the tunnel to BETTER_AUTH_URL to find the session, requires the session to own the state, and redirects instead of answering JSON on unexpected errors. - Checkout Pro links skip auto_return off public HTTPS and carry a notification_url to POST /payments/webhooks/mp/:paymentId, which confirms the payment with the owner's token (same rule as the polling job, which stays as fallback). The search now prefers the approved attempt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,5 +86,49 @@
|
||||
"PENDING": "Connecting",
|
||||
"DISCONNECTED": "Disconnected",
|
||||
"NONE": "Not connected"
|
||||
},
|
||||
"plans": {
|
||||
"title": "Plans",
|
||||
"subtitle": "Free and Pro limits, and the Pro price in each country.",
|
||||
"loading": "Loading plans",
|
||||
"loadError": "We couldn't load the plans.",
|
||||
"saveError": "We couldn't save the change.",
|
||||
"edit": "Edit",
|
||||
"save": "Save",
|
||||
"cancel": "Cancel",
|
||||
"limits": {
|
||||
"title": "Limits",
|
||||
"hint": "They apply right away to every account on the plan. An account left above them becomes read only.",
|
||||
"maxGroups": "Groups",
|
||||
"maxAttendees": "Active students",
|
||||
"unlimited": "No limit",
|
||||
"unlimitedFor": "{{label}} with no limit",
|
||||
"mpCharges": "Mercado Pago charges",
|
||||
"whatsappAutomations": "Automatic WhatsApp messages",
|
||||
"impact_one": "{{count}} account already exceeds these limits and will become read only when you save.",
|
||||
"impact_other": "{{count}} accounts already exceed these limits and will become read only when you save.",
|
||||
"saved": "Limits saved."
|
||||
},
|
||||
"prices": {
|
||||
"title": "Pro price",
|
||||
"hint": "New subscriptions take the price right away. Existing ones keep theirs unless you choose to apply it.",
|
||||
"live_one": "{{count}} active subscription",
|
||||
"live_other": "{{count}} active subscriptions",
|
||||
"atOtherPrice_one": "{{count}} at another price",
|
||||
"atOtherPrice_other": "{{count}} at another price",
|
||||
"updatedAt": "changed on {{date}}",
|
||||
"pending_one": "{{count}} change in progress",
|
||||
"pending_other": "{{count}} changes in progress",
|
||||
"failed_one": "{{count}} change failed",
|
||||
"failed_other": "{{count}} changes failed",
|
||||
"editFor": "Edit the price for {{country}}",
|
||||
"amount": "Monthly price ({{currency}})",
|
||||
"applyToExisting": "Apply to existing subscriptions",
|
||||
"applyHint_one": "{{count}} subscription moves to the new price from its next charge. We'll email them.",
|
||||
"applyHint_other": "{{count}} subscriptions move to the new price from their next charge. We'll email them.",
|
||||
"saved": "Price saved.",
|
||||
"savedQueued_one": "Price saved. {{count}} subscription moves to the new price from its next charge.",
|
||||
"savedQueued_other": "Price saved. {{count}} subscriptions move to the new price from their next charge."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"paidThrough": "Paid through {{date}}.",
|
||||
"notEnforced": "For now, every feature is enabled for every account.",
|
||||
"groups": "Groups",
|
||||
"students": "Active students"
|
||||
"students": "Active students",
|
||||
"nextPrice": "New price from your next charge: {{amount}} a month."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Send at least one attendance record"
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Enter a price greater than zero"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,5 +86,49 @@
|
||||
"PENDING": "Conectando",
|
||||
"DISCONNECTED": "Desconectado",
|
||||
"NONE": "Sin conectar"
|
||||
},
|
||||
"plans": {
|
||||
"title": "Planes",
|
||||
"subtitle": "Límites de Free y Pro, y precio de Pro en cada país.",
|
||||
"loading": "Cargando planes",
|
||||
"loadError": "No pudimos cargar los planes.",
|
||||
"saveError": "No pudimos guardar el cambio.",
|
||||
"edit": "Editar",
|
||||
"save": "Guardar",
|
||||
"cancel": "Cancelar",
|
||||
"limits": {
|
||||
"title": "Límites",
|
||||
"hint": "Se aplican al instante a todas las cuentas del plan. Una cuenta que quede por encima pasa a solo lectura.",
|
||||
"maxGroups": "Grupos",
|
||||
"maxAttendees": "Alumnos activos",
|
||||
"unlimited": "Sin límite",
|
||||
"unlimitedFor": "{{label}} sin límite",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsappAutomations": "Mensajes automáticos por WhatsApp",
|
||||
"impact_one": "{{count}} cuenta ya supera estos límites y quedará en solo lectura al guardar.",
|
||||
"impact_other": "{{count}} cuentas ya superan estos límites y quedarán en solo lectura al guardar.",
|
||||
"saved": "Límites guardados."
|
||||
},
|
||||
"prices": {
|
||||
"title": "Precio de Pro",
|
||||
"hint": "Las suscripciones nuevas toman el precio al instante. Las existentes conservan el suyo, salvo que elijas aplicarlo.",
|
||||
"live_one": "{{count}} suscripción activa",
|
||||
"live_other": "{{count}} suscripciones activas",
|
||||
"atOtherPrice_one": "{{count}} con otro precio",
|
||||
"atOtherPrice_other": "{{count}} con otro precio",
|
||||
"updatedAt": "cambiado el {{date}}",
|
||||
"pending_one": "{{count}} cambio en curso",
|
||||
"pending_other": "{{count}} cambios en curso",
|
||||
"failed_one": "{{count}} cambio falló",
|
||||
"failed_other": "{{count}} cambios fallaron",
|
||||
"editFor": "Editar el precio de {{country}}",
|
||||
"amount": "Precio mensual ({{currency}})",
|
||||
"applyToExisting": "Aplicar a las suscripciones existentes",
|
||||
"applyHint_one": "{{count}} suscripción pasa al precio nuevo desde su próximo cobro. Le avisamos por correo.",
|
||||
"applyHint_other": "{{count}} suscripciones pasan al precio nuevo desde su próximo cobro. Les avisamos por correo.",
|
||||
"saved": "Precio guardado.",
|
||||
"savedQueued_one": "Precio guardado. {{count}} suscripción pasa al precio nuevo desde su próximo cobro.",
|
||||
"savedQueued_other": "Precio guardado. {{count}} suscripciones pasan al precio nuevo desde su próximo cobro."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"paidThrough": "Pagado hasta el {{date}}.",
|
||||
"notEnforced": "Por ahora todas las funciones están habilitadas para todas las cuentas.",
|
||||
"groups": "Grupos",
|
||||
"students": "Alumnos activos"
|
||||
"students": "Alumnos activos",
|
||||
"nextPrice": "Nuevo precio desde tu próximo cobro: {{amount}} al mes."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Envía al menos un registro de asistencia"
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Ingresa un precio mayor a cero"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,5 +86,49 @@
|
||||
"PENDING": "Conectando",
|
||||
"DISCONNECTED": "Desconectado",
|
||||
"NONE": "Sin conectar"
|
||||
},
|
||||
"plans": {
|
||||
"title": "Planes",
|
||||
"subtitle": "Límites de Free y Pro, y precio de Pro en cada país.",
|
||||
"loading": "Cargando planes",
|
||||
"loadError": "No pudimos cargar los planes.",
|
||||
"saveError": "No pudimos guardar el cambio.",
|
||||
"edit": "Editar",
|
||||
"save": "Guardar",
|
||||
"cancel": "Cancelar",
|
||||
"limits": {
|
||||
"title": "Límites",
|
||||
"hint": "Rigen al instante para todas las cuentas del plan. Una cuenta que quede por encima pasa a solo lectura.",
|
||||
"maxGroups": "Grupos",
|
||||
"maxAttendees": "Alumnos activos",
|
||||
"unlimited": "Sin límite",
|
||||
"unlimitedFor": "{{label}} sin límite",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsappAutomations": "Mensajes automáticos por WhatsApp",
|
||||
"impact_one": "{{count}} cuenta ya supera estos límites y va a quedar en solo lectura al guardar.",
|
||||
"impact_other": "{{count}} cuentas ya superan estos límites y van a quedar en solo lectura al guardar.",
|
||||
"saved": "Límites guardados."
|
||||
},
|
||||
"prices": {
|
||||
"title": "Precio de Pro",
|
||||
"hint": "Las suscripciones nuevas toman el precio al instante. Las existentes conservan el suyo, salvo que elijas aplicarlo.",
|
||||
"live_one": "{{count}} suscripción activa",
|
||||
"live_other": "{{count}} suscripciones activas",
|
||||
"atOtherPrice_one": "{{count}} con otro precio",
|
||||
"atOtherPrice_other": "{{count}} con otro precio",
|
||||
"updatedAt": "cambiado el {{date}}",
|
||||
"pending_one": "{{count}} cambio en curso",
|
||||
"pending_other": "{{count}} cambios en curso",
|
||||
"failed_one": "{{count}} cambio falló",
|
||||
"failed_other": "{{count}} cambios fallaron",
|
||||
"editFor": "Editar el precio de {{country}}",
|
||||
"amount": "Precio mensual ({{currency}})",
|
||||
"applyToExisting": "Aplicar a las suscripciones existentes",
|
||||
"applyHint_one": "{{count}} suscripción pasa al precio nuevo desde su próximo cobro. Le avisamos por mail.",
|
||||
"applyHint_other": "{{count}} suscripciones pasan al precio nuevo desde su próximo cobro. Les avisamos por mail.",
|
||||
"saved": "Precio guardado.",
|
||||
"savedQueued_one": "Precio guardado. {{count}} suscripción pasa al precio nuevo desde su próximo cobro.",
|
||||
"savedQueued_other": "Precio guardado. {{count}} suscripciones pasan al precio nuevo desde su próximo cobro."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"paidThrough": "Pagado hasta el {{date}}.",
|
||||
"notEnforced": "Por ahora todas las funciones están habilitadas para todas las cuentas.",
|
||||
"groups": "Grupos",
|
||||
"students": "Alumnos activos"
|
||||
"students": "Alumnos activos",
|
||||
"nextPrice": "Nuevo precio desde tu próximo cobro: {{amount}} por mes."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Mandá al menos un registro de asistencia"
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Ingresá un precio mayor a cero"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,5 +86,49 @@
|
||||
"PENDING": "Conectando",
|
||||
"DISCONNECTED": "Desconectado",
|
||||
"NONE": "Não conectado"
|
||||
},
|
||||
"plans": {
|
||||
"title": "Planos",
|
||||
"subtitle": "Limites do Free e do Pro, e preço do Pro em cada país.",
|
||||
"loading": "Carregando planos",
|
||||
"loadError": "Não conseguimos carregar os planos.",
|
||||
"saveError": "Não conseguimos salvar a alteração.",
|
||||
"edit": "Editar",
|
||||
"save": "Salvar",
|
||||
"cancel": "Cancelar",
|
||||
"limits": {
|
||||
"title": "Limites",
|
||||
"hint": "Valem na hora para todas as contas do plano. Uma conta que ficar acima passa a somente leitura.",
|
||||
"maxGroups": "Grupos",
|
||||
"maxAttendees": "Alunos ativos",
|
||||
"unlimited": "Sem limite",
|
||||
"unlimitedFor": "{{label}} sem limite",
|
||||
"mpCharges": "Cobranças com Mercado Pago",
|
||||
"whatsappAutomations": "Mensagens automáticas por WhatsApp",
|
||||
"impact_one": "{{count}} conta já passa desses limites e vai ficar em somente leitura ao salvar.",
|
||||
"impact_other": "{{count}} contas já passam desses limites e vão ficar em somente leitura ao salvar.",
|
||||
"saved": "Limites salvos."
|
||||
},
|
||||
"prices": {
|
||||
"title": "Preço do Pro",
|
||||
"hint": "As assinaturas novas usam o preço na hora. As existentes mantêm o delas, a menos que você escolha aplicá-lo.",
|
||||
"live_one": "{{count}} assinatura ativa",
|
||||
"live_other": "{{count}} assinaturas ativas",
|
||||
"atOtherPrice_one": "{{count}} com outro preço",
|
||||
"atOtherPrice_other": "{{count}} com outro preço",
|
||||
"updatedAt": "alterado em {{date}}",
|
||||
"pending_one": "{{count}} alteração em andamento",
|
||||
"pending_other": "{{count}} alterações em andamento",
|
||||
"failed_one": "{{count}} alteração falhou",
|
||||
"failed_other": "{{count}} alterações falharam",
|
||||
"editFor": "Editar o preço de {{country}}",
|
||||
"amount": "Preço mensal ({{currency}})",
|
||||
"applyToExisting": "Aplicar às assinaturas existentes",
|
||||
"applyHint_one": "{{count}} assinatura passa ao preço novo a partir da próxima cobrança. Avisamos por e-mail.",
|
||||
"applyHint_other": "{{count}} assinaturas passam ao preço novo a partir da próxima cobrança. Avisamos por e-mail.",
|
||||
"saved": "Preço salvo.",
|
||||
"savedQueued_one": "Preço salvo. {{count}} assinatura passa ao preço novo a partir da próxima cobrança.",
|
||||
"savedQueued_other": "Preço salvo. {{count}} assinaturas passam ao preço novo a partir da próxima cobrança."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"paidThrough": "Pago até {{date}}.",
|
||||
"notEnforced": "Por enquanto todos os recursos estão liberados para todas as contas.",
|
||||
"groups": "Grupos",
|
||||
"students": "Alunos ativos"
|
||||
"students": "Alunos ativos",
|
||||
"nextPrice": "Novo preço a partir da próxima cobrança: {{amount}} por mês."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Envie pelo menos um registro de presença"
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Informe um preço maior que zero"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user