import { define } from "../../../utils.ts"; import { getTransactionByStripeId } from "../../../services/paymentService.ts"; export const handler = define.handlers({ async GET(ctx) { const stripeId = ctx.params.id; if (!stripeId) { return new Response("Not Found", { status: 404 }); } const tx = await getTransactionByStripeId(stripeId); if (!tx) { return new Response("Receipt not found", { status: 404 }); } const amount = tx.amount ?? 0; const date = tx.payment_date || tx.created_on || Date.now(); const leaseId = tx.lease_id || ""; const method = tx.payment_method || "-"; const html = `