development #14
@@ -4,8 +4,10 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate, useSearch } from '@tanstack/react-router'
|
||||
import type { ReactNode } from 'react'
|
||||
import { createContext, useContext, useEffect, useRef, useState } from 'react'
|
||||
import { errorMessage } from '../../i18n'
|
||||
import { i18n } from '../../i18n/instance'
|
||||
import { useToast } from '../../components/ui'
|
||||
import { ApiError, cancelSubscription, getBillingCharges } from '../../lib/api'
|
||||
import { cancelSubscription, getBillingCharges } from '../../lib/api'
|
||||
import { billingStatusQueryKey, useBillingStatus } from './useBillingStatus'
|
||||
import { useSubscriptionReturnPolling } from './useSubscriptionReturnPolling'
|
||||
|
||||
@@ -54,7 +56,7 @@ export function BillingProvider({ children }: { children: ReactNode }) {
|
||||
if (!polling.isPolling || announced.current) return
|
||||
if (statusQuery.data?.status === 'AUTHORIZED') {
|
||||
announced.current = true
|
||||
toast.success('¡Listo! Ya tenés Gruperly Pro.')
|
||||
toast.success(i18n.t('billing:cancel.welcome'))
|
||||
void queryClient.invalidateQueries({ queryKey: ['billing', 'charges'] })
|
||||
}
|
||||
// `toast` cambia en cada aviso: el efecto depende solo del estado.
|
||||
@@ -63,11 +65,11 @@ export function BillingProvider({ children }: { children: ReactNode }) {
|
||||
const cancelMutation = useMutation({
|
||||
mutationFn: cancelSubscription,
|
||||
onSuccess: () => {
|
||||
toast.success('Cancelaste tu suscripción. Seguís con Pro hasta el fin del período pago.')
|
||||
toast.success(i18n.t('billing:cancel.done'))
|
||||
void queryClient.invalidateQueries({ queryKey: billingStatusQueryKey })
|
||||
},
|
||||
onError: (error: Error) => {
|
||||
toast.error(error instanceof ApiError ? error.message : 'No pudimos cancelar la suscripción.')
|
||||
toast.error(errorMessage(error, i18n.t('billing:cancel.error')))
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -10,15 +10,19 @@ import { ChargesList } from './ChargesList'
|
||||
import { PlanOptionCard } from './PlanOptionCard'
|
||||
import { PlanSummaryCard } from './PlanSummaryCard'
|
||||
import { SubscribeModal } from './SubscribeModal'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export function BillingView() {
|
||||
const { statusQuery, openSubscribe, cancel, isCancelling } = useBilling()
|
||||
const [isConfirmingCancel, setIsConfirmingCancel] = useState(false)
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const status = statusQuery.data
|
||||
|
||||
const subscribed = status?.status === 'AUTHORIZED' || status?.status === 'PAUSED'
|
||||
const pending = status?.status === 'PENDING'
|
||||
const proPrice = status ? `${formatPrice(status.priceAmount, status.currency)} / mes` : undefined
|
||||
const proPrice = status
|
||||
? t('view.perMonth', { price: formatPrice(status.priceAmount, status.currency) })
|
||||
: undefined
|
||||
|
||||
return (
|
||||
<section className="space-y-6">
|
||||
@@ -28,10 +32,10 @@ export function BillingView() {
|
||||
className="mb-2 hidden items-center gap-1 text-sm text-foreground/60 hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ChevronLeft className="size-4" />
|
||||
Ajustes
|
||||
{t('view.back')}
|
||||
</Link>
|
||||
<h1 className="text-2xl font-bold text-primary">Tu plan</h1>
|
||||
<p className="mt-1 text-sm text-foreground/60">Elegí cómo usar Gruperly.</p>
|
||||
<h1 className="text-2xl font-bold text-primary">{t('view.title')}</h1>
|
||||
<p className="mt-1 text-sm text-foreground/60">{t('view.subtitle')}</p>
|
||||
</div>
|
||||
|
||||
<PlanSummaryCard />
|
||||
@@ -48,15 +52,15 @@ export function BillingView() {
|
||||
>
|
||||
{subscribed ? (
|
||||
<Button variant="outline" className="w-full" onClick={() => setIsConfirmingCancel(true)}>
|
||||
Cancelar suscripción
|
||||
{t('cancel.confirm')}
|
||||
</Button>
|
||||
) : status.availableInCountry ? (
|
||||
<Button variant="primary" className="w-full" onClick={openSubscribe}>
|
||||
<Sparkles className="size-4" />
|
||||
{pending ? 'Reintentar el pago' : 'Pasar a Pro'}
|
||||
{pending ? t('view.retry') : t('view.upgrade')}
|
||||
</Button>
|
||||
) : (
|
||||
<p className="text-xs text-foreground/50">Todavía no está disponible en tu país.</p>
|
||||
<p className="text-xs text-foreground/50">{t('view.unavailable')}</p>
|
||||
)}
|
||||
</PlanOptionCard>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Loader2 } from 'lucide-react'
|
||||
import { Button, Modal } from '../../components/ui'
|
||||
import { formatBillingDate } from './copy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
type CancelSubscriptionModalProps = {
|
||||
isOpen: boolean
|
||||
@@ -19,25 +20,26 @@ export function CancelSubscriptionModal({
|
||||
onConfirm,
|
||||
}: CancelSubscriptionModalProps) {
|
||||
const until = formatBillingDate(paidThrough)
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
title="Cancelar Pro"
|
||||
title={t('cancel.title')}
|
||||
description={
|
||||
until
|
||||
? `No te vamos a cobrar más. Seguís con Pro hasta el ${until}; después tu cuenta pasa a Free.`
|
||||
: 'No te vamos a cobrar más y tu cuenta pasa a Free.'
|
||||
? t('cancel.descriptionUntil', { date: until })
|
||||
: t('cancel.description')
|
||||
}
|
||||
maxWidth="sm"
|
||||
>
|
||||
<div className="flex justify-end gap-3">
|
||||
<Button variant="outline" onClick={onClose}>
|
||||
Volver
|
||||
{t('cancel.back')}
|
||||
</Button>
|
||||
<Button variant="primary" disabled={isPending} onClick={onConfirm}>
|
||||
{isPending ? <Loader2 className="size-4 animate-spin" /> : null}
|
||||
Cancelar suscripción
|
||||
{t('cancel.confirm')}
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
@@ -2,19 +2,15 @@ import { Button } from '../../components/ui'
|
||||
import { formatPrice } from '../../lib/format'
|
||||
import { useBilling } from './BillingProvider'
|
||||
import { formatBillingDate } from './copy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const CHARGE_STATUS_LABELS: Record<string, string> = {
|
||||
approved: 'Pagado',
|
||||
rejected: 'Rechazado',
|
||||
pending: 'Pendiente',
|
||||
in_process: 'En proceso',
|
||||
cancelled: 'Cancelado',
|
||||
refunded: 'Devuelto',
|
||||
}
|
||||
/** Mercado Pago / Stripe statuses with copy in `billing:charges.<status>`. */
|
||||
const KNOWN_CHARGE_STATUSES = new Set(['approved', 'rejected', 'pending', 'in_process', 'cancelled', 'refunded'])
|
||||
|
||||
/** Historial de cobros de la suscripción a Pro. */
|
||||
export function ChargesList() {
|
||||
const { chargesQuery, chargesPage, setChargesPage } = useBilling()
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const charges = chargesQuery.data?.data ?? []
|
||||
const totalPages = chargesQuery.data?.pagination.totalPages ?? 0
|
||||
|
||||
@@ -22,7 +18,7 @@ export function ChargesList() {
|
||||
|
||||
return (
|
||||
<section className="space-y-2">
|
||||
<h2 className="text-sm font-semibold text-primary">Historial de pagos</h2>
|
||||
<h2 className="text-sm font-semibold text-primary">{t('charges.title')}</h2>
|
||||
<ul className="divide-y divide-border rounded-xl border border-border bg-surface">
|
||||
{charges.map((charge) => (
|
||||
<li key={charge.id} className="flex items-center justify-between gap-3 px-4 py-3">
|
||||
@@ -33,7 +29,7 @@ export function ChargesList() {
|
||||
</p>
|
||||
</div>
|
||||
<span className="text-xs text-foreground/60">
|
||||
{CHARGE_STATUS_LABELS[charge.status] ?? charge.status}
|
||||
{KNOWN_CHARGE_STATUSES.has(charge.status) ? t(`charges.${charge.status}` as 'charges.approved') : charge.status}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
@@ -46,7 +42,7 @@ export function ChargesList() {
|
||||
disabled={chargesPage <= 1}
|
||||
onClick={() => setChargesPage(chargesPage - 1)}
|
||||
>
|
||||
Anteriores
|
||||
{t('charges.prev')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -54,7 +50,7 @@ export function ChargesList() {
|
||||
disabled={chargesPage >= totalPages}
|
||||
onClick={() => setChargesPage(chargesPage + 1)}
|
||||
>
|
||||
Siguientes
|
||||
{t('charges.next')}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useAuth } from '../../context/AuthProvider'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { planNoticeMessage } from './copy'
|
||||
import { useBillingStatus } from './useBillingStatus'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
/**
|
||||
* Aviso global del plan: cuenta en solo lectura o Pro en período de gracia.
|
||||
@@ -12,6 +13,7 @@ import { useBillingStatus } from './useBillingStatus'
|
||||
*/
|
||||
export function PlanNotice() {
|
||||
const { user } = useAuth()
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const statusQuery = useBillingStatus({ enabled: !!user })
|
||||
const pathname = useLocation({ select: (location) => location.pathname })
|
||||
|
||||
@@ -36,7 +38,7 @@ export function PlanNotice() {
|
||||
danger ? 'text-danger' : 'text-warning',
|
||||
)}
|
||||
>
|
||||
Ver plan
|
||||
{t('notice.seePlan')}
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { ReactNode } from 'react'
|
||||
import { Badge } from '../../components/ui'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { PLAN_NAMES, planFeatureList } from './copy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
type PlanOptionCardProps = {
|
||||
plan: Plan
|
||||
@@ -18,6 +19,7 @@ type PlanOptionCardProps = {
|
||||
|
||||
/** Una tarjeta de plan, igual en la pantalla del plan y en el onboarding. */
|
||||
export function PlanOptionCard({ plan, limits, price, current, highlighted, children }: PlanOptionCardProps) {
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
@@ -27,9 +29,9 @@ export function PlanOptionCard({ plan, limits, price, current, highlighted, chil
|
||||
>
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<p className="text-base font-semibold text-primary">{PLAN_NAMES[plan]}</p>
|
||||
{current ? <Badge variant="info">Tu plan</Badge> : null}
|
||||
{current ? <Badge variant="info">{t('option.yourPlan')}</Badge> : null}
|
||||
</div>
|
||||
<p className="mt-1 text-sm text-foreground/60">{price ?? 'Gratis'}</p>
|
||||
<p className="mt-1 text-sm text-foreground/60">{price ?? t('option.free')}</p>
|
||||
|
||||
<ul className="mt-3 flex-1 space-y-1.5">
|
||||
{planFeatureList(limits).map((feature) => (
|
||||
|
||||
@@ -3,10 +3,12 @@ import { ChevronRight, Sparkles } from 'lucide-react'
|
||||
import { Badge } from '../../components/ui'
|
||||
import { PLAN_NAMES, planBadgeVariant } from './copy'
|
||||
import { useBillingStatus } from './useBillingStatus'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
/** Entrada a la pantalla del plan desde Ajustes. */
|
||||
export function PlanSettingsCard() {
|
||||
const statusQuery = useBillingStatus()
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const status = statusQuery.data
|
||||
|
||||
return (
|
||||
@@ -16,12 +18,12 @@ export function PlanSettingsCard() {
|
||||
<Sparkles className="size-4 text-accent-fg" />
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-sm font-medium text-primary">Plan</p>
|
||||
<p className="text-xs text-foreground/50">Tu plan de Gruperly y tus pagos</p>
|
||||
<p className="text-sm font-medium text-primary">{t('settings.title')}</p>
|
||||
<p className="text-xs text-foreground/50">{t('settings.description')}</p>
|
||||
</div>
|
||||
{status ? (
|
||||
<Badge variant={planBadgeVariant(status)}>
|
||||
{status.readOnly ? 'Solo lectura' : PLAN_NAMES[status.plan]}
|
||||
{status.readOnly ? t('settings.readOnly') : PLAN_NAMES[status.plan]}
|
||||
</Badge>
|
||||
) : null}
|
||||
<ChevronRight className="size-4 text-foreground/40" />
|
||||
|
||||
@@ -11,17 +11,19 @@ import {
|
||||
planNoticeMessage,
|
||||
subscriptionStatusLabel,
|
||||
} from './copy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
/** El plan actual: estado de la suscripción, próximo cobro y uso contra los límites. */
|
||||
export function PlanSummaryCard() {
|
||||
const { statusQuery } = useBilling()
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const status = statusQuery.data
|
||||
|
||||
if (!status) {
|
||||
return (
|
||||
<div className="flex items-center gap-3 rounded-xl border border-border bg-surface px-4 py-3">
|
||||
<Loader2 className="size-4 animate-spin text-foreground/40" />
|
||||
<p className="text-sm text-foreground/50">Consultando tu plan…</p>
|
||||
<p className="text-sm text-foreground/50">{t('summary.loading')}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -34,27 +36,27 @@ export function PlanSummaryCard() {
|
||||
<div className="divide-y divide-border rounded-xl border border-border bg-surface">
|
||||
<div className="px-4 py-3">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<p className="text-sm font-medium text-primary">Plan {PLAN_NAMES[status.plan]}</p>
|
||||
<p className="text-sm font-medium text-primary">{t('summary.plan', { plan: PLAN_NAMES[status.plan] })}</p>
|
||||
<Badge variant={planBadgeVariant(status)}>
|
||||
{status.readOnly ? 'Solo lectura' : subscriptionStatusLabel(status.status)}
|
||||
{status.readOnly ? t('settings.readOnly') : subscriptionStatusLabel(status.status)}
|
||||
</Badge>
|
||||
</div>
|
||||
{status.status === 'AUTHORIZED' && nextPayment ? (
|
||||
<p className="mt-0.5 text-xs text-foreground/50">
|
||||
Próximo cobro: {formatPrice(status.priceAmount, status.currency)} el {nextPayment}
|
||||
{t('summary.next', { amount: formatPrice(status.priceAmount, status.currency), date: nextPayment })}
|
||||
</p>
|
||||
) : null}
|
||||
{status.status === 'PENDING' ? (
|
||||
<p className="mt-0.5 text-xs text-foreground/50">
|
||||
Estamos esperando que {BILLING_PROVIDER_NAMES[status.provider]} confirme tu suscripción.
|
||||
{t('summary.pending', { provider: BILLING_PROVIDER_NAMES[status.provider] })}
|
||||
</p>
|
||||
) : null}
|
||||
{status.status === 'CANCELLED' && status.plan === 'PRO' && paidThrough ? (
|
||||
<p className="mt-0.5 text-xs text-foreground/50">Pagado hasta el {paidThrough}.</p>
|
||||
<p className="mt-0.5 text-xs text-foreground/50">{t('summary.paidThrough', { date: paidThrough })}</p>
|
||||
) : null}
|
||||
{!status.enforced ? (
|
||||
<p className="mt-0.5 text-xs text-foreground/50">
|
||||
Por ahora todas las funciones están habilitadas para todas las cuentas.
|
||||
{t('summary.notEnforced')}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -73,13 +75,13 @@ export function PlanSummaryCard() {
|
||||
|
||||
<dl className="grid grid-cols-2 gap-3 px-4 py-3">
|
||||
<div>
|
||||
<dt className="text-xs text-foreground/50">Grupos</dt>
|
||||
<dt className="text-xs text-foreground/50">{t('summary.groups')}</dt>
|
||||
<dd className="text-sm font-medium text-primary">
|
||||
{formatUsage(status.usage.groups, status.limits.maxGroups)}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-xs text-foreground/50">Alumnos activos</dt>
|
||||
<dt className="text-xs text-foreground/50">{t('summary.students')}</dt>
|
||||
<dd className="text-sm font-medium text-primary">
|
||||
{formatUsage(status.usage.attendees, status.limits.maxAttendees)}
|
||||
</dd>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useNavigate } from '@tanstack/react-router'
|
||||
import { Sparkles } from 'lucide-react'
|
||||
import { Button, Modal } from '../../components/ui'
|
||||
import { dismissPlanPrompt, usePlanPrompt } from './plan-prompt'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
/**
|
||||
* Aviso de "esto es de Pro". Lo dispara cualquier 402 de plan (ver el
|
||||
@@ -10,19 +11,20 @@ import { dismissPlanPrompt, usePlanPrompt } from './plan-prompt'
|
||||
*/
|
||||
export function PlanUpgradePrompt() {
|
||||
const detail = usePlanPrompt()
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const navigate = useNavigate()
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={detail !== null}
|
||||
onClose={dismissPlanPrompt}
|
||||
title="Disponible en Pro"
|
||||
title={t('upgrade.title')}
|
||||
description={detail ?? undefined}
|
||||
maxWidth="sm"
|
||||
>
|
||||
<div className="flex justify-end gap-3">
|
||||
<Button variant="outline" onClick={dismissPlanPrompt}>
|
||||
Ahora no
|
||||
{t('upgrade.later')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -32,7 +34,7 @@ export function PlanUpgradePrompt() {
|
||||
}}
|
||||
>
|
||||
<Sparkles className="size-4" />
|
||||
Ver planes
|
||||
{t('upgrade.seePlans')}
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Loader2 } from 'lucide-react'
|
||||
import { type FormEvent, useState } from 'react'
|
||||
import { Button, Input, Label } from '../../components/ui'
|
||||
import { BILLING_PROVIDER_NAMES } from './copy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
type SubscribeFormProps = {
|
||||
provider: BillingProviderId
|
||||
@@ -26,11 +27,12 @@ export function SubscribeForm({
|
||||
defaultEmail,
|
||||
isPending,
|
||||
error,
|
||||
submitLabel = `Ir a ${BILLING_PROVIDER_NAMES[provider]}`,
|
||||
submitLabel,
|
||||
onSubmit,
|
||||
onCancel,
|
||||
}: SubscribeFormProps) {
|
||||
const [email, setEmail] = useState(defaultEmail)
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const asksEmail = provider === 'MERCADO_PAGO'
|
||||
|
||||
const handleSubmit = (event: FormEvent) => {
|
||||
@@ -42,7 +44,7 @@ export function SubscribeForm({
|
||||
<form className="space-y-4" onSubmit={handleSubmit}>
|
||||
{asksEmail ? (
|
||||
<div className="space-y-1.5">
|
||||
<Label htmlFor="payer-email">Email de tu cuenta de Mercado Pago</Label>
|
||||
<Label htmlFor="payer-email">{t('subscribe.payerEmail')}</Label>
|
||||
<Input
|
||||
id="payer-email"
|
||||
type="email"
|
||||
@@ -53,7 +55,7 @@ export function SubscribeForm({
|
||||
onChange={(event) => setEmail(event.target.value)}
|
||||
/>
|
||||
<p className="text-xs text-foreground/50">
|
||||
Tenés que entrar a Mercado Pago con este mismo email para autorizar el débito mensual.
|
||||
{t('subscribe.payerEmailHint')}
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -63,12 +65,12 @@ export function SubscribeForm({
|
||||
<div className="flex justify-end gap-3">
|
||||
{onCancel ? (
|
||||
<Button type="button" variant="outline" onClick={onCancel}>
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
) : null}
|
||||
<Button type="submit" variant="primary" disabled={isPending || (asksEmail && !email.trim())}>
|
||||
{isPending ? <Loader2 className="size-4 animate-spin" /> : null}
|
||||
{isPending ? 'Abriendo…' : submitLabel}
|
||||
{isPending ? t('subscribe.opening') : (submitLabel ?? t('subscribe.goTo', { provider: BILLING_PROVIDER_NAMES[provider] }))}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -4,9 +4,11 @@ import { useBilling } from './BillingProvider'
|
||||
import { subscribeDescription } from './copy'
|
||||
import { SubscribeForm } from './SubscribeForm'
|
||||
import { useStartSubscription } from './useStartSubscription'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export function SubscribeModal() {
|
||||
const { user } = useAuth()
|
||||
const { t } = useTranslation(['billing', 'common'])
|
||||
const { isSubscribeOpen, closeSubscribe, statusQuery } = useBilling()
|
||||
const subscription = useStartSubscription()
|
||||
const provider = statusQuery.data?.provider ?? 'MERCADO_PAGO'
|
||||
@@ -15,7 +17,7 @@ export function SubscribeModal() {
|
||||
<Modal
|
||||
isOpen={isSubscribeOpen}
|
||||
onClose={closeSubscribe}
|
||||
title="Pasate a Pro"
|
||||
title={t('subscribe.title')}
|
||||
description={subscribeDescription(provider)}
|
||||
maxWidth="sm"
|
||||
>
|
||||
|
||||
@@ -7,6 +7,7 @@ import type {
|
||||
SubscriptionStatus,
|
||||
} from '@gruperly/shared'
|
||||
import type { BadgeVariant } from '../../components/ui'
|
||||
import { i18n } from '../../i18n/instance'
|
||||
|
||||
/* Copy del plan de Gruperly en un solo lugar: Ajustes, la pantalla del plan, el
|
||||
paso del onboarding y los avisos tienen que decir lo mismo. Funciones puras,
|
||||
@@ -14,8 +15,9 @@ import type { BadgeVariant } from '../../components/ui'
|
||||
|
||||
export const PLAN_NAMES: Record<Plan, string> = { FREE: 'Free', PRO: 'Pro' }
|
||||
|
||||
export const SUBSCRIBE_ERROR_MESSAGE =
|
||||
'No pudimos abrir la página de pago. Revisá tu conexión e intentá de nuevo.'
|
||||
export function subscribeErrorMessage(): string {
|
||||
return i18n.t('billing:subscribeError')
|
||||
}
|
||||
|
||||
/* Quién cobra Pro: Mercado Pago en Argentina, Stripe en el resto. Es solo la
|
||||
suscripción a Gruperly; los cobros a alumnos siguen siendo con Mercado Pago. */
|
||||
@@ -26,9 +28,7 @@ export const BILLING_PROVIDER_NAMES: Record<BillingProviderId, string> = {
|
||||
|
||||
/** Qué pasa al tocar "Pasar a Pro", según quién cobra. */
|
||||
export function subscribeDescription(provider: BillingProviderId): string {
|
||||
return provider === 'STRIPE'
|
||||
? 'Te llevamos a Stripe para cargar tu tarjeta. El cobro es mensual y podés cancelarlo cuando quieras.'
|
||||
: 'Te llevamos a Mercado Pago para autorizar el débito mensual. Podés cancelarlo cuando quieras.'
|
||||
return i18n.t(`billing:subscribeDescription.${provider}`)
|
||||
}
|
||||
|
||||
/** Lo que incluye cada plan, como lista para las tarjetas de comparación. */
|
||||
@@ -37,25 +37,25 @@ export function planFeatureList(limits: PlanLimits): { label: string; included:
|
||||
{
|
||||
label:
|
||||
limits.maxGroups === null
|
||||
? 'Grupos ilimitados'
|
||||
: `${limits.maxGroups} ${limits.maxGroups === 1 ? 'grupo' : 'grupos'}`,
|
||||
? i18n.t('billing:features.unlimitedGroups')
|
||||
: i18n.t('billing:features.groups', { count: limits.maxGroups }),
|
||||
included: true,
|
||||
},
|
||||
{
|
||||
label:
|
||||
limits.maxAttendees === null
|
||||
? 'Alumnos ilimitados'
|
||||
: `Hasta ${limits.maxAttendees} alumnos activos`,
|
||||
? i18n.t('billing:features.unlimitedStudents')
|
||||
: i18n.t('billing:features.students', { count: limits.maxAttendees }),
|
||||
included: true,
|
||||
},
|
||||
{ label: 'Cobros con Mercado Pago', included: limits.mpCharges },
|
||||
{ label: 'Mensajes automáticos por WhatsApp', included: limits.whatsappAutomations },
|
||||
{ label: i18n.t('billing:features.mpCharges'), included: limits.mpCharges },
|
||||
{ label: i18n.t('billing:features.whatsapp'), included: limits.whatsappAutomations },
|
||||
]
|
||||
}
|
||||
|
||||
export const PLAN_FEATURE_REQUIRED_MESSAGES: Record<PlanFeature, string> = {
|
||||
mpCharges: 'Cobrar con Mercado Pago está disponible en el plan Pro.',
|
||||
whatsappAutomations: 'Los mensajes automáticos de WhatsApp están disponibles en el plan Pro.',
|
||||
/** The same copy as the backend's `plan_feature_required` problem. */
|
||||
export function planFeatureRequiredMessage(feature: PlanFeature): string {
|
||||
return i18n.t(`errors:codes.plan_feature_required_${feature}`)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,15 +69,12 @@ export function hasPlanFeature(status: BillingStatusDto | undefined, feature: Pl
|
||||
export function subscriptionStatusLabel(status: SubscriptionStatus | null): string {
|
||||
switch (status) {
|
||||
case 'AUTHORIZED':
|
||||
return 'Activa'
|
||||
case 'PENDING':
|
||||
return 'Pendiente de pago'
|
||||
case 'PAUSED':
|
||||
return 'Pausada'
|
||||
case 'CANCELLED':
|
||||
return 'Cancelada'
|
||||
return i18n.t(`billing:subscriptionStatus.${status}`)
|
||||
default:
|
||||
return 'Sin suscripción'
|
||||
return i18n.t('billing:subscriptionStatus.NONE')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,14 +88,14 @@ export function formatBillingDate(iso: string | null): string | null {
|
||||
if (!iso) return null
|
||||
const date = new Date(iso)
|
||||
if (Number.isNaN(date.getTime())) return null
|
||||
return new Intl.DateTimeFormat('es', { day: 'numeric', month: 'short', year: 'numeric' }).format(
|
||||
return new Intl.DateTimeFormat(i18n.language, { day: 'numeric', month: 'short', year: 'numeric' }).format(
|
||||
date,
|
||||
)
|
||||
}
|
||||
|
||||
/** "3 de 15": el uso contra el límite, o solo el uso cuando no hay límite. */
|
||||
export function formatUsage(used: number, limit: number | null): string {
|
||||
return limit === null ? `${used}` : `${used} de ${limit}`
|
||||
return limit === null ? `${used}` : i18n.t('billing:usage', { used, limit })
|
||||
}
|
||||
|
||||
const PLAN_PROBLEM_CODES = ['plan_limit_reached', 'plan_feature_required', 'plan_read_only']
|
||||
@@ -124,7 +121,7 @@ export function planNoticeMessage(status: BillingStatusDto): { tone: 'danger' |
|
||||
if (status.readOnly) {
|
||||
return {
|
||||
tone: 'danger',
|
||||
text: 'Tu cuenta está en solo lectura: superás los límites del plan Free. Pasate a Pro o reducí tus alumnos para volver a editar.',
|
||||
text: i18n.t('billing:notice.readOnly'),
|
||||
}
|
||||
}
|
||||
const graceUntil = formatBillingDate(status.graceUntil)
|
||||
@@ -133,8 +130,11 @@ export function planNoticeMessage(status: BillingStatusDto): { tone: 'danger' |
|
||||
tone: 'warning',
|
||||
text:
|
||||
status.status === 'CANCELLED'
|
||||
? `Cancelaste Pro: lo seguís teniendo hasta el ${graceUntil}.`
|
||||
: `No pudimos cobrar tu suscripción a Pro. Revisá tu medio de pago en ${BILLING_PROVIDER_NAMES[status.provider]} antes del ${graceUntil}.`,
|
||||
? i18n.t('billing:notice.cancelled', { date: graceUntil })
|
||||
: i18n.t('billing:notice.paymentFailed', {
|
||||
provider: BILLING_PROVIDER_NAMES[status.provider],
|
||||
date: graceUntil,
|
||||
}),
|
||||
}
|
||||
}
|
||||
return null
|
||||
|
||||
@@ -4,7 +4,7 @@ export {
|
||||
formatUsage,
|
||||
hasPlanFeature,
|
||||
isPlanProblem,
|
||||
PLAN_FEATURE_REQUIRED_MESSAGES,
|
||||
planFeatureRequiredMessage,
|
||||
PLAN_NAMES,
|
||||
planFeatureList,
|
||||
planNoticeMessage,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { BillingReturnTo } from '@gruperly/shared'
|
||||
import { useState } from 'react'
|
||||
import { ApiError, subscribeToPro } from '../../lib/api'
|
||||
import { SUBSCRIBE_ERROR_MESSAGE } from './copy'
|
||||
import { subscribeToPro } from '../../lib/api'
|
||||
import { errorMessage } from '../../i18n'
|
||||
import { subscribeErrorMessage } from './copy'
|
||||
|
||||
/**
|
||||
* Empieza la suscripción a Pro. Como la vinculación de Mercado Pago, no se
|
||||
@@ -19,7 +20,7 @@ export function useStartSubscription() {
|
||||
const { checkoutUrl } = await subscribeToPro({ payerEmail, returnTo })
|
||||
window.location.assign(checkoutUrl)
|
||||
} catch (caught) {
|
||||
setError(caught instanceof ApiError && caught.problem?.detail ? caught.problem.detail : SUBSCRIBE_ERROR_MESSAGE)
|
||||
setError(errorMessage(caught, subscribeErrorMessage()))
|
||||
setIsStarting(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useState } from 'react'
|
||||
import { Button } from '../../../components/ui'
|
||||
import {
|
||||
hasPlanFeature,
|
||||
PLAN_FEATURE_REQUIRED_MESSAGES,
|
||||
planFeatureRequiredMessage,
|
||||
showPlanPrompt,
|
||||
useBillingStatus,
|
||||
} from '../../billing'
|
||||
@@ -41,7 +41,7 @@ export function GroupDetailView() {
|
||||
const billingQuery = useBillingStatus({ enabled: isGroupOwner })
|
||||
const handleCharge = () => {
|
||||
if (isGroupOwner && !hasPlanFeature(billingQuery.data, 'mpCharges')) {
|
||||
showPlanPrompt(PLAN_FEATURE_REQUIRED_MESSAGES.mpCharges)
|
||||
showPlanPrompt(planFeatureRequiredMessage('mpCharges'))
|
||||
return
|
||||
}
|
||||
setIsChargeModalOpen(true)
|
||||
|
||||
2
apps/web/src/i18n/i18next.d.ts
vendored
2
apps/web/src/i18n/i18next.d.ts
vendored
@@ -14,6 +14,7 @@ import type attention from './locales/es-AR/attention.json'
|
||||
import type attendeeDetail from './locales/es-AR/attendeeDetail.json'
|
||||
import type classAttendance from './locales/es-AR/classAttendance.json'
|
||||
import type payments from './locales/es-AR/payments.json'
|
||||
import type billing from './locales/es-AR/billing.json'
|
||||
import type validation from './locales/es-AR/validation.json'
|
||||
|
||||
// es-AR es la fuente: una clave que no exista ahí rompe el typecheck.
|
||||
@@ -28,6 +29,7 @@ declare module 'i18next' {
|
||||
pwa: typeof pwa
|
||||
settings: typeof settings
|
||||
validation: typeof validation
|
||||
'billing': typeof billing
|
||||
'payments': typeof payments
|
||||
'classAttendance': typeof classAttendance
|
||||
'attendeeDetail': typeof attendeeDetail
|
||||
|
||||
91
apps/web/src/i18n/locales/en/billing.json
Normal file
91
apps/web/src/i18n/locales/en/billing.json
Normal file
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"subscribeError": "We couldn't open the payment page. Check your connection and try again.",
|
||||
"subscribeDescription": {
|
||||
"STRIPE": "We'll take you to Stripe to add your card. You're billed monthly and can cancel anytime.",
|
||||
"MERCADO_PAGO": "We'll take you to Mercado Pago to authorize the monthly charge. You can cancel anytime."
|
||||
},
|
||||
"features": {
|
||||
"unlimitedGroups": "Unlimited groups",
|
||||
"groups_one": "{{count}} group",
|
||||
"groups_other": "{{count}} groups",
|
||||
"unlimitedStudents": "Unlimited students",
|
||||
"students": "Up to {{count}} active students",
|
||||
"mpCharges": "Payments with Mercado Pago",
|
||||
"whatsapp": "Automatic WhatsApp messages"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Active",
|
||||
"PENDING": "Payment pending",
|
||||
"PAUSED": "Paused",
|
||||
"CANCELLED": "Cancelled",
|
||||
"NONE": "No subscription"
|
||||
},
|
||||
"usage": "{{used}} of {{limit}}",
|
||||
"notice": {
|
||||
"readOnly": "Your account is read-only: you're over the Free plan's limits. Upgrade to Pro or reduce your students to edit again.",
|
||||
"cancelled": "You cancelled Pro: you keep it until {{date}}.",
|
||||
"paymentFailed": "We couldn't charge your Pro subscription. Check your payment method in {{provider}} before {{date}}.",
|
||||
"seePlan": "See plan"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Plan",
|
||||
"description": "Your Gruperly plan and payments",
|
||||
"readOnly": "Read-only"
|
||||
},
|
||||
"subscribe": {
|
||||
"title": "Upgrade to Pro",
|
||||
"goTo": "Go to {{provider}}",
|
||||
"payerEmail": "Your Mercado Pago account email",
|
||||
"payerEmailHint": "You need to sign in to Mercado Pago with this same email to authorize the monthly charge.",
|
||||
"opening": "Opening…"
|
||||
},
|
||||
"upgrade": {
|
||||
"title": "Available on Pro",
|
||||
"later": "Not now",
|
||||
"seePlans": "See plans"
|
||||
},
|
||||
"cancel": {
|
||||
"title": "Cancel Pro",
|
||||
"descriptionUntil": "We won't charge you again. You keep Pro until {{date}}; then your account moves to Free.",
|
||||
"description": "We won't charge you again and your account moves to Free.",
|
||||
"back": "Back",
|
||||
"confirm": "Cancel subscription",
|
||||
"done": "You cancelled your subscription. You keep Pro until the end of the paid period.",
|
||||
"error": "We couldn't cancel the subscription.",
|
||||
"welcome": "All set! You now have Gruperly Pro."
|
||||
},
|
||||
"option": {
|
||||
"yourPlan": "Your plan",
|
||||
"free": "Free"
|
||||
},
|
||||
"charges": {
|
||||
"title": "Payment history",
|
||||
"approved": "Paid",
|
||||
"rejected": "Declined",
|
||||
"pending": "Pending",
|
||||
"in_process": "Processing",
|
||||
"cancelled": "Cancelled",
|
||||
"refunded": "Refunded",
|
||||
"prev": "Previous",
|
||||
"next": "Next"
|
||||
},
|
||||
"view": {
|
||||
"back": "Settings",
|
||||
"title": "Your plan",
|
||||
"subtitle": "Choose how you use Gruperly.",
|
||||
"perMonth": "{{price}} / month",
|
||||
"retry": "Retry payment",
|
||||
"upgrade": "Upgrade to Pro",
|
||||
"unavailable": "Not available in your country yet."
|
||||
},
|
||||
"summary": {
|
||||
"loading": "Checking your plan…",
|
||||
"plan": "{{plan}} plan",
|
||||
"next": "Next charge: {{amount}} on {{date}}",
|
||||
"pending": "We're waiting for {{provider}} to confirm your subscription.",
|
||||
"paidThrough": "Paid through {{date}}.",
|
||||
"notEnforced": "For now, every feature is enabled for every account.",
|
||||
"groups": "Groups",
|
||||
"students": "Active students"
|
||||
}
|
||||
}
|
||||
91
apps/web/src/i18n/locales/es-419/billing.json
Normal file
91
apps/web/src/i18n/locales/es-419/billing.json
Normal file
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"subscribeError": "No pudimos abrir la página de pago. Revisa tu conexión e inténtalo de nuevo.",
|
||||
"subscribeDescription": {
|
||||
"STRIPE": "Te llevamos a Stripe para registrar tu tarjeta. El cobro es mensual y puedes cancelarlo cuando quieras.",
|
||||
"MERCADO_PAGO": "Te llevamos a Mercado Pago para autorizar el débito mensual. Puedes cancelarlo cuando quieras."
|
||||
},
|
||||
"features": {
|
||||
"unlimitedGroups": "Grupos ilimitados",
|
||||
"groups_one": "{{count}} grupo",
|
||||
"groups_other": "{{count}} grupos",
|
||||
"unlimitedStudents": "Alumnos ilimitados",
|
||||
"students": "Hasta {{count}} alumnos activos",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsapp": "Mensajes automáticos por WhatsApp"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Activa",
|
||||
"PENDING": "Pendiente de pago",
|
||||
"PAUSED": "Pausada",
|
||||
"CANCELLED": "Cancelada",
|
||||
"NONE": "Sin suscripción"
|
||||
},
|
||||
"usage": "{{used}} de {{limit}}",
|
||||
"notice": {
|
||||
"readOnly": "Tu cuenta está en solo lectura: superas los límites del plan Free. Cámbiate a Pro o reduce tus alumnos para volver a editar.",
|
||||
"cancelled": "Cancelaste Pro: lo sigues teniendo hasta el {{date}}.",
|
||||
"paymentFailed": "No pudimos cobrar tu suscripción a Pro. Revisa tu medio de pago en {{provider}} antes del {{date}}.",
|
||||
"seePlan": "Ver plan"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Plan",
|
||||
"description": "Tu plan de Gruperly y tus pagos",
|
||||
"readOnly": "Solo lectura"
|
||||
},
|
||||
"subscribe": {
|
||||
"title": "Cámbiate a Pro",
|
||||
"goTo": "Ir a {{provider}}",
|
||||
"payerEmail": "Email de tu cuenta de Mercado Pago",
|
||||
"payerEmailHint": "Tienes que entrar a Mercado Pago con este mismo email para autorizar el débito mensual.",
|
||||
"opening": "Abriendo…"
|
||||
},
|
||||
"upgrade": {
|
||||
"title": "Disponible en Pro",
|
||||
"later": "Ahora no",
|
||||
"seePlans": "Ver planes"
|
||||
},
|
||||
"cancel": {
|
||||
"title": "Cancelar Pro",
|
||||
"descriptionUntil": "No te cobraremos más. Sigues con Pro hasta el {{date}}; después tu cuenta pasa a Free.",
|
||||
"description": "No te cobraremos más y tu cuenta pasa a Free.",
|
||||
"back": "Volver",
|
||||
"confirm": "Cancelar suscripción",
|
||||
"done": "Cancelaste tu suscripción. Sigues con Pro hasta el fin del período pagado.",
|
||||
"error": "No pudimos cancelar la suscripción.",
|
||||
"welcome": "¡Listo! Ya tienes Gruperly Pro."
|
||||
},
|
||||
"option": {
|
||||
"yourPlan": "Tu plan",
|
||||
"free": "Gratis"
|
||||
},
|
||||
"charges": {
|
||||
"title": "Historial de pagos",
|
||||
"approved": "Pagado",
|
||||
"rejected": "Rechazado",
|
||||
"pending": "Pendiente",
|
||||
"in_process": "En proceso",
|
||||
"cancelled": "Cancelado",
|
||||
"refunded": "Devuelto",
|
||||
"prev": "Anteriores",
|
||||
"next": "Siguientes"
|
||||
},
|
||||
"view": {
|
||||
"back": "Ajustes",
|
||||
"title": "Tu plan",
|
||||
"subtitle": "Elige cómo usar Gruperly.",
|
||||
"perMonth": "{{price}} / mes",
|
||||
"retry": "Reintentar el pago",
|
||||
"upgrade": "Cambiarme a Pro",
|
||||
"unavailable": "Todavía no está disponible en tu país."
|
||||
},
|
||||
"summary": {
|
||||
"loading": "Consultando tu plan…",
|
||||
"plan": "Plan {{plan}}",
|
||||
"next": "Próximo cobro: {{amount}} el {{date}}",
|
||||
"pending": "Estamos esperando que {{provider}} confirme tu suscripción.",
|
||||
"paidThrough": "Pagado hasta el {{date}}.",
|
||||
"notEnforced": "Por ahora todas las funciones están habilitadas para todas las cuentas.",
|
||||
"groups": "Grupos",
|
||||
"students": "Alumnos activos"
|
||||
}
|
||||
}
|
||||
91
apps/web/src/i18n/locales/es-AR/billing.json
Normal file
91
apps/web/src/i18n/locales/es-AR/billing.json
Normal file
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"subscribeError": "No pudimos abrir la página de pago. Revisá tu conexión e intentá de nuevo.",
|
||||
"subscribeDescription": {
|
||||
"STRIPE": "Te llevamos a Stripe para cargar tu tarjeta. El cobro es mensual y podés cancelarlo cuando quieras.",
|
||||
"MERCADO_PAGO": "Te llevamos a Mercado Pago para autorizar el débito mensual. Podés cancelarlo cuando quieras."
|
||||
},
|
||||
"features": {
|
||||
"unlimitedGroups": "Grupos ilimitados",
|
||||
"groups_one": "{{count}} grupo",
|
||||
"groups_other": "{{count}} grupos",
|
||||
"unlimitedStudents": "Alumnos ilimitados",
|
||||
"students": "Hasta {{count}} alumnos activos",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsapp": "Mensajes automáticos por WhatsApp"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Activa",
|
||||
"PENDING": "Pendiente de pago",
|
||||
"PAUSED": "Pausada",
|
||||
"CANCELLED": "Cancelada",
|
||||
"NONE": "Sin suscripción"
|
||||
},
|
||||
"usage": "{{used}} de {{limit}}",
|
||||
"notice": {
|
||||
"readOnly": "Tu cuenta está en solo lectura: superás los límites del plan Free. Pasate a Pro o reducí tus alumnos para volver a editar.",
|
||||
"cancelled": "Cancelaste Pro: lo seguís teniendo hasta el {{date}}.",
|
||||
"paymentFailed": "No pudimos cobrar tu suscripción a Pro. Revisá tu medio de pago en {{provider}} antes del {{date}}.",
|
||||
"seePlan": "Ver plan"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Plan",
|
||||
"description": "Tu plan de Gruperly y tus pagos",
|
||||
"readOnly": "Solo lectura"
|
||||
},
|
||||
"subscribe": {
|
||||
"title": "Pasate a Pro",
|
||||
"goTo": "Ir a {{provider}}",
|
||||
"payerEmail": "Email de tu cuenta de Mercado Pago",
|
||||
"payerEmailHint": "Tenés que entrar a Mercado Pago con este mismo email para autorizar el débito mensual.",
|
||||
"opening": "Abriendo…"
|
||||
},
|
||||
"upgrade": {
|
||||
"title": "Disponible en Pro",
|
||||
"later": "Ahora no",
|
||||
"seePlans": "Ver planes"
|
||||
},
|
||||
"cancel": {
|
||||
"title": "Cancelar Pro",
|
||||
"descriptionUntil": "No te vamos a cobrar más. Seguís con Pro hasta el {{date}}; después tu cuenta pasa a Free.",
|
||||
"description": "No te vamos a cobrar más y tu cuenta pasa a Free.",
|
||||
"back": "Volver",
|
||||
"confirm": "Cancelar suscripción",
|
||||
"done": "Cancelaste tu suscripción. Seguís con Pro hasta el fin del período pago.",
|
||||
"error": "No pudimos cancelar la suscripción.",
|
||||
"welcome": "¡Listo! Ya tenés Gruperly Pro."
|
||||
},
|
||||
"option": {
|
||||
"yourPlan": "Tu plan",
|
||||
"free": "Gratis"
|
||||
},
|
||||
"charges": {
|
||||
"title": "Historial de pagos",
|
||||
"approved": "Pagado",
|
||||
"rejected": "Rechazado",
|
||||
"pending": "Pendiente",
|
||||
"in_process": "En proceso",
|
||||
"cancelled": "Cancelado",
|
||||
"refunded": "Devuelto",
|
||||
"prev": "Anteriores",
|
||||
"next": "Siguientes"
|
||||
},
|
||||
"view": {
|
||||
"back": "Ajustes",
|
||||
"title": "Tu plan",
|
||||
"subtitle": "Elegí cómo usar Gruperly.",
|
||||
"perMonth": "{{price}} / mes",
|
||||
"retry": "Reintentar el pago",
|
||||
"upgrade": "Pasar a Pro",
|
||||
"unavailable": "Todavía no está disponible en tu país."
|
||||
},
|
||||
"summary": {
|
||||
"loading": "Consultando tu plan…",
|
||||
"plan": "Plan {{plan}}",
|
||||
"next": "Próximo cobro: {{amount}} el {{date}}",
|
||||
"pending": "Estamos esperando que {{provider}} confirme tu suscripción.",
|
||||
"paidThrough": "Pagado hasta el {{date}}.",
|
||||
"notEnforced": "Por ahora todas las funciones están habilitadas para todas las cuentas.",
|
||||
"groups": "Grupos",
|
||||
"students": "Alumnos activos"
|
||||
}
|
||||
}
|
||||
91
apps/web/src/i18n/locales/pt-BR/billing.json
Normal file
91
apps/web/src/i18n/locales/pt-BR/billing.json
Normal file
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"subscribeError": "Não conseguimos abrir a página de pagamento. Verifique sua conexão e tente novamente.",
|
||||
"subscribeDescription": {
|
||||
"STRIPE": "Vamos te levar ao Stripe para cadastrar seu cartão. A cobrança é mensal e você pode cancelar quando quiser.",
|
||||
"MERCADO_PAGO": "Vamos te levar ao Mercado Pago para autorizar o débito mensal. Você pode cancelar quando quiser."
|
||||
},
|
||||
"features": {
|
||||
"unlimitedGroups": "Grupos ilimitados",
|
||||
"groups_one": "{{count}} grupo",
|
||||
"groups_other": "{{count}} grupos",
|
||||
"unlimitedStudents": "Alunos ilimitados",
|
||||
"students": "Até {{count}} alunos ativos",
|
||||
"mpCharges": "Cobranças com Mercado Pago",
|
||||
"whatsapp": "Mensagens automáticas pelo WhatsApp"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Ativa",
|
||||
"PENDING": "Pagamento pendente",
|
||||
"PAUSED": "Pausada",
|
||||
"CANCELLED": "Cancelada",
|
||||
"NONE": "Sem assinatura"
|
||||
},
|
||||
"usage": "{{used}} de {{limit}}",
|
||||
"notice": {
|
||||
"readOnly": "Sua conta está somente leitura: você ultrapassa os limites do plano Free. Mude para o Pro ou reduza seus alunos para voltar a editar.",
|
||||
"cancelled": "Você cancelou o Pro: ele continua ativo até {{date}}.",
|
||||
"paymentFailed": "Não conseguimos cobrar sua assinatura Pro. Verifique sua forma de pagamento em {{provider}} antes de {{date}}.",
|
||||
"seePlan": "Ver plano"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Plano",
|
||||
"description": "Seu plano do Gruperly e seus pagamentos",
|
||||
"readOnly": "Somente leitura"
|
||||
},
|
||||
"subscribe": {
|
||||
"title": "Mude para o Pro",
|
||||
"goTo": "Ir para {{provider}}",
|
||||
"payerEmail": "E-mail da sua conta do Mercado Pago",
|
||||
"payerEmailHint": "Você precisa entrar no Mercado Pago com este mesmo e-mail para autorizar o débito mensal.",
|
||||
"opening": "Abrindo…"
|
||||
},
|
||||
"upgrade": {
|
||||
"title": "Disponível no Pro",
|
||||
"later": "Agora não",
|
||||
"seePlans": "Ver planos"
|
||||
},
|
||||
"cancel": {
|
||||
"title": "Cancelar Pro",
|
||||
"descriptionUntil": "Não vamos cobrar mais. Você continua com o Pro até {{date}}; depois sua conta passa para o Free.",
|
||||
"description": "Não vamos cobrar mais e sua conta passa para o Free.",
|
||||
"back": "Voltar",
|
||||
"confirm": "Cancelar assinatura",
|
||||
"done": "Você cancelou sua assinatura. O Pro continua até o fim do período pago.",
|
||||
"error": "Não conseguimos cancelar a assinatura.",
|
||||
"welcome": "Pronto! Agora você tem o Gruperly Pro."
|
||||
},
|
||||
"option": {
|
||||
"yourPlan": "Seu plano",
|
||||
"free": "Grátis"
|
||||
},
|
||||
"charges": {
|
||||
"title": "Histórico de pagamentos",
|
||||
"approved": "Pago",
|
||||
"rejected": "Recusado",
|
||||
"pending": "Pendente",
|
||||
"in_process": "Em processamento",
|
||||
"cancelled": "Cancelado",
|
||||
"refunded": "Reembolsado",
|
||||
"prev": "Anteriores",
|
||||
"next": "Próximos"
|
||||
},
|
||||
"view": {
|
||||
"back": "Ajustes",
|
||||
"title": "Seu plano",
|
||||
"subtitle": "Escolha como usar o Gruperly.",
|
||||
"perMonth": "{{price}} / mês",
|
||||
"retry": "Tentar o pagamento de novo",
|
||||
"upgrade": "Mudar para o Pro",
|
||||
"unavailable": "Ainda não está disponível no seu país."
|
||||
},
|
||||
"summary": {
|
||||
"loading": "Consultando seu plano…",
|
||||
"plan": "Plano {{plan}}",
|
||||
"next": "Próxima cobrança: {{amount}} em {{date}}",
|
||||
"pending": "Estamos aguardando o {{provider}} confirmar sua assinatura.",
|
||||
"paidThrough": "Pago até {{date}}.",
|
||||
"notEnforced": "Por enquanto todos os recursos estão liberados para todas as contas.",
|
||||
"groups": "Grupos",
|
||||
"students": "Alunos ativos"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user