Skip to content

Commit 4b77d58

Browse files
Block a second payment while a 3-D Secure payment is unresolved
Address review feedback on Stripe 3-D Secure support: - Card and express kept separate pending intents, so switching to a wallet after an unclear 3-D Secure outcome could take a second payment. Track the unresolved intent per session in the React Query cache, resumed only by the flow that created it (card and express carry different totals). Confirm and authorize block every other payment method, before anything is sent, with PAYMENT_STILL_CONFIRMING. The express continuation check reads the same entry, so a remount mid-challenge no longer leaves checkout locked. - A cached UNPAID order status could send a paid shopper to returnUrl once the draft order disappeared. Always look the status up again when it's needed, and wait for that lookup before falling back. - Stripe flows replaced codes the confirm hook had already shown (MISSING_SHIPPING_INFO, DRAFT_ORDER_UPDATE_FAILED) with TRANSACTION_PROCESSING_FAILED. Mark those errors as already reported; other failures, such as a bodyless 502 after the challenge, still show TRANSACTION_PROCESSING_FAILED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5a65653 commit 4b77d58

37 files changed

Lines changed: 492 additions & 91 deletions

‎.changeset/bright-cards-handle-3ds.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
Add Stripe 3DS verification support for card and express checkout, with localized payment errors and compatibility with existing checkout error handling.
77

8-
Improve payment retry handling, prevent duplicate submissions, and recognize already-paid orders. Update express payment tracking to reflect the payment method used and successful checkout completion.
8+
Improve payment retry handling, prevent duplicate submissions, and recognize already-paid orders. While a 3-D Secure payment's outcome is unknown, every payment method is blocked from starting another payment for the checkout. Update express payment tracking to reflect the payment method used and successful checkout completion.

