import { getTranslations, setRequestLocale } from 'next-intl/server' import { claimPaidCheckout } from '@/lib/stripe' import { executeSoapCommand } from '@/lib/soap' import { getPaidService } from '@/lib/paid-services' export const dynamic = 'force-dynamic' export default async function ServiceSuccessPage({ params, searchParams, }: { params: Promise<{ locale: string }> searchParams: Promise<{ service?: string; session_id?: string }> }) { const { locale } = await params setRequestLocale(locale) const { service, session_id } = await searchParams const t = await getTranslations('Paid') const cfg = service ? getPaidService(service) : null // Verifica el pago (una vez) y ejecuta el comando SOAP del servicio. let okName: string | null = null if (cfg && session_id) { const claim = await claimPaidCheckout(session_id) if (claim) { const resp = await executeSoapCommand(cfg.command(claim.characterName)) if (resp !== null) okName = claim.characterName } } return (

{service ? t(`${service}.title`) : ''}

{okName ? (

{t(`${service}.success`, { name: okName })}

) : (

{t('error')}

)}
) }