Failing to call paymentResponse.complete() should log an error in console |
||||
Issue description
Steps to reproduce the problem:
Run the following code in DevTools Console:
const supportedCreditCards = {
supportedMethods: ['basic-card'],
};
const supportedPaymentMethods = [supportedCreditCards];
const transactionDetails = {
total: {
label: 'Total',
amount: {
currency: 'USD',
value: '0',
},
},
};
const options = {};
const paymentRequest = new PaymentRequest(
supportedPaymentMethods, transactionDetails, options);
paymentRequest.show()
.then((paymentResponse) => {
return new Promise((resolve) => {
// NOOP. Never resolve the promise.
});
})
.catch((err) => {
console.error('PaymentRequest error: ', err);
});
What is the expected behavior?
An error to be logged when the PaymentRequest UI timesout.
What went wrong?
The UI closes and a user error is shown, but nothing indicates to developers that it was a timeout that causes the closing of the UI.
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 57.0.2987.133 Channel: dev
OS Version:
Flash Version:
,
Apr 12 2017
,
Apr 19 2017
,
Apr 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bb7503ea498af3d78bf3577c5a32d400b74d29b1 commit bb7503ea498af3d78bf3577c5a32d400b74d29b1 Author: rouslan <rouslan@chromium.org> Date: Wed Apr 19 19:11:44 2017 Log PaymentResponse.complete() timeout. Before this patch, if the merchant website never calls PaymentResponse.complete(), then the UI shows a generic error dialog to the user and aborts payment, but nothing indicates to the web developer that it was a timeout that causes the closing of the web payment UI. The fix is to add a console error message "Timed out waiting for a PaymentResponse.complete() call" when the timer expires. After this patch, the console error message will indicate to the web developer that it was a timeout that causes the closing of the web payment UI. To test manually: 1) Open https://rsolomakhin.github.io/pr/ko/complete/. 2) Click [Buy] on the page. 3) Click [Pay] in the web payment UI. Observe: Console prints an error message after 60 seconds. BUG= 711027 Review-Url: https://codereview.chromium.org/2827963002 Cr-Commit-Position: refs/heads/master@{#465694} [modify] https://crrev.com/bb7503ea498af3d78bf3577c5a32d400b74d29b1/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
,
Apr 19 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by mattgaunt@chromium.org
, Apr 12 2017