Payment Request API Demo
Build a browser-native payment sheet with the Payment Request API. The page must run in a secure context (HTTPS or localhost).
Payment request
Creates a PaymentRequest for Google Pay, asks the browser whether it can
handle it, and opens the payment sheet.
${status}
${preview}
What happens
- The sample uses the
https://google.com/paypayment method. - The browser opens its own payment sheet; no card data ever reaches this page.
PaymentRequest.show()resolves with aPaymentResponseonce the user confirms.
If no payment sheet appears, the browser has no configured payment method. Chrome or Edge with a saved card, or Google Pay, works best.