Re: [w3c/payment-handler] Define requestPermission() behavior. (#180)

romandev commented on this pull request.



> +                <li>Let <var>permission</var> be the result of running
+                <a data-cite="!permissions#dfn-retrieve-the-permission-state">
+                  retrieve the permission state algorithm</a> of the permission
+                  associated with <a>payment handler</a>'s <a>origin</a>.
+                </li>
+                <li>If <var>permission</var> is "prompt", ask the user whether
+                allowing adding new payment instruments for the <a data-cite=
+                "!HTML#current-settings-object">current settings object</a>'s
+                origin is acceptable. If it is, set <var>permission</var> to
+                "granted", and "denied" otherwise.
+                </li>
+                <li>Resolve <var>p</var> with <var>permission</var>.
+                </li>
+              </ol>
+            </li>
+            <li>Return <var>p</var>

@adrianhopebailie Thank you for review.

As far as I know, we are already using the pattern in many places in this spec or other specs. [1][2]
Resolving the promise will happen in parallel due to the following sentence:
"Run the following steps in parallel:"

So, I think it makes sense. WDYT?
(If I'm missing something, please correct me! :) )

[1] https://w3c.github.io/payment-handler/#has-method
[2] https://w3c.github.io/ServiceWorker/#cache-match

-- 
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/pull/180#discussion_r123441684

Received on Thursday, 22 June 2017 07:49:50 UTC