New issue
Advanced search Search tips

Issue 683329 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Feature

Blocked on:
issue 679381



Sign in to add a comment

Download payment manifest for payment apps.

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

Issue description

Design doc:
https://docs.google.com/document/d/1izV4uC-tiRJG3JLooqY3YRLU22tYOsLTNq0P_InPJeE/edit?usp=sharing

Also need to verify the installed payment apps against the certificate.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 23 2017

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

commit a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06
Author: rouslan <rouslan@chromium.org>
Date: Thu Feb 23 15:36:35 2017

Use ExecutionContext instead of Document in PaymentRequest constructor.

BUG= 683329 

Review-Url: https://codereview.chromium.org/2697123003
Cr-Commit-Position: refs/heads/master@{#452494}

[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/AbortTest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/CanMakePaymentTest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/CompleteTest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/OnPaymentResponseTest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/PaymentRequest.h
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/PaymentRequest.idl
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/PaymentRequestDetailsTest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
[modify] https://crrev.com/a4cf0dc85a9d52d8d1a07ee15ae7bd0c8bc02b06/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEventTest.cpp

Blockedon: 679381
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 15 2017

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

commit 8fdbfb2484873d09de132e051da87e580382f95b
Author: rouslan <rouslan@chromium.org>
Date: Wed Mar 15 01:12:49 2017

Download web payment manifests.

The browser downloads web payment manifests and parses them in a utility
process. Then browser verifies the signatures of the installed payment
apps and shows only the apps with the matching SHA256 certificate
fingerprints to the user.

Design doc:
https://docs.google.com/document/d/1izV4uC-tiRJG3JLooqY3YRLU22tYOsLTNq0P_InPJeE

Flag (disabled by default): chrome://flags/#android-payment-apps

To understand how the feature works, let's see what happens for a
'https://bobpay.com' payment method. When the JavaScript PaymentRequest
object is instantiated, the browser first scans installed applications
for any app that can handle the 'https://bobpay.com' URL with
'org.chromium.intent.action.PAY' intent. If a matching app is found,
then the browser uses HTTP HEAD request for this URL to read the HTTP
Link header.

Example HTTP link header:
  Link: <https://bobpay.com/payment-manifest.json>; rel="payment-method-manifest"

Then browser uses HTTP GET request for the manifest file to retrieve its
contents. Both HEAD and GET requests do not follow 300 redirects and
require https:// scheme.

Example manifest contents:
  {
    "android": [{
      "package": "com.bobpay.app",
      "version": 1,
      "sha256_cert_fingerprints": ["30:82:01:AB:30:82:01:46:02:01:01"]
    }]
  }

Finally, browser compares the properties of the installed Android app
with the contents of the manifest. Thus, the owner of the payment method
URL controls which payment apps can use this URL as a payment method
identifier.

To test:
1) Install BobPay.apk from
   https://drive.google.com/open?id=0B9_TYWUgXNVFQ1pUb21PQkZ3VVE
2) Enable chrome://flags/#android-payment-apps.
3) Navigate to https://rsolomakhin.github.io/pr/bob/.
4) Click "Buy" button on the webpage.

BUG= 683329 

Review-Url: https://codereview.chromium.org/2645813006
Cr-Commit-Position: refs/heads/master@{#456934}

[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/BUILD.gn
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java/DEPS
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFactory.java
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinder.java
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java/src/org/chromium/chrome/browser/payments/PackageManagerDelegate.java
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentManifestVerifier.java
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/java_sources.gni
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/javatests/DEPS
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/CurrencyFormatterTest.java
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/junit/DEPS
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/junit/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinderTest.java
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/android/junit/src/org/chromium/chrome/browser/payments/PaymentManifestVerifierTest.java
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/browser/BUILD.gn
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/browser/android/chrome_jni_registrar.cc
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/browser/chrome_content_utility_manifest_overlay.json
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/utility/BUILD.gn
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/utility/DEPS
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/chrome/utility/chrome_content_utility_client.cc
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/BUILD.gn
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/data_use_measurement/core/data_use_user_data.cc
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/data_use_measurement/core/data_use_user_data.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/DEPS
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/BUILD.gn
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/DEPS
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/BUILD.gn
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/DEPS
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/OWNERS
[rename] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/java/src/org/chromium/components/payments/CurrencyFormatter.java
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentManifestDownloader.java
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentManifestParser.java
[rename] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentValidator.java
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_details_validation_android.cc
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_details_validation_android.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_downloader.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_downloader.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_downloader_android.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_downloader_android.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_downloader_unittest.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_parser.mojom
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_parser_android.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/payment_manifest_parser_android.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/BUILD.gn
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/DEPS
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/fingerprint_parser.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/fingerprint_parser.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/fingerprint_parser_unittest.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/payment_manifest_parser.cc
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/payment_manifest_parser.h
[add] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/android/utility/payment_manifest_parser_unittest.cc
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/payment_request.h
[rename] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/content/payments_validators_unittest.cc
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments/core/DEPS
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/components/payments_strings.grdp
[modify] https://crrev.com/8fdbfb2484873d09de132e051da87e580382f95b/tools/metrics/histograms/histograms.xml

Summary: Download payment manifest for payment apps. (was: Download payment manifest for native Android payment apps.)
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 28 2017

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

commit bb7522e6433d4aa05dd81026c42559f9ca2011e6
Author: rouslan <rouslan@chromium.org>
Date: Tue Mar 28 17:06:19 2017

Make payment manifest download/parse cross-platform

Reason for the refactor is an upcoming change to download/parse the
payment manifest on desktop in addition to Android.

1) This patch moves downloader and parser utility into cross-platform
   directory //components/payments/content.

2) The cross-platform PaymentManifestParserHost has been separated from
   its Android wrapper PaymentManifestParserAndroid.

