This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The Payment Request API defines a consistent user experience across payment methods, payment systems, platforms, and merchants. It is not a new payment method; rather, it is a conduit from the user's preferred payment method to a merchant.
Many problems related to online purchase abandonment can be traced to checkout forms, which are user-intensive, difficult to use, slow to load and refresh, and require multiple steps to complete. The Payment Request API is a system that is meant to eliminate checkout forms. It vastly improves user workflow during the purchase process, providing a more consistent user experience and enabling web merchants to easily leverage disparate payment methods.
To request a payment, a web page creates a PaymentRequest object in response to a user action that initiates a payment, such as clicking a "Purchase" button. The PaymentRequest allows the web page to exchange information with the user agent while the user provides input to complete the transaction.
Note: The API is available inside cross-origin <iframe>
elements only if they have had the allowpaymentrequest
attribute set on them.
PaymentRequest
PaymentRequestUpdateEvent
PaymentResponse
PaymentAddress
BasicCardRequest
BasicCardResponse
Specification | Status | Comment |
---|---|---|
Payment Request API | Candidate Recommendation | Initial definition. |
Basic Card Payment | Working Draft | Defines BasicCardRequest and BasicCardResponse . |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 61 | (Yes) | No support[1] | ? | No support | ? |
Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | No support | 51 | (Yes) | No support[1] | ? | No support | ? |
[1] Supported but disabled on all versions. Hidden behind the dom.payments.request.enabled
pref.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Payment_Request_API