diff --git a/index.html b/index.html index e2f5926..5f06879 100644 --- a/index.html +++ b/index.html @@ -119,23 +119,22 @@
- A payment app is a Web application that manages payment - requests on behalf of the user by supporting one or more payment - methods. To enable a Web application to handle payment requests, this - specification defines: + A payment app is a Web application that can handle payment + requests on behalf of the user. This specification defines a number of + new Web platform features to handle payment requests:
@@ -335,18 +334,6 @@
- A Payment Handler is a function registered by the user with - the user agent to handle PaymentRequestEvents. -
-- Issue - 97. The distinction between Payment Handler and Payment Manager is - not clear. There is a proposal to remove the phrase Payment Manager - from the spec, renaming the "PaymentManager" interface the - "PaymentHandler" interface. -
In this document we envision the following flow:
@@ -362,13 +349,11 @@- This specification does not address activities outside this flow, - including: -
-- Thus, an origin will rely on many other Web technologies defined - elsewhere for lifecycle management, security, user authentication, user - interaction, and so on. +
+ An origin may implement a payment app with more than one service worker + and therefore multiple payment handlers may be registered per + origin. The handler that is invoked is determined by the selection made + by the user of a payment + instrument. The service worker which stored the payment instrument with its + PaymentManager + is the one that will be invoked.
++ The logic of a payment handler is driven by the payment methods that + it supports. Some payment methods, such as basic-card expect + little to no processing by the payment handler which simply returns + payment card details in the response. It is then the job of the payee + website to process the payment using the returned data as input. +
++ In contrast, some payment methods, such as a crypto-currency payments + or bank originated credit transfers, require that the payment handler + initiate processing of the payment. In such cases the payment handler + will return a payment reference, endpoint URL or some other data that + the payee website can use to determine the outcome of the payment (as + opposed to processing the payment itself). +
++ Handling a payment request may include numerous interactions: with + the user through a new window or other APIs (such as + [[!WebCryptoAPI]]) or with other services and origins through web + requests or other means. +
++ This specification does not address these activities that occur + between the payment handler accepting the PaymentRequestEvent + and the payment handler returning a response. All of these activities + which may be required to configure the payment handler and handle the + payment request, are left to the implementation of the payment + handler, including: +
++ Thus, an origin will rely on many other Web technologies defined + elsewhere for lifecycle management, security, user authentication, + user interaction, and so on. +
+ServiceWorkerRegistration
interface
This specification extends the ServiceWorkerRegistration - interface. + interface with the addition of a paymentManager attribute.
partial interface ServiceWorkerRegistration { readonly attribute PaymentManager paymentManager; };-
- Issue - 127: The distinction is unclear. A proposal is to remove the - phrase Payment Manager from the spec, renaming the "PaymentManager" - interface the "PaymentHandler" interface. -
+ The PaymentManager is used by payment apps to manage + their associated wallets, instruments and supported payment methods. +
This attribute allows manipulation of payment instruments - associated with a payment handler. To be presented to the user as - part of the payment request flow, payment handlers must have at - least one registered payment Instrument, and that Instrument needs - to match the payment methods and required capabilities specified by - the payment request. + associated with a service worker (and therefore its payment + handler). To be a candidate payment handler, a handler must have at + least one registered payment instrument to present to the user. + That instrument needs to match the payment methods and required + capabilities specified by the payment request.
- This attribute allows payment handlers to group payment instruments - together and provide a name and icon for such a group (e.g., to - group together "business account" payment instruments separately - from "personal account" payment instruments). The use of this - grouping mechanism by payment handlers is completely optional. If - payment handlers use this grouping mechanism, then matching payment - instruments that do not appear in any groups should still be - presented to users by the browser for selection. + This attribute allows the Payment Manager to group payment + instruments together and provide a name and icon for such a group + (e.g., to group together "business account" payment instruments + separately from "personal account" payment instruments). The use of + this grouping mechanism by payment handlers is completely optional. + If payment handlers use this grouping mechanism, then matching + payment instruments that do not appear in any groups should still + be presented to users by the user agent for selection.
- Issue - 94. The means for code requesting permission to handle payments - is not yet defined. +
+ The means for code requesting permission to handle payments is not + yet defined.
The user agent is NOT REQUIRED to prompt the user to grant @@ -556,13 +579,10 @@
- Issue - 98: Should the API support providing grouping information - ("wallets") to the user agent? What should requirements be on user - agents to display or provide for user interaction with this - information? + "Support grouped display of payment instruments?" data-number="98"> + Should the API support providing grouping information ("wallets") to + the user agent? What should requirements be on user agents to display + or provide for user interaction with this information?
- Issue - 129: This clear() method intends to address the issue. -
+- Issue - 125: ImageObjects comes from the Web App Manifest specification. - Should we reference the definition normatively, or make use of a - simpler structure here? +
+ ImageObjects comes from the Web App Manifest specification. Should we + reference the definition normatively, or make use of a simpler + structure here?
- Where it appears, The walletKey argument is a unique + Wallets are collections of payment instruments. +
++ Where it appears, the walletKey argument is a unique identifier for the wallet.
- Issue - 129: This clear() method intends to address the issue. -
+The following example shows how to register a payment handler:
-- Issue - 94. + requestPermission() is not yet defined. The code below is based on one potential model, but this is likely to change. @@ -1111,9 +1122,10 @@
After applying the matching algorithm defined in Payment Request API, - the user agent displays a list of matching origins for the user to make - a selection. This specification includes a limited number of display - requirements; most user experience details are left to implementers. + the user agent displays a list of instruments from matching payment + apps for the user to make a selection. This specification includes a + limited number of display requirements; most user experience details + are left to implementers.
- Issue - 116: The second bullet above may be deleted based on + The second bullet above may be deleted based on PR API issue 481.
@@ -1159,18 +1170,15 @@- Issue - 74: The Working Group has discussed two types of merchant - preferences related to payment apps: (1) highlighting - merchant-preferred payment apps already registered by the user and - (2) recommending payment apps not yet registered by the user. The - current draft of the specification does not address either point, and - the Working Group is seeking feedback on the importance of these use - cases. Note that for the second capability, merchants can recommend - payment apps through other mechanisms such as links from their web - sites. +
+ The Working Group has discussed two types of merchant preferences + related to payment apps: (1) highlighting merchant-preferred payment + apps already registered by the user and (2) recommending payment apps + not yet registered by the user. The current draft of the + specification does not address either point, and the Working Group is + seeking feedback on the importance of these use cases. Note that for + the second capability, merchants can recommend payment apps through + other mechanisms such as links from their web sites.
The user agent MUST enable the user to - select any displayed Instrument. + select any displayed instrument.
- Issue - 98. There has been pushback to always requiring display of - instruments (e.g., on a mobile devices). User agents can - incrementally show instruments. Or user agents can return an empty - Instrument ID and it becomes the payment app's responsibility to - display instruments to the user. +
+ There has been push-back to always requiring display of instruments + (e.g., on a mobile devices). User agents can incrementally show + instruments. Or user agents can return an empty Instrument ID and it + becomes the payment app's responsibility to display instruments to + the user.
- A Wallet is a grouping of Instruments for display + A Wallet is a grouping of instruments for display purposes.
To enable developers to build payment apps in a variety of ways, we - decouple the registration (and subsequent display) of Instruments + decouple the registration (and subsequent display) of instruments from how payment handlers respond to a PaymentRequestEvent. However, the user agent is responsible for communicating the user's selection in the event. @@ -1246,16 +1252,13 @@
- Issue - 98. Should we require that, if displayed, individual Instruments - must be selectable? Or should we allow flexibility that Instruments - may be displayed, but selecting any one invokes all registered - payment handlers? One idea that has been suggested: the user agent - (e.g., on a mobile device) could first display the app-level - icon/logo. Upon selection, the user agent could display the - Instruments in a submenu. +
+ Should we require that, if displayed, individual instruments must be + selectable? Or should we allow flexibility that instruments may be + displayed, but selecting any one invokes all registered payment + handlers? One idea that has been suggested: the user agent (e.g., on + a mobile device) could first display the app-level icon/logo. Upon + selection, the user agent could display the Instruments in a submenu.
- Issue - 117: Payment Request API supports delegation of responsibiliyt to - manage an abort to a payment app. There is a proposal to add a + "Support for Abort() being delegated to Payment Handler" data-number= + "117"> + Payment Request API supports delegation of responsibility to manage an + abort to a payment app. There is a proposal to add a paymentRequestAborted event to the Payment Handler interface. The event will have a respondWith method that takes a boolean parameter indicating if the paymentRequest has been successfully aborted. @@ -1394,11 +1396,11 @@
- Issue - 123: Should payment apps receive user data stored in the user - agent upon explicit consent from the user? The payment app could - request permission either at installation or when the payment app is - first invoked. +
+ Should payment apps receive user data stored in the user agent upon + explicit consent from the user? The payment app could request + permission either at installation or when the payment app is first + invoked.
-- Issue - 119: For DOM events compatibility, need to add a constructor, and - the members of the corresponding dictionary need to match the - attributes of the event. +
+ For DOM events compatibility, need to add a constructor, and the + members of the corresponding dictionary need to match the attributes + of the event.
Upon receiving a PaymentRequest by way of PaymentRequest.show() and - subsequent user selection of a payment handler, the user agent - MUST run the following steps: + subsequent user selection of a payment instrument, the user + agent MUST run the following steps:
- Issue - 115: This algorithm resembles the + This algorithm resembles the Open Window Algorithm in - the Service Workers specification. Should we refer to the Service - Workers specification instead of copying their steps? See also - issue - 97 on the algorithm to open windows. + the Service Workers specification. +
++ Should we refer to the Service Workers specification instead of + copying their steps?
- Issue - 128: The Web Payments Working Group plans to revisit these two - examples. +
+ The Web Payments Working Group plans to revisit these two examples.
Using the simple scheme described above, a trivial HTML page that is @@ -2051,7 +2045,7 @@
The Web Payments Working Group is also discussing Payment App authenticity; see the (draft) + "https://w3c.github/webpayments/proposals/Payment-Manifest-Proposal.html"> Payment Method Manifest.