Re: [w3c/webpayments-payment-apps-api] Do we need "Payment Manager" and "Payment Handler"? (#127)

👎  - these are very different things

A **Payment Handler** is a piece of code that _handles_ a [PaymentRequestEvent](https://w3c.github.io/webpayments-payment-apps-api/#dom-paymentrequestevent). This specification defines an extension to `ServiceWorkerGlobalScope` adding the event handler `onpaymentrequest` where developers can attach payment handlers.

On the other hand, a **Payment Manager** is an extension to 'ServiceWorkerRegistration' and is the place where developers define the capabilities of their payment app through addition of instruments to the payment manager.

A developer could install a service worker that has a payment handler and not register any capabilities but the result would be that the handler would never be invoked.

When a user selects an instrument the `onpaymentrequest` event handler on the Service Worker from which that instrument was registered is invoked and the event object contains the instrument identifier allowing the handler to determine which instrument the user selected.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments-payment-apps-api/issues/127#issuecomment-294175061

Received on Friday, 14 April 2017 15:33:57 UTC