[w3c/payment-handler] Structured clone usage seems wrong (#265)

> Set the total attribute of e to a structured clone of the total field on the PaymentDetailsInit from the corresponding PaymentRequest. 

> Set outData.data to a structured clone of inData.data. 

> Set outModifier.total to a structured clone of inModifier.total. 

For the totals, you don't need to structured clone IDL values; you can just create a new PaymentCurrencyAmount dictionary with the same field values. Structured clone is meant to be used on arbitrary user data.

For the data field, you should be looking at https://www.w3.org/TR/payment-request/#dfn-serializedmethoddata. These are stored as strings. You want to JSON parse those strings, I believe.

-- 
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/issues/265

Received on Friday, 16 March 2018 03:00:00 UTC