Re: [w3c/payment-request] Extensibility of PaymentResponse.complete(result) (#817)

> I think my proposal is already backwards compatible (at least from the perspective of a developer using the API). I've proposed changing the type of the argument from enum to object which I had assumed is non-breaking for any javascript that is calling the API but I don't know enough about the IDL and JS relationship.

Unfortunately, no. It would break :( For enums, IDL binding layer just converts whatever you pass into it into a string, so passing an object would become `"[object Object]"` (which would then throw an error, because it's not a known `PaymentComplete` enum value in a "v1" user agent).

Alternative might be to do `(PaymentComplete or Object)` (I've not checked if that's allowed in WebIDL). If it works, that would allow current things to keep working as they are, but also support passing the object for any new payment method.  

-- 
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/issues/817#issuecomment-455692414

Received on Friday, 18 January 2019 21:26:18 UTC