3) GN build target renames:
   a) Payments mojom targets have been renamed to include the string
      "mojom" for clarity.
   b) The main target of "//components/payments/content" has been
      renamed to "content" for brevity.
   c) The "//components/payments/content:payment_validators" target has
      been renamed to "//components/payments/content:utils", because it
      now contains manifest downloader and parser.

Manifest download is currently used only on Android after enabling the
chrome://flags/#android-payment-apps flag.

BUG= 683329 

Review-Url: https://codereview.chromium.org/2759283002
Cr-Commit-Position: refs/heads/master@{#460141}

[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/chrome/android/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/chrome/browser/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/chrome/utility/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/chrome/utility/DEPS
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/chrome/utility/chrome_content_utility_client.cc
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/DEPS
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/android/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/android/DEPS
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/android/payment_manifest_downloader_android.cc
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/android/payment_manifest_parser_android.cc
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/android/payment_manifest_parser_android.h
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/payment_manifest_downloader.cc
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/payment_manifest_downloader.h
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/payment_manifest_downloader_unittest.cc
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/payment_manifest_parser.mojom
[add] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/payment_manifest_parser_host.cc
[add] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/payment_manifest_parser_host.h
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/BUILD.gn
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/DEPS
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/fingerprint_parser.cc
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/fingerprint_parser.h
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/fingerprint_parser_unittest.cc
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/payment_manifest_parser.cc
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/payment_manifest_parser.h
[rename] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments/content/utility/payment_manifest_parser_unittest.cc
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/components/payments_strings.grdp
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/content/browser/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/content/common/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/content/renderer/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/content/test/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/third_party/WebKit/Source/modules/payments/BUILD.gn
[modify] https://crrev.com/bb7522e6433d4aa05dd81026c42559f9ca2011e6/third_party/WebKit/public/BUILD.gn

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 28 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/84b57fcefe828a5cb1ef88b332328074df40fe50

commit 84b57fcefe828a5cb1ef88b332328074df40fe50
Author: Rouslan Solomakhin <rouslan@google.com>
Date: Tue Mar 28 21:52:19 2017

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 11 2017

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

commit 75be1dd2e3cfbb4f04284246d44328295229d031
Author: rouslan <rouslan@chromium.org>
Date: Tue Apr 11 19:23:28 2017

Fix crash in release mode of payment manifest parser.

Before this patch, the payment manifest parser was populating array
elements only in debug mode via DCHECK(addItemToArray()), which caused a
crash in release mode.

The fix is to save a "success" boolean on stack and DCHECK(success)
later.

After this patch, the release mode is not crashing.

In addition, this patch contains the following minor fixes:

1) Match variable names across JNI boundary.
2) Add an assert for null web app manifest uri, because that should not
   happen.
3) Ensure that payment manifest parser host always invokes all
   callbacks.

BUG= 683329 , 710433

Review-Url: https://codereview.chromium.org/2809193002
Cr-Commit-Position: refs/heads/master@{#463720}

[modify] https://crrev.com/75be1dd2e3cfbb4f04284246d44328295229d031/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentManifestVerifier.java
[modify] https://crrev.com/75be1dd2e3cfbb4f04284246d44328295229d031/components/payments/content/android/java/src/org/chromium/components/payments/PaymentManifestDownloader.java
[modify] https://crrev.com/75be1dd2e3cfbb4f04284246d44328295229d031/components/payments/content/android/payment_manifest_parser_android.cc
[modify] https://crrev.com/75be1dd2e3cfbb4f04284246d44328295229d031/components/payments/content/payment_manifest_parser_host.cc

Status: Fixed (was: Started)
Components: -UI>Browser>Autofill>Payments UI>Browser>Payments

Sign in to add a comment