New issue
Advanced search Search tips

Issue 915907 link

Starred by 2 users

Issue metadata

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

Blocking:
issue 911707



Sign in to add a comment

Implement PaymentRequest.hasEnrolledInstrument in Blink

Project Member Reported by danyao@chromium.org, Dec 17

Issue description

The W3C Web Payments Working Group voted on adding a hasEnrolledInstrument method to Payment Request API, as well as aligning the behavior for canMakePayment:

https://lists.w3.org/Archives/Public/public-payments-wg/2018Nov/0018.html

This is a tracking bug for updating Blink's implementation of PaymentRequest API to match the spec changes.
 
Blocking: 911707
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 21

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

commit ce175bf8f65f37c028b55b0ff87492773881b0b5
Author: Danyao Wang <danyao@chromium.org>
Date: Fri Dec 21 22:35:58 2018

[Payment Request] Add HasEnrolledInstrument to Payment Request API.

This is the first step to change Chrome's PaymentRequest implementation
to match the proposed spec change:
https://lists.w3.org/Archives/Public/public-payments-wg/2018Nov/0018.html

This CL aligns mojom::PaymentRequest API with the new spec proposal by
renaming CanMakePayment to HasEnrolledInstrument and leaving a stub for
CanMakePayment. Blink's canMakePayemnt is switched to using
HasEnrolledInstrument so there is no behavior change visible to the web
platform.

There will be a few subsequent changes:
- Implement new CanMakePayment behavior
- Expose hasEnrolledInstrument and new canMakePayment in Blink behind
  a runtime flag.

Bug: 915907
Change-Id: I137110de0077fb4e243b883d27c82109f8d2afbb
Reviewed-on: https://chromium-review.googlesource.com/c/1383445
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618639}
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestRule.java
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/components/payments/content/payment_request.cc
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/components/payments/content/payment_request.h
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/components/payments/content/payment_request_state.cc
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/components/payments/content/payment_request_state.h
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/components/payments/content/payment_request_state_unittest.cc
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/components/payments_strings.grdp
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/third_party/blink/public/mojom/payments/payment_request.mojom
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/third_party/blink/renderer/modules/payments/can_make_payment_test.cc
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/third_party/blink/renderer/modules/payments/payment_request.cc
[modify] https://crrev.com/ce175bf8f65f37c028b55b0ff87492773881b0b5/third_party/blink/renderer/modules/payments/payment_request.h

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 27

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

commit 4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37
Author: Danyao Wang <danyao@chromium.org>
Date: Thu Dec 27 16:54:53 2018

[Payment Request] Align CanMakePayment semantic to new spec proposal.

This CL implements the CanMakePayment stub in mojom::PaymentRequest API
according to the new spec proposal:
https://lists.w3.org/Archives/Public/public-payments-wg/2018Nov/0018.html

This new CanMakePayment returns true as long as support for the merchant-
specified payment method is available. In contrast, the old version also
required the payment app for the payment method also be properly
provisioned (e.g. having a card or payment handler installed) before.
returning true. The old behavior is now provided via
HasEnrolledInstrument.

This CL also removed query quota for CanMakePayment because the new
implementation no longer exposes details about user's setting that can
be used for fingerprinting.

This new CanMakePayment API will be exposed in Blink in a subsequent CL.

Bug: 915907
Change-Id: Id92aafb65fd8fc05ab49ef7e2affd71dd1903388
Reviewed-on: https://chromium-review.googlesource.com/c/1387025
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619047}
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/components/payments/content/payment_request.cc
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/components/payments/content/payment_request.h
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/components/payments/content/payment_request_state.cc
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/components/payments/content/payment_request_state.h
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/components/payments/content/payment_request_state_unittest.cc
[modify] https://crrev.com/4bc0606a30b63bb7e0b14f8c01e0fce1cf45eb37/third_party/blink/public/mojom/payments/payment_request.mojom

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 2

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

commit 8cf5f350873404095f36428a36e1da1e04b7c61a
Author: Danyao Wang <danyao@chromium.org>
Date: Wed Jan 02 16:55:53 2019

Add use counter for more ~high entropy API calls.

hasEnrolledInstrument is a new API added to PaymentRequest spec to
replace the current canMakePayment API, which is considered ~high entroy
in crrev.com/c/1384047.

Bug: 915620,915907
Change-Id: I7ad4f37ef4223d89e142f29c9003f07311ec5ca1
Reviewed-on: https://chromium-review.googlesource.com/c/1391708
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619421}
[modify] https://crrev.com/8cf5f350873404095f36428a36e1da1e04b7c61a/third_party/blink/public/platform/web_feature.mojom
[modify] https://crrev.com/8cf5f350873404095f36428a36e1da1e04b7c61a/third_party/blink/renderer/modules/payments/payment_request.idl
[modify] https://crrev.com/8cf5f350873404095f36428a36e1da1e04b7c61a/tools/metrics/histograms/enums.xml

Sign in to add a comment