Re: [w3c/payment-request] proposed addition: passing data on complete() (PR #982)

@dcrousso commented on this pull request.



> @@ -2084,6 +2116,40 @@ <h2>
           </li>
           <li>Set |response|.{{PaymentResponse/[[complete]]}} to true.
           </li>
+          <li class="addition proposed">Let |serializedData| be the result of
+          <a>JSON-serializing</a> |details|.{{PaymentCompleteDetails/data}}
+          into a string.
+          </li>
+          <li class="addition proposed">If serializing [=exception/throws=] an
+          exception, return <a>a promise rejected with</a> that exception.
+            <div class="issue">
+              What should happen if an exception is thrown here? Should we

I think we might want to wait to set `response.[[complete]]` to `true` until after we JSON serialize, re-parse, and convert to IDL so that if something happens we can re-call `complete()` (as otherwise the step 2 would always fail).

Also, I wonder if we should wait to set `response.[[complete]]` until right before we resolve the returned promise so that if for some reason the user agent finds issue with the data when it attempts to close the payment UI then the developer can still recover (just like the above)?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/pull/982#pullrequestreview-857266949
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/payment-request/pull/982/review/857266949@github.com>

Received on Wednesday, 19 January 2022 19:41:43 UTC