v149 · Payments · demo

Error Signal Tester

Trigger each error scenario and observe how PaymentRequest.show() rejects with a named DOMException that precisely identifies what happened.

Checking Payment Request support…
Install the same-origin payment handler before running a scenario.

Payment succeeds

Handler completes successfully. show() resolves with a PaymentResponse.

User cancels

User presses "Cancel" in the payment UI. Handler throws an AbortError.

Internal app error

Payment app crashes or hits a bug. Handler throws an OperationError.

Unsupported method

A merchant asks for a payment method URL with no registered handler. The browser should fall through as NotSupportedError.

Missing activation

A broken caller waits for a timer before show(). Some configurations reject with SecurityError because the user gesture was lost.

Press a scenario button above to invoke PaymentRequest.show().
Raw browser result will appear here after a run.
// merchant page — Chrome 149+
async function checkout() {
  const request = new PaymentRequest(methodData, details);

  try {
    const response = await request.show();
    await response.complete('success');
    showConfirmation(); // payment completed
  } catch (err) {
    if (err.name === 'AbortError') {
      // User explicitly cancelled — respect their decision
      showCancelMessage();
    } else if (err.name === 'OperationError') {
      // Internal payment handler failure — try a fallback
      retryWithFallbackMethod();
    } else {
      // Some other error (NotSupportedError, SecurityError, etc.)
      showGenericError(err.message);
    }
  }
}

// payment handler service worker — Chrome 149+
self.addEventListener('paymentrequest', event => {
  event.respondWith(async () => {
    try {
      const result = await runPaymentFlow();
      return result; // success
    } catch (err) {
      if (err.userCancelled) {
        throw new DOMException('User cancelled', 'AbortError');     // Chrome 149 distinguishes cancellation
      } else {
        throw new DOMException('App crashed', 'OperationError');    // Chrome 149 distinguishes app failure
      }
    }
  });
});

see also