Re: [w3c/payment-request] fix: convert PaymentMethodData.data (#812)

domenic requested changes on this pull request.

Can you separate the editorial changes (removing lots of `data-lt`s) from the normative ones, to make this easier to review? I think I found the big normative change and the issue with it, but it's hard to tell what else might be there.

>                    </li>
-                  <li>Add the tuple (<var>paymentMethod</var>.<a data-lt=
-                  "PaymentMethodData.supportedMethods">supportedMethods</a>,
-                  <var>serializedData</var>) to
-                  <var>serializedMethodData</var>.
+                  <li>Append <var>paymentMethod</var> to
+                  <var>paymentMethods</var>.

So the problem with not storing the JSON serialized version is that the JSON serialization now becomes meaningless. Consider the following:

```js
const bcr1 = { supportedNetworks: new Set("foo", "bar") };
```

With the new spec, the JSON-serialization will be `{ "supportedNetworks": {} }`. But the value stored in _paymentMethods_ will be `{ supportedNetworks: ["foo", "bar"] }` since Web IDL dictionary conversion converts all iterables to sequences.

This means that if someone, e.g., passed the JSON serialization across a process boundary and used it to attempt to reconstruct the result on the other side, they would not be able to match the spec. I thought our original spec was motivated exactly by that design.

-- 
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-request/pull/812#pullrequestreview-196243381

Received on Thursday, 24 January 2019 20:53:02 UTC