‎packages/localizations/src/deDe.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ export const deDe = {
291291
DRAFT_ORDER_RETRIEVAL_FAILED: 'Abrufen der Bestellung fehlgeschlagen',
292292
DATA_SOURCES_NOT_FOUND: 'Datenquellen nicht gefunden',
293293
TRANSACTION_API_NOT_FOUND: 'Transaktions-API-Datenquelle nicht gefunden',
294+
PAYMENT_STILL_CONFIRMING:
295+
'Eine vorherige Zahlung für diese Bestellung wird noch bestätigt. Warte einen Moment oder lade die Seite neu, um den Status zu prüfen.',
294296
PAYMENT_ACTION_REQUIRED:
295297
'Deine Zahlung erfordert eine zusätzliche Bestätigung. Versuche es erneut oder wähle eine andere Zahlungsmethode.',
296298
TRANSACTION_PROCESSING_FAILED:

‎packages/localizations/src/enAu.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ export const enAu = {
278278
DRAFT_ORDER_RETRIEVAL_FAILED: 'Failed to retrieve order',
279279
DATA_SOURCES_NOT_FOUND: 'Data sources not found',
280280
TRANSACTION_API_NOT_FOUND: 'Transaction API data source not found',
281+
PAYMENT_STILL_CONFIRMING:
282+
'A previous payment for this order is still being confirmed. Please wait a moment, or refresh the page to check its status.',
281283
PAYMENT_ACTION_REQUIRED:
282284
'Your payment needs additional verification. Please try again or choose another payment method.',
283285
TRANSACTION_PROCESSING_FAILED: 'Failed to process transaction',

‎packages/localizations/src/enIe.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ export const enIe = {
278278
DRAFT_ORDER_RETRIEVAL_FAILED: 'Failed to retrieve order',
279279
DATA_SOURCES_NOT_FOUND: 'Data sources not found',
280280
TRANSACTION_API_NOT_FOUND: 'Transaction API data source not found',
281+
PAYMENT_STILL_CONFIRMING:
282+
'A previous payment for this order is still being confirmed. Please wait a moment, or refresh the page to check its status.',
281283
PAYMENT_ACTION_REQUIRED:
282284
'Your payment needs additional verification. Please try again or choose another payment method.',
283285
TRANSACTION_PROCESSING_FAILED: 'Failed to process transaction',

‎packages/localizations/src/enUs.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ export const enUs = {
278278
DRAFT_ORDER_RETRIEVAL_FAILED: 'Failed to retrieve order',
279279
DATA_SOURCES_NOT_FOUND: 'Data sources not found',
280280
TRANSACTION_API_NOT_FOUND: 'Transaction API data source not found',
281+
PAYMENT_STILL_CONFIRMING:
282+
'A previous payment for this order is still being confirmed. Please wait a moment, or refresh the page to check its status.',
281283
PAYMENT_ACTION_REQUIRED:
282284
'Your payment needs additional verification. Please try again or choose another payment method.',
283285
TRANSACTION_PROCESSING_FAILED: 'Failed to process transaction',

‎packages/localizations/src/esAr.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ export const esAr = {
284284
DATA_SOURCES_NOT_FOUND: 'Fuentes de datos no encontradas',
285285
TRANSACTION_API_NOT_FOUND:
286286
'Fuente de datos de API de transacciones no encontrada',
287+
PAYMENT_STILL_CONFIRMING:
288+
'Todavía se está confirmando un pago anterior de este pedido. Espera un momento o actualiza la página para ver su estado.',
287289
PAYMENT_ACTION_REQUIRED:
288290
'Tu pago requiere una verificación adicional. Inténtalo de nuevo o elige otro método de pago.',
289291
TRANSACTION_PROCESSING_FAILED: 'Error al procesar transacción',

‎packages/localizations/src/esCl.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ export const esCl = {
286286
DATA_SOURCES_NOT_FOUND: 'Fuentes de datos no encontradas',
287287
TRANSACTION_API_NOT_FOUND:
288288
'Fuente de datos de API de transacción no encontrada',
289+
PAYMENT_STILL_CONFIRMING:
290+
'Todavía se está confirmando un pago anterior de este pedido. Espera un momento o actualiza la página para ver su estado.',
289291
PAYMENT_ACTION_REQUIRED:
290292
'Tu pago requiere una verificación adicional. Inténtalo de nuevo o elige otro método de pago.',
291293
TRANSACTION_PROCESSING_FAILED: 'Error al procesar transacción',

‎packages/localizations/src/esCo.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ export const esCo = {
284284
DATA_SOURCES_NOT_FOUND: 'Fuentes de datos no encontradas',
285285
TRANSACTION_API_NOT_FOUND:
286286
'Fuente de datos de API de transacciones no encontrada',
287+
PAYMENT_STILL_CONFIRMING:
288+
'Todavía se está confirmando un pago anterior de este pedido. Espera un momento o actualiza la página para ver su estado.',
287289
PAYMENT_ACTION_REQUIRED:
288290
'Tu pago requiere una verificación adicional. Inténtalo de nuevo o elige otro método de pago.',
289291
TRANSACTION_PROCESSING_FAILED: 'Error al procesar transacción',

‎packages/localizations/src/esEs.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ export const esEs = {
287287
DATA_SOURCES_NOT_FOUND: 'Fuentes de datos no encontradas',
288288
TRANSACTION_API_NOT_FOUND:
289289
'Fuente de datos de la API de transacciones no encontrada',
290+
PAYMENT_STILL_CONFIRMING:
291+
'Todavía se está confirmando un pago anterior de este pedido. Espera un momento o actualiza la página para ver su estado.',
290292
PAYMENT_ACTION_REQUIRED:
291293
'Tu pago requiere una verificación adicional. Inténtalo de nuevo o elige otro método de pago.',
292294
TRANSACTION_PROCESSING_FAILED: 'No se pudo procesar la transacción',

‎packages/localizations/src/esMx.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ export const esMx = {
284284
DATA_SOURCES_NOT_FOUND: 'Fuentes de datos no encontradas',
285285
TRANSACTION_API_NOT_FOUND:
286286
'Fuente de datos de API de transacciones no encontrada',
287+
PAYMENT_STILL_CONFIRMING:
288+
'Todavía se está confirmando un pago anterior de este pedido. Espera un momento o actualiza la página para ver su estado.',
287289
PAYMENT_ACTION_REQUIRED:
288290
'Tu pago requiere una verificación adicional. Inténtalo de nuevo o elige otro método de pago.',
289291
TRANSACTION_PROCESSING_FAILED: 'Error al procesar transacción',

0 commit comments

Comments
 (0)