Re: [w3c/payment-handler] The Open Window Algorithm tries to access [[state]] of a request in a way that doesn't make sense (#192)

I believe we can safely remove the [[state]] check without detrimental effects on the user. 

Consider:

- The openWindow() algorithm already requires a valid PaymentRequestEvent object, which is generated by the PaymentRequest when in "interactive" [[state]].
- During the handling of PaymentRequestEvent, the user should not be able to interact with PaymentRequest UI.
- When the service worker's window has been opened, the user should be able to interact only with the service worker's window.
- When the service worker's window closes itself, the service worker will finally call PaymentRequestEvent.updateWith(), which will move the PaymentRequest [[state]] from "interactive" to "closed" on success. On failure, PaymentRequest [[state]] will remain "interactive."
- If the merchant calls PaymentRequest.abort() at any point during this process, AbortPaymentEvent will be sent to the service worker, allowing it to gracefully close the window. If the service worker does not have a handler for AbortPaymentEvent, then PaymentRequest.abort() promise is rejected. The service worker's window stays open.

Therefore, there's no instance in time when the "interactive" [[state]] check is useful.

-- 
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/192#issuecomment-319679321

Received on Wednesday, 2 August 2017 13:55:21 UTC