v149 · Web APIs · Payments

Merchant Decision Tree

After PaymentRequest.show() rejects, the err.name tells you exactly what happened. This decision tree maps every relevant error name to the correct merchant-side UX action — run a scenario to see where the real browser result routes.

Payment handler setup

Install the handler, then run an outcome. The decision card uses the actual resolved response or caught DOMException.
PaymentRequest.show() rejects catch (err) — inspect err.name
if err.name === "AbortError" User deliberately cancelled the payment sheet.
Show "Continue Shopping" Respect the user's decision. Do NOT auto-retry. Surface a polite dismissal UI.
else if err.name === "OperationError" Internal payment app failure — inspect err.message for detail.
Retry or offer alternative method Log err.message, offer a retry button, surface a fallback payment option.
else if err.name === "NotSupportedError" No handler registered for the requested payment method.
Fall back to a different method Remove unsupported method from supportedMethods and re-instantiate.
else SecurityError / TypeError / … API misuse, missing user activation, or policy block.
Show generic error + log These indicate a code or config bug — surface an apology, log to your error tracker.
Run an outcome
Recommended action — Success

    copyable branch

    try {
      const response = await request.show();
      await response.complete('success');
    } catch (err) {
      if (err.name === 'AbortError') {
        showContinueShopping();
      } else if (err.name === 'OperationError') {
        offerRetryOrAlternative(err.message);
      } else if (err.name === 'NotSupportedError') {
        switchToSupportedPaymentMethod();
      } else {
        logPaymentRequestBug(err.name, err.message);
        showGenericPaymentError();
      }
    }

    see also