Re: [w3c/payment-handler] Suggest changing a shape of openWindow() (#300)

Payment handler partners have told us that it's difficult to accurately detect whether the window is opened by a payment handler. So `window.paymentHandler` would be useful for this. Can we find a good use for promises here? For example:

```javascript
if (window.paymentHandler) {
  // This browser has support for payment handlers.
  window.paymentHandler.then(request => {
  // This window was opened by a payment handler.
    request.respondWith(new Promise((accept, reject) => {
      // Do things.
      accept({method: "https://bobpay.xyz", data: {transactionId: "12345"}});
    }));
  });
}
```

-- 
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/payment-handler/issues/300#issuecomment-420395983

Received on Tuesday, 11 September 2018 19:34:00 UTC