Re: [w3c/browser-payment-api] Use navigator.payments singleton, factory method, or PaymentRequest constructor (#16)

+1 to @adrianhopebailie on namespacing under `navigator.payments`. +1 and @adrianba to avoid factories. I would prefer something like this:
````javascript
var request = navigator.payments.request(supportedMethods, paymentDetails);
request.addEventListener("eventname", e => {/*....*/));
request.show().then(instrumentResponse => {/*....*/}).catch(error => {/*....*/});
````
Then we can place new methods (e.g., registration) under the `navigator.payments` method as well.
```javascript
navigator.payments.register(appData);
````

---
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/browser-payment-api/issues/16#issuecomment-218214401

Received on Tuesday, 10 May 2016 16:45:37 UTC