Files
pagodera/app/api/donations/status/route.ts
T
Evandro Fonseca Junior 8271d1fa31 feat(thank-you-page): convert to client component with confetti and UI enhancements
- Changed from server to client component to enable interactive features like confetti animation
- Removed server-side translations and hardcoded Portuguese text for simplicity
- Added confetti effect on page load and improved success icon with animations
- Updated buttons and share functionality for better user experience
- This enhances the donation thank you page with celebratory elements and client-side interactivity
2025-10-26 22:12:43 -03:00

33 lines
829 B
TypeScript

import { NextRequest, NextResponse } from "next/server";
import { getPaymentStatus } from "@/lib/payment-cache";
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.url);
const pixId = searchParams.get("pixId");
if (!pixId) {
return NextResponse.json(
{ error: "pixId é obrigatório" },
{ status: 400 }
);
}
const status = getPaymentStatus(pixId);
return NextResponse.json({
pixId,
paid: status?.paid || false,
paidAt: status?.paidAt,
amount: status?.amount,
anonymous: status?.anonymous,
});
} catch (error) {
console.error("Erro ao verificar status do pagamento:", error);
return NextResponse.json(
{ error: "Erro ao verificar status" },
{ status: 500 }
);
}
}