Re: [w3c/browser-payment-api] fix: delegate total and error member checks to WebIDL (#425)

domenic commented on this pull request.

A number of nits, but the structure looks great now.

> @@ -1822,8 +1851,8 @@
         <p>
           If the web page wishes to update the payment request then it should
           call <a>updateWith()</a> and provide a promise that will resolve with
-          a <a>PaymentDetails</a> dictionary containing changed values that the
-          <a>user agent</a> SHOULD present to the user.
+          a <a>PaymentDetailsBase</a> dictionary containing changed values that

PaymentDetailsUpdate, right?

> @@ -1927,45 +1956,46 @@
               <var>value</var>:
               <ol>
                 <li>Let <var>details</var> be the result of <a>converting</a>
-                <var>value</var> to a <a>PaymentDetails</a> dictionary. If this
-                <a>throws</a> an exception, abort these substeps, and
+                <var>value</var> to a <a>PaymentDetailsBase</a> dictionary. If

PaymentDetailsUpdate

>                  optionally show an error message to the user.
                 </li>
-                <li>If the <a data-lt="PaymentDetails.total">total</a> member
-                of <var>details</var> is present, then:
+                <li>If the <a data-lt="PaymentDetailsInit.total">total</a>

PaymentDetailsBase.total, here and below

> +      </pre>
+      <p>
+        The <a>PaymentDetailsInit</a> dictionary is used in the construction of
+        the payment request.
+      </p>
+      <p>
+        In addition to the members inherited from the <a>PaymentDetailsBase</a>
+        dictionary, the following members are part of the
+        <a>PaymentDetailsInit</a> dictionary:
+      </p>
+      <dl>
+        <dt>
+          <dfn>total</dfn>
+        </dt>
+        <dd>
+          See <a>PaymentDetailsBase.total</a>.

DictionaryName.memberName notation is not great and should not be exposed publicly. I'd do `<a>PaymentDetailsBase</a>'s <a data-lt="PaymentDetailsBase.total">total</a>`.

> @@ -1008,41 +1001,30 @@
 }
       </pre>
     </section>
-    <section data-dfn-for="PaymentDetails" data-link-for="PaymentDetails">
+    <section data-dfn-for="PaymentDetailsBase" data-link-for=

It might be nice to nest these three sections under a single section (e.g. "Payment details dictionaries")

> @@ -1054,7 +1036,8 @@
           shipping. It is optional to provide this information.
           <p class="note">
             It is the developer's responsibility to verify that the <a data-lt=
-            "PaymentDetails.total">total</a> amount is the sum of these items.
+            "PaymentDetailsInit.total">total</a> amount is the sum of these

PaymentDetailsBase

>            method identifiers</a> in the <code>supportedMethods</code> field.
           This field is commonly used to add a discount or surcharge line item
           indicating the reason for the different <code>total</code> amount for
           the selected <a>payment method</a> that the user agent MAY display.
           <p class="note">
             It is the developer's responsibility to verify that the <a data-lt=
-            "PaymentDetails.total">total</a> amount is the sum of the
-            <a data-lt="PaymentDetails.displayItems">displayItems</a> and the
-            <a>additionalDisplayItems</a>.
+            "PaymentDetailsInit.total">total</a> amount is the sum of the

PaymentDetailsBase

-- 
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/browser-payment-api/pull/425#pullrequestreview-23281964

Received on Wednesday, 22 February 2017 17:40:19 UTC