Hide failed-payment order attempts from the customer's own order history
A cancelled order with no invoiceNumber is a Stripe payment that never succeeded (failed or timed out before ever reaching received/invoiced), not a real cancellation of something that actually happened — from the customer's point of view it was never really an order. Filtered out of getCustomerOrders/getCustomerOrderDetail by default; the row stays in Payload for admin/audit purposes (shown there as "Zahlung fehlgeschlagen", see backend). getCustomerOrderDetail's filter is opt-in via a new optional parameter, not the default — /api/checkout/status/route.ts's post-payment polling needs to keep seeing exactly this order to show the "Zahlung fehlgeschlagen, bitte erneut versuchen" retry state. The GDPR export route also opts out for the same reason a legal completeness export can't silently drop rows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,7 +33,7 @@ export default async function KontoBestellungDetailPage({ params }: { params: Pr
|
||||
const session = await getSessionCustomer();
|
||||
if (!session) redirect("/konto/login");
|
||||
|
||||
const order = await getCustomerOrderDetail(session.token, session.customer.id, decodeURIComponent(orderNumber));
|
||||
const order = await getCustomerOrderDetail(session.token, session.customer.id, decodeURIComponent(orderNumber), true);
|
||||
if (!order) notFound();
|
||||
|
||||
const address =
|
||||
|
||||
Reference in New Issue
Block a user