'use client' import Link from 'next/link' import { useSearchParams } from 'next/navigation' import { Suspense, useEffect, useState } from 'react' function PaymentSuccessContent() { const searchParams = useSearchParams() const paymentId = searchParams.get('paymentId') const amount = searchParams.get('amount') const currency = searchParams.get('currency') const [invoiceId, setInvoiceId] = useState(null) useEffect(() => { // Fetch the payment to get the invoice ID if (paymentId) { fetch(`/api/demo/payment/${paymentId}`) .then((res) => res.json()) .then((data) => { if (data.success && data.payment?.invoice) { const invId = typeof data.payment.invoice === 'object' ? data.payment.invoice.id : data.payment.invoice setInvoiceId(invId) } }) .catch((err) => { console.error('Failed to fetch payment invoice:', err) }) } }, [paymentId]) return (

Payment Successful!

Your test payment has been processed successfully

Payment Details

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

What's Next?

{invoiceId && (
๐Ÿ“„ View Invoice
See your invoice with custom message
)}
๐Ÿ  Back to Demo
Try another test payment
๐Ÿ’ณ View All Payments
Check payment history in admin
๐Ÿงพ View Invoices
Check invoices in admin

๐Ÿ’ก Demo Tip: This was a simulated payment using the test provider. In production, you would integrate with real providers like Stripe or Mollie.

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