The Payment Request API allows web sites selling goods and services to utilize one or more payment methods through the browser. The browser then facilitates the payment flow between merchant and user.
Initial implementation is going to be limited to “basic card” payments, based on a wallet Firefox will manage… The Firefox folks will have UI mockups and further details about the wallet (and security aspects), as it's outside the scope of the Platform work (but we are working together on it as a team).
At time of writing, the interface are limited to the following methods and event handlers. However, this is subject to change as the spec is still evolving (there are also attributes, but I’ve omitted them as they mostly reflect what goes into the constructor). New methods/attributes/events will be sent with a new intent to implement:
### interface `PaymentRequest`
How a developer requests payment.
- promise show() - request show payment panel.
- promise abort() - request close payment panel, aborting the payment.
- promise canMakeActivePayment()* - not in spec, proposed by Google.
- Events (see PaymentRequestUpdateEvent):
For discussion around canMakeActivePayment(), please see:
### interface `PaymentResponse`
The resulting response from the end-user.
- promise complete() - let’s you know when the flow is done.
### interface `PaymentRequestUpdateEvent`
- updateWith(Promise<PaymentDetails> d) - request an update be made to the payment panel with new payment details.
### interface `PaymentAddress`
A serializable object that represents a physical address in the real world… trying to get this changed to a dictionary, as it's just a bunch of DOM Strings, and an array.
### Extension to IFRAMEs
The API also extends the `HTMLIframeElement` interface by adding a new attribute:
* allowPaymentRequest - defaults to false. Similar in behavior to `.allowFullScreen`.
## Link to standard
## Platform coverage
Desktop first, Android later.
## Estimated or target release:
Sometime in 2017 - not sure yet.
## Preference behind which this will be implemented:
## DevTools bug:
## Do other browser engines implement this?
Chrome for Android release 53.
Blink-dev intent to ship:
According to Microsoft’s Platform Status, the feature is “in development” in Edge.
Initial tests have been taken from Chrome’s implementation. However, these have not yet been verified by us, nor merged into the the web platform tests. We intend for those to be merged, and for us to contribute additional tests there.