v148 · Web APIs · Payments
Payment Flow Gate
A checkout that calls the browser's SPC availability API before rendering the payment sheet — showing the SPC passkey button only when the device supports it, and falling back gracefully to a standard payment form otherwise.
Checkout demo
Order summary
Chrome Dev Summit ticket$149.00
Platform showcase book$29.99
Shipping$4.99
Total$183.98
Payment method
SPC capability check
SPC supportedChecking…
Passkey availableChecking…
User verifiedChecking…
How the gate works
- Call the static SPC availability API — check if SPC is available before rendering any payment UI. Current browsers expose
securePaymentConfirmationAvailability(); older trials exposedgetSecurePaymentConfirmationCapabilities(). - Inspect the returned value —
"available"means the frame can start an SPC flow. Other values give a concrete non-availability reason. - Show appropriate UI — if SPC is available, render the passkey button prominently. Otherwise hide it and go straight to card form. No wasted clicks or confusing "not available on this device" errors.
- Invoke payment — call
request.show()only when the user clicks the button for the chosen path, ensuring the gesture requirement is met.
API usage
// Query SPC availability before showing any UI
const availability = await PaymentRequest.securePaymentConfirmationAvailability();
if (availability === "available") {
showSPCButton(); // passkey-authenticated payment
} else {
showCardForm(); // standard card entry fallback
}
// When SPC is available, show() presents the passkey sheet
const request = new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { ... } }], details);
const response = await request.show();
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