New issue
Advanced search Search tips

Issue 806666 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Compat



Sign in to add a comment

Total amount validation is wrong on Payment Request API

Reported by shogo.se...@gmail.com, Jan 29 2018

Issue description

Example URL:

Steps to reproduce the problem:
If pass { total: { currency : 'JPY', amount: 1025 }} to second argument, throw TypeError: total amount value cannot be longer than 1024 characters. 

What is the expected behavior?

What went wrong?
L185 `ios/chrome/browser/web/resources/payment_request.js` 

>if (amount.value> __gCrWeb['paymentRequestManager'].MAX_STRING_LENGTH) {

should be

>if (amount.value.length > __gCrWeb['paymentRequestManager'].MAX_STRING_LENGTH) {

?

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 64.0.3282.112  Channel: stable
OS Version: iOS 11.2.5
Flash Version:
 

Comment 1 by b...@chromium.org, Jan 29 2018

Components: Blink>Payments
Owner: mahmadi@chromium.org
Status: Assigned (was: Unconfirmed)
Assinging to author of https://crrev.com/c/818014 who last touched line in question (though bug seems to have been introduced earlier).
Components: -Blink>Payments UI>Browser>Payments
Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 31 2018

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

commit 3184e8756918093253463900e1560758e630d965
Author: Mohamad Ahmadi <mahmadi@chromium.org>
Date: Wed Jan 31 17:50:33 2018

[PR] Fixes a bug with the currency amount validation

This CL fixes a bug where the value of the currency amount was being
checked against the maximum allowed string length not the length of the
value string.

Bug:  806666 
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I8897c93f06e8cb590c5414497b53ab87fa291e77
Reviewed-on: https://chromium-review.googlesource.com/895546
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533317}
[modify] https://crrev.com/3184e8756918093253463900e1560758e630d965/ios/chrome/browser/web/resources/payment_request.js

Status: Fixed (was: Started)

Sign in to add a comment