Re: [w3c/browser-payment-api] Make updateWith() reject the show() promise on validation failures (#451)

>> Is the behavior for the error member correct? Or should the presence of that lead to the UA ignoring everything else and just showing the error?
>
> Hmm... good question... it feels like you could do both: update things, but also show an error as needed. Not sure what implementations are doing today.

Current behavior is the following:

1. If shipping options are empty and error is present:
    1. Re-enable interaction with user interface.
    1. Show the specified error.
    1. Gray out and unselect the previously selected shipping address.
1. If shipping options are empty, but the error is not present.
    1. Re-enable interaction with user interface.
    1. Show a generic error string about this address being invalid.
    1. Gray out and unselect the previously selected shipping address.
1. If shipping options are not empty:
    1. Re-enable interaction with user interface.
    1. Ignore any error, even if it's present.
    1. Update the shipping options in user interface according to what was received from the website.

We've had some discussions about this algorithm being confusing, because the shipping options dictate what to do with the error. I'm open to suggestion to improve this.



-- 
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/browser-payment-api/pull/451#issuecomment-285373126

Received on Thursday, 9 March 2017 14:55:32 UTC