Consolidate Kreditkarte/PayPal into one "Online-Zahlung" checkout option
Both already route through the same Stripe PaymentIntent (automatic_payment_methods: enabled — Stripe's own recommended Payment Element pattern, letting Stripe itself decide which eligible method to show). Pre-selecting one of two identical-behind-the-scenes rows before the payment step was redundant friction, not a real choice. Collapses them into one option with a hint text explaining the actual instrument is picked on the next screen; Überweisung is unaffected. Also refines paymentMethodTitle from a neutral "Online-Zahlung" placeholder (snapshotted at order-creation time, before the customer has picked an instrument) to the real one Stripe reports, once payment confirms — carried through to both the stored order and the sessionStorage snapshot shown on /bestellbestaetigung. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,14 @@ export function VerarbeitungContent() {
|
||||
try {
|
||||
const pending = window.sessionStorage.getItem(PENDING_ORDER_KEY);
|
||||
if (pending) {
|
||||
window.sessionStorage.setItem(ORDER_KEY, pending);
|
||||
// Patch in the real instrument (Kreditkarte/PayPal) now
|
||||
// that it's known — the pending snapshot was written at
|
||||
// checkout submission time with the neutral "Online-
|
||||
// Zahlung" placeholder, before the customer had actually
|
||||
// picked one on the Payment Element.
|
||||
const snapshot = JSON.parse(pending);
|
||||
if (data.paymentMethodTitle) snapshot.paymentMethodTitle = data.paymentMethodTitle;
|
||||
window.sessionStorage.setItem(ORDER_KEY, JSON.stringify(snapshot));
|
||||
window.sessionStorage.removeItem(PENDING_ORDER_KEY);
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user