'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 (
{getReasonText(reason)}
{getReasonDescription(reason)}
{paymentId}
💡 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.