Re: [w3c/browser-payment-api] Is PaymentResponse.details the result of a JSON.parse() (#526)

> On 8 May 2017, at 8:32 pm, Adrian Hope-Bailie <notifications@github.com> wrote:
> 
> The PaymentMethodData.data member (in the request) is described as being an object that is "JSON.serialized" but the definition for PaymentResponse.details (in the response) doesn't indicate if this will be a deserialized JSON string or how the API will behave if the data is a String and cannot be deserialized.
> 
> The algorithm describes details says:
> 
> Set the details attribute value of response to an object containing the payment method specific message that will be used by the merchant to process the transaction. The format of this response will be defined for each payment method.
> 
> Currently only 1 payment method has been implemented, basic-card and the format of the response data is defined as an instance of the BasicCardResponse dictionary.
> 
> As a developer, can I type check this response?
> 
Only against Object (or possibly null, but need to check... typing this on my phone)

> Can I check for the presence of the BasicCardResponse dictionary type in the global namespace?
> 

No. Dictionaries are just JS Objects, not "interfaces". Only interfaces are exposed on the global object. 

> If so, will the same be true for other payment methods like credit-transfer and tokenization?
> 

As above. 

> Alternatively, is the result just an object and the WebIDL just defines the basic structure?
> 

Yep. This☝🏼. 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
> 


-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/browser-payment-api/issues/526#issuecomment-299848241

Received on Monday, 8 May 2017 12:01:52 UTC