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

adrianhopebailie 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>

You are right, happy for you to merge as is. 

I find the pattern used in the Payment Request spec easier to follow. If you agree then perhaps we should change across the document in a new PR?

1. Let `p` be a new Promise
2. Return `p` and perform the remaining steps in parallel.

Example in https://www.w3.org/TR/payment-request/#show-method at step 9.

-- 
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_r123533039

Received on Thursday, 22 June 2017 14:54:17 UTC