Re: [w3c/payment-request] teach retry() about payerErrors (#721)

See your point, and don’t want us to spend time bike shedding. I’ll change them all in an upcoming PR 🙂


> On 25 Jun 2018, at 1:53 pm, Domenic Denicola <notifications@github.com> wrote:
> 
> @domenic commented on this pull request.
> 
> LGTM editorially, but I'm increasingly unhappy with the excessive prefixing and suffixing.
> 
> Step away from your particular coding style, which uses lots of redundant variables and object literal shorthand. Consider what more conventional code using this API would have to look like:
> 
> await response.retry({
>   shippingAddressErrors: {
>     addressLineError: "Bad address line"
>   },
>   payerErrors: {
>     payerEmailError: "Bad email"
>   }
> });
> This is fairly ridiculous. The field names here are something like errors.payerErrors.payerEmailError, instead of the simpler errors.payer.email or even errors.payerEmail. (Similarly, errors.shippingAddressErrors.addressLineError instead of errors.shippingAddress.addressLine---the latter is long enough already.)
> 
> I'd really suggest getting rid of all the redundant prefixes and suffixes, and allowing people to write clean, straightforward code of the sort
> 
> await response.retry({
>   shippingAddress: {
>     addressLine: "Bad address line"
>   },
>   payer: {
>     email: "Bad email"
>   }
> });
> If you don't see my point, maybe it's something to bring up with a larger audience to get more perspectives?
> 
> In index.html:
> 
> > @@ -3210,8 +3211,9 @@ <h2>
>            <li>Set <var>response</var>.<a>[[\retryPromise]]</a> to
>            <var>retryPromise</var>.
>            </li>
> -          <li>In the payments UI, indicate to the end-user that something is
> -          wrong with the user-provided data of the payment response.
> +          <li>By matching the members of <var>errorFields</var> to input fields
> +          in the user agent's UI, indicate to the end-user that something is
> +          wrong with the data of the payment response.
> Maybe discuss how the UA should use the developer-supplied strings?
> 
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.


-- 
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/pull/721#issuecomment-400070703

Received on Monday, 25 June 2018 19:42:48 UTC