Añadir ruta /d-points (Adquirir PD) con pasarelas multi-método

Reproduce fielmente el panel de compra de PD de UltimoWoW como componente
cliente con pestañas (Información, PayPal, dLocal Go, Crypto, Skrill y
métodos alternativos por país: Argentina, Chile, Colombia, Perú).

- Página servidor con login requerido (redirige a /login y /select-account
  como battlepay); inyecta username de la cuenta de juego e IP reales.
- Pestañas, tabla de rangos con mostrar/ocultar, y calculadora ARS
  (dolarapi) migradas a estado/efectos de React.
- Formularios con casilla de T&C que habilita el botón; PayPal usa
  PAYPAL_BUSINESS_EMAIL por entorno; dLocal/NOWPayments muestran aviso
  hasta configurar su backend (no se fabrican credenciales/gateways).
- Banderas por país y logo de NOWPayments añadido a nw-logos.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 16:59:53 +00:00
parent c3e57ff25e
commit 44fcedbe62
3 changed files with 858 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import type { Metadata } from 'next'
import { headers } from 'next/headers'
import { setRequestLocale } from 'next-intl/server'
import { redirect } from '@/i18n/navigation'
import { getSession } from '@/lib/session'
import { getRealmName } from '@/lib/realm'
import { PageShell } from '@/components/PageShell'
import { DPointsTabs } from '@/components/DPointsTabs'
export const dynamic = 'force-dynamic'
export const metadata: Metadata = { title: 'Adquirir PD' }
export default async function DPointsPage({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const realm = await getRealmName()
const h = await headers()
const ip = (h.get('x-forwarded-for') || '').split(',')[0].trim() || '0.0.0.0'
const host = h.get('x-forwarded-host') || h.get('host') || ''
const proto = h.get('x-forwarded-proto') || 'https'
const origin = host ? `${proto}://${host}` : ''
// Pasarelas automáticas: se habilitan al configurar sus credenciales por entorno.
const paypalBusiness = process.env.PAYPAL_BUSINESS_EMAIL || ''
return (
<PageShell title="Adquirir PD">
<DPointsTabs
realm={realm}
username={session.username!}
ip={ip}
locale={locale}
origin={origin}
paypalBusiness={paypalBusiness}
/>
</PageShell>
)
}