'use client' import Link from 'next/link' import { useSearchParams } from 'next/navigation' import { Suspense } from 'react' function PaymentFailedContent() { const searchParams = useSearchParams() const paymentId = searchParams.get('paymentId') const reason = searchParams.get('reason') || 'unknown' const amount = searchParams.get('amount') const currency = searchParams.get('currency') const getReasonText = (reason: string) => { switch (reason) { case 'failed': return 'Payment was declined' case 'cancelled': return 'Payment was cancelled' case 'expired': return 'Payment session expired' default: return 'Payment could not be completed' } } const getReasonDescription = (reason: string) => { switch (reason) { case 'failed': return 'The payment provider declined the transaction. This is a simulated failure for testing purposes.' case 'cancelled': return 'The payment was cancelled before completion. You can try again with a different test scenario.' case 'expired': return 'The payment session timed out. Please create a new payment to try again.' default: return 'An unexpected error occurred during payment processing.' } } return (

Payment {reason.charAt(0).toUpperCase() + reason.slice(1)}

{getReasonText(reason)}

What Happened?

{getReasonDescription(reason)}

{paymentId && (
Payment ID: {paymentId}
)} {amount && currency && (
Amount: {currency.toUpperCase()} {(parseInt(amount) / 100).toFixed(2)}
)}
Status: {reason}

Try Again

🔄 Try Another Payment
Create a new test payment with different scenario
💳 View Payment History
Check all payments in admin

💡 Testing Tip: This failure was simulated using the test provider. Try selecting a different test scenario like "Instant Success" or "Delayed Success" to see a successful payment flow.

) } export default function PaymentFailedPage() { return (
Loading...
}>
) }