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

marcoscaceres commented on this pull request.



>                    </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>.

Gecko only does the IDL conversion, because we don't care about any payment method apart from "Basic Card". So, we don't store any `[[serializedMethodData]]` in our code... in fact, I don't see is doing any we JSON serialization of data at all in Gecko's code (@edenchuang?).

From the constructor, we check the method's details:
https://github.com/mozilla/gecko-dev/blob/master/dom/payments/PaymentRequest.cpp#L574  

We then just check `IsValidBasicCardRequest`: 
https://github.com/mozilla/gecko-dev/blob/master/dom/payments/PaymentRequest.cpp#L293

And then we convert it (to check throw if it fails):
https://github.com/mozilla/gecko-dev/blob/master/dom/payments/BasicCardPayment.cpp#L53

[WebKit does do the serialization](https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp#L322) and stores it. However, @aestes also seems to suggest a [preference to not store the JSON serialization](https://github.com/w3c/payment-request/issues/813#issuecomment-441886747): "Browsers could convert from a JS object directly to a IDL dictionary rather than the current JS object > JSON string > JS object > IDL dictionary conversion algorithm".


-- 
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#discussion_r250797544

Received on Thursday, 24 January 2019 22:13:14 UTC