- From: Marcos Cáceres <notifications@github.com>
- Date: Mon, 08 Oct 2018 19:56:38 -0700
- To: w3c/payment-request <payment-request@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 9 October 2018 02:56:59 UTC
> I don't think that's a great API design as I can see authors doing something like: Agree, but it's not uncommon with dictionaries to do: ```JS { phone: isValid(phone) ? "Phone is invalid" : undefined; } ``` Which the IDL layer will treat as "not passed". > I guess since we're currently using DOMString, authors can't use "", null, or undefined in a ternary to mean "no error" like in my example above as it won't give the expected result. I wonder if we should have used DOMString? to allow that? Making `null` mean default also feels a bit weird, tbh. > What's the rational for Safari having this behaviour? So that merchants don't have to provide their own strings and therefore have inconsistency between sites? @aestes? (I'm guessing is for consistently error messages that also get localized for free) I'm happy to concur on this. Worst case, internally, in Firefox: ```JS payerInput.setCustomValidity( "payer" in errors === false ? "" : errors.payer === "" ? defaultError : errors.payer ) ``` -- 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/792#issuecomment-428042953
Received on Tuesday, 9 October 2018 02:56:59 UTC