Re: [w3c/payment-request] Attach 'payment request is showing boolean' to top-level browsing context (#811)

marcoscaceres commented on this pull request.



> @@ -935,9 +934,9 @@ <h2>
           then return <a>a promise rejected with</a> an
           "<a>InvalidStateError</a>" <a>DOMException</a>.
           </li>
-          <li>If the <a>user agent</a>'s <a>payment request is showing</a>
-          boolean is true, then return <a>a promise rejected with</a> an
-          "<a>AbortError</a>" <a>DOMException</a>.
+          <li>If the <a>top-level browsing context</a>'s <a>payment request is

> `window1.PaymentRequest.prototype.show.call(window2PaymentRequestInstance)` 

@domenic, just to make sure I got this right. 

Both of these would theoretically show the payment sheet in the popup: 

```JS
button.onclick = () => {
    const popup = window.open("some.html");
    await new Promise(resolve => (popup.onload = resolve));
    const r = new popup.PaymentRequest(methods, details);
    await r.show();
}
```
And: 

```JS
button.onclick = () => {
    const popup = window.open("some.html");
    await new Promise(resolve => (popup.onload = resolve));
    const r = new popup.PaymentRequest(methods, details);
    await PaymentRequest.prototype.show.call(r);
}
```

Is that correct? .... 

And then could go from `popup.opener`, and show a payment sheet in the opener from the popup.  

I've put up an initial set that use just an iframe:
https://github.com/w3c/payment-request/pull/811

 



-- 
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-request/pull/811#discussion_r237434697

Received on Thursday, 29 November 2018 10:44:22 UTC