Allow switching an unpaid Überweisung order to Stripe payment
New "Zahlungsart ändern" button on the account order detail page, shown for a still-'received', still-manual (Überweisung) order when an active Stripe payment method exists. Reuses PaymentStep (the same Stripe Payment Element checkout uses) and /checkout/verarbeitung's polling logic (both now take a returnContext prop/param to land back on the order page instead of clearing the cart and redirecting to /bestellbestaetigung). Also: - Payment status badge (Offen/Bezahlt/...) next to the existing Zahlungsart display on the order detail page. - A one-line mention of the switch option in the Vorkasse unpaid notice in the order-confirmation email, shown only when a Stripe option is actually active (hasOnlinePaymentOption). - CustomerOrderDetail gained paymentProvider (was missing from the type entirely, even though the field already existed on the order). Backend counterpart: docker/payload's switchPaymentToStripeEndpoint.
This commit is contained in:
@@ -523,6 +523,10 @@ export async function getCustomerOrders(token: string, customerId: number, exclu
|
||||
|
||||
export type CustomerOrderDetail = CustomerOrder & {
|
||||
id: number;
|
||||
// 'manual' (Überweisung) vs 'stripe' (Kreditkarte/PayPal) — see
|
||||
// api/account/orders/[orderNumber]/switch-to-stripe/route.ts, which only
|
||||
// offers a payment-method switch for a still-'manual' order.
|
||||
paymentProvider: "manual" | "stripe";
|
||||
// 'not_applicable' for Überweisung orders (never gated); see
|
||||
// spicy-leaping-pizza.md §1 — read by /api/checkout/status for the
|
||||
// post-Stripe-redirect polling page.
|
||||
|
||||
Reference in New Issue
Block a user