New issue
Advanced search Search tips

Issue 766805 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug


Participants' hotlists:
Payment-Interop


Sign in to add a comment

Throw RangeError for invalid payment method identifiers

Project Member Reported by rouslan@chromium.org, Sep 19 2017

Issue description

Throw RangeError for invalid payment method identifiers.
 

Comment 1 by ma...@chromium.org, Sep 20 2017

https://w3c-test.org/payment-request/payment-request-ctor-pmi-handling.https.html

Sounds like a fun one. Did we not already do validation renderer side for PMI? 
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 20 2017

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

commit 0beaddc405726742b5545de252e6bf0a2d43edba
Author: Rouslan Solomakhin <rouslan@chromium.org>
Date: Wed Sep 20 16:04:10 2017

[Payments] Validate payment method format.

https://w3c.github.io/payment-request/#constructor

"For each paymentMethod of methodData:
 Run the steps to validate a payment method identifier with
 paymentMethod.supportedMethods. If it returns false, then throw a
 RangeError exception and terminate this algorithm."

https://www.w3.org/TR/payment-method-id/#dfn-validate-a-payment-method-identifier

"The steps to validate a payment method identifier with a string pmi are
 given by the following algorithm. It returns true if the pmi is valid.

 1. Let url be the result of running the basic URL parser with pmi.
 2. If url is failure, validate a standardized payment method identifier
    with pmi and return the result.
 3. Otherwise, validate a URL-based payment method identifier passing
    url and return the result."

Bug:  766805 
Change-Id: I1b7dad94a90bd388751335bd95558ed812326ee3
Reviewed-on: https://chromium-review.googlesource.com/673276
Reviewed-by: Mathieu Perreault <mathp@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503164}
[modify] https://crrev.com/0beaddc405726742b5545de252e6bf0a2d43edba/chrome/browser/ui/views/payments/payment_request_browsertest.cc
[delete] https://crrev.com/fa9689106cb62897fd78094e0c36d89a833b49b8/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-ctor-pmi-handling.https-expected.txt
[modify] https://crrev.com/0beaddc405726742b5545de252e6bf0a2d43edba/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

> Did we not already do validation renderer side for PMI? 

No, our validation was all on the browser side.
Status: Fixed (was: Started)

Sign in to add a comment