import Link from "next/link"; export const dynamic = "force-dynamic"; /** * Payment result landing. Payment gateways/brokers redirect the browser here after * a purchase: /payment/result?status=success|failed&ref=&gateway=. * Coins/plans are activated server-side; this page just reports the outcome. */ export default function PaymentResultPage({ params, searchParams, }: { params: { locale: string }; searchParams: { status?: string; ref?: string; gateway?: string }; }) { const fa = params.locale !== "en"; const success = searchParams.status === "success" || searchParams.status === "Paid"; const ref = typeof searchParams.ref === "string" ? searchParams.ref : ""; const t = { successTitle: fa ? "پرداخت موفق بود" : "Payment successful", successBody: fa ? "پرداخت شما با موفقیت انجام شد و اشتراک‌تان فعال گردید." : "Your payment went through and your plan is now active.", failTitle: fa ? "پرداخت ناموفق بود" : "Payment failed", failBody: fa ? "پرداخت انجام نشد یا لغو شد. اگر مبلغی کسر شده باشد، طی ۷۲ ساعت بازگردانده می‌شود." : "The payment didn't complete or was cancelled. Any charged amount is refunded within 72h.", refLabel: fa ? "کد پیگیری" : "Tracking code", toDashboard: fa ? "رفتن به داشبورد" : "Go to dashboard", retry: fa ? "تلاش دوباره" : "Try again", }; return (
{success ? ( ) : ( )}

{success ? t.successTitle : t.failTitle}

{success ? t.successBody : t.failBody}

{success && ref ? (

{t.refLabel}: {ref}

) : null}
{t.toDashboard} {!success ? ( {t.retry} ) : null}
); }