New issue
Advanced search Search tips

Issue 711027 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Failing to call paymentResponse.complete() should log an error in console

Project Member Reported by mattgaunt@google.com, Apr 12 2017

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:
 
Owner: rouslan@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)

Sign in to add a comment