feat: implement plan upgrade logic with prorated pricing and MercadoPago integration
This commit is contained in:
@@ -106,6 +106,7 @@ export default function CurrentPlanPage() {
|
||||
|
||||
const plan = subscription?.plan;
|
||||
const isPaidPlan = Boolean(plan && plan.price > 0);
|
||||
const statusText = isPaidPlan ? getSubStatusText(subscription?.mpStatus) : "ACTIVO";
|
||||
const canRenew = Boolean(
|
||||
isOwner &&
|
||||
isPaidPlan &&
|
||||
@@ -155,7 +156,7 @@ export default function CurrentPlanPage() {
|
||||
<h1 className={styles.title}>{plan?.name || "Cargando plan"}</h1>
|
||||
<p className={styles.subtitle}>Gestioná la vigencia, límites y beneficios de tu suscripción.</p>
|
||||
{subscription && (
|
||||
<span className={styles.status}>{getSubStatusText(subscription.mpStatus)}</span>
|
||||
<span className={styles.status}>{statusText}</span>
|
||||
)}
|
||||
</div>
|
||||
{organizations.length > 1 && (
|
||||
@@ -200,8 +201,8 @@ export default function CurrentPlanPage() {
|
||||
</div>
|
||||
<div className={styles.summaryItem}>
|
||||
<span>Vencimiento</span>
|
||||
<strong>{formatDate(subscription.endDate)}</strong>
|
||||
<small>{isPaidPlan ? "Período vigente" : "Sin vencimiento pago"}</small>
|
||||
<strong>{isPaidPlan ? formatDate(subscription.endDate) : "No tiene vencimiento"}</strong>
|
||||
<small>{isPaidPlan ? "Período vigente" : "Plan gratuito activo"}</small>
|
||||
{isPaidPlan && (
|
||||
<button className={styles.inlineRenewLink} onClick={handleRenew}>
|
||||
Extender plan
|
||||
@@ -310,7 +311,7 @@ export default function CurrentPlanPage() {
|
||||
text="Cambiar plan"
|
||||
width="custom"
|
||||
style={{ width: "100%", padding: "13px 0", borderRadius: "12px", fontWeight: "800" }}
|
||||
onClick={() => goTo("/landing/pricing")}
|
||||
onClick={() => goTo(`/landing/upgrade-plan?org=${selectedOrgId}`)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user