Re: [w3c/payment-handler] Just-in-time payment handler install (#240)

@rsolomakhin, I totally support your idea. I have some questions.

> Otherwise, if the header is present, the browser shows the payment sheet with a prompt Install a payment app from https://bobpay.xyz/pay? [ ALLOW ] [ DENY ].

Does it provide only if there is only one item of supportedMethods array?
If two methods are not installed as follows, how it works?

```js
new PaymentRequest([{
    supportedMethods: 'https://bobpay.xyz/pay'
  }, {
    supportedMethods: 'https://hellopay.xyz/pay'
  }], shoppingCart).show();
```

BTW, is there any reason to have to pop up window here?
You already said that you'd like to install SW and instruments data silently without any user consent(in #239 issue). And then the user will have the opportunity to allow or deny the payment handlers when PaymentRequest.show() is called.
Then, if merchant site writes code as follows, the SW and instruments data are registered silently and users can just decided whether allow the payment handler or not.

```html
<!-- In merchant.com -->
<iframe src="https://hellopay.com/register" style="display: none"></iframe>

<!-- In hellopay.com -->
<script>
navigator.serviceWorker.register("payment-handler.js");
const reg = navigator.serviceWorker.ready;
reg.paymentManager.paymentInstruments.set(...);
</script>
```
WDYT?

-- 
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/240#issuecomment-348919772

Received on Monday, 4 December 2017 10:21:36 UTC