-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
teach retry() about payerErrors #721
Conversation
Blocked on #720 landing. |
de8a989
to
9b466e5
Compare
For anyone watching at home, this currently lacks (coming soon as new PRs/parts):
|
b788b46
to
75a617c
Compare
75a617c
to
d2411e1
Compare
Friendly ping, @domenic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 we're not in agreement on this, maybe it's something to bring up with a larger audience to get more perspectives?
index.html
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe discuss how the UA should use the developer-supplied strings?
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 ***@***.***> 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.
|
Filed #736 to drop |
Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7
) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7
Related spec change: w3c/payment-request#721 Tests: chrome/browser/ui/views/payments/contact_info_editor_view_controller_browsertest.cc chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 Reviewed-on: https://chromium-review.googlesource.com/1144587 Commit-Queue: Jinho Bang <[email protected]> Reviewed-by: Rouslan Solomakhin <[email protected]> Cr-Commit-Position: refs/heads/master@{#585581}
) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7
… PaymentResponse.retry(), a=testonly Automatic update from web-platform-testsPaymentRequest: Implement desktop UI for PaymentResponse.retry() (#12550) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 -- wpt-commits: 4797b9cde63931bf7c49a74e2589a12dd619bec1 wpt-pr: 12550
… PaymentResponse.retry(), a=testonly Automatic update from web-platform-testsPaymentRequest: Implement desktop UI for PaymentResponse.retry() (#12550) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 -- wpt-commits: 4797b9cde63931bf7c49a74e2589a12dd619bec1 wpt-pr: 12550
Related spec change: w3c/payment-request#721 Tests: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestRetryTest.java Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Bug: 861704 Change-Id: Ibeae527b950c32e31ca19a631da3a88dc9e33429 Reviewed-on: https://chromium-review.googlesource.com/c/1415050 Commit-Queue: Jinho Bang <[email protected]> Reviewed-by: Rouslan Solomakhin <[email protected]> Reviewed-by: Theresa <[email protected]> Cr-Commit-Position: refs/heads/master@{#626397}
… PaymentResponse.retry(), a=testonly Automatic update from web-platform-testsPaymentRequest: Implement desktop UI for PaymentResponse.retry() (#12550) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 -- wpt-commits: 4797b9cde63931bf7c49a74e2589a12dd619bec1 wpt-pr: 12550 UltraBlame original commit: a066a82e40b8fdc71502a1bb33c2242c019263f1
… PaymentResponse.retry(), a=testonly Automatic update from web-platform-testsPaymentRequest: Implement desktop UI for PaymentResponse.retry() (#12550) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 -- wpt-commits: 4797b9cde63931bf7c49a74e2589a12dd619bec1 wpt-pr: 12550 UltraBlame original commit: a066a82e40b8fdc71502a1bb33c2242c019263f1
… PaymentResponse.retry(), a=testonly Automatic update from web-platform-testsPaymentRequest: Implement desktop UI for PaymentResponse.retry() (#12550) Related spec change: w3c/payment-request#721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 -- wpt-commits: 4797b9cde63931bf7c49a74e2589a12dd619bec1 wpt-pr: 12550 UltraBlame original commit: a066a82e40b8fdc71502a1bb33c2242c019263f1
BUILDS ON #720 - This is part 2 of 5. It adds:
retry()
argument for validation errors:retry(PaymentValidationErrors errorFields)
PaymentValidationErrors
dictionaryPayerErrorFields
dictionaryThe following tasks have been completed:
Implementation commitment:
Impact on Payment Handler spec?
Unknown.
Example
Via payerErrors, the user now knows what's actually wrong with the payment.
Preview | Diff