New issue
Advanced search Search tips

Issue 787054 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Better 'payment app not allowed' messages

Project Member Reported by rouslan@chromium.org, Nov 20 2017

Issue description

When payment method manifest Y prohibits a payment app X, Chrome prints 'payment handler X is not allowed to use payment method Y' in terminal. This is not web developer friendly. Need to improve this message and print it in developer tools console.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f

commit dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f
Author: Rouslan Solomakhin <rouslan@chromium.org>
Date: Tue Nov 21 19:20:57 2017

[Payments] Better 'payment handler not allowed' messages.

Before this patch, if payment method manifest for
https://alicepay.xyz/webpay prohibits payment handler
https://bobpay.xyz/app, Chrome would print:
  "Payment handlers from https://bobpay.xyz are not allowed to use
   payment method https://alicepay.xyz/webpay."
in terminal (sometimes even twice). Web developers rarely look at the
terminal, however. Even if someone found these messages in the terminal,
they would be confused by the message terseness and why it's printed
twice.

This patch makes the message more descriptive and prints it in the
developer tools console, if possible. In addition, the patch ensures
that the message is printed exactly once per PaymentRequest
instantiation. To enable access to the developer tools console, the
ManifestVerifier now takes WebContents as the first parameter instead of
the BrowserContext that was used before.

After this patch, if payment method manifest for
https://alicepay.xyz/webpay prohibits payment handler
https://bobpay.xyz.app, Chrome would print the following message in
developer tools console:
  "The payment handler https://bobpay.xyz/app is
   not allowed to use payment method https://alicepay.xyz/webpay,
   because the payment handler origin https://bobpay.xyz is different
   from the payment method origin https://alicepay.xyz and the
   "supported_origins" field in the payment method manifest for
   https://alicepay.xyz/webpay is not "*" and is not a list that
   includes https://bobpay.xyz."

This behavior can be tested on:
https://rsolomakhin.github.io/pr/apps/alice/

Bonus: Not instantiating a GURL from non-UTF8 strings, which have been
       known to cause GURL constructor crashes in fuzz tests.

Bug: 787054
Change-Id: I113270173cbc6c89bf81b58f36a46da4d7adf6ec
Reviewed-on: https://chromium-review.googlesource.com/779662
Reviewed-by: Ganggui Tang <gogerald@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518328}
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/chrome/browser/payments/manifest_verifier_browsertest.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/chrome/browser/payments/service_worker_payment_app_factory_browsertest.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/manifest_verifier.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/manifest_verifier.h
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/payment_request.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/payment_request_state.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/payment_request_state.h
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/service_worker_payment_app_factory.cc
[modify] https://crrev.com/dbf593d9a827e06d9cbfd6b7e47b415ed3cba05f/components/payments/content/service_worker_payment_app_factory.h

Sign in to add a comment