Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Issue 2470463002: Add data parameter to payment details modifier. (Closed)

Created:
4 years, 1 month ago by please use gerrit instead
Modified:
4 years ago
CC:
Aaron Boodman, abarth-chromium, blink-reviews, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, rouslan+payments_chromium.org, sebsg+paymentswatch_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add data parameter to payment details modifier. This patch adds the data parameter for payment details modifier that is a JSON-serializable object with optional information that might be needed by the supported payment methods. For example, {"gateway": "company"}. The data parameter is behind a runtime flag. Added in: https://github.com/w3c/browser-payment-api/pull/261/files Spec: https://w3c.github.io/browser-payment-api/#paymentdetailsmodifier-dictionary Intent to implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Dpc5Ftqgxlg/ZYenHNR0AgAJ Example: var supportedMethods = [{supportedMethods: ["basic-card"]}]; var shoppingCart = {total: {title: "Total", currency: {code: "USD", value: "5.00"}}}; shoppingCart.modifiers = [{ data: {supportedType: ["debit"]}, // THE NEW FEATURE supportedMethods: ["basic-card"], total: {title: "Total", currency: {code: "USD", value: "4.63"}}}]; new PaymentRequest(supportedMethods, shoppingCart); To better share the object validation and stringification logic, this patch merges the validation and conversion code for PaymentMethodData, PaymentDetails, and PaymentDetailsModifier. This results in saving around 50 lines of code. BUG=660926 Committed: https://crrev.com/736ccd21ff339cf3243ee5857d3de0a661dfec3c Cr-Commit-Position: refs/heads/master@{#435780}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Add comments and rebase #

Total comments: 3

Patch Set 3 : Rebase #

Total comments: 22

Patch Set 4 : Address palmer and haraken comments #

Total comments: 2

Patch Set 5 : Range-based loops #

Patch Set 6 : Rebase #

Patch Set 7 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -309 lines) Patch
M components/payments/payment_details_validation.cc View 1 2 3 1 chunk +5 lines, -9 lines 0 comments Download
M components/payments/payment_request.mojom View 1 2 3 3 chunks +27 lines, -27 lines 0 comments Download
M third_party/WebKit/LayoutTests/payments/payment-request-interface.html View 1 2 3 4 5 1 chunk +15 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentDetailsModifier.idl View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentRequest.cpp View 1 2 3 4 5 14 chunks +199 lines, -255 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentRequestDetailsTest.cpp View 1 2 2 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 84 (58 generated)
please use gerrit instead
mathp, ptal Ideally all these changes would be reviewed by mek@, but he's ooo until ...
4 years, 1 month ago (2016-10-31 20:34:36 UTC) #16
Mathieu
lgtm, mostly nits I'm still unclear about the difference between PaymentMethodData and PaymentDetailsModifier and how ...
4 years, 1 month ago (2016-11-01 14:39:17 UTC) #17
please use gerrit instead
tsepez, ptal payment_request.mojom. On 2016/11/01 14:39:17, Mathieu Perreault wrote: > I'm still unclear about the ...
4 years, 1 month ago (2016-11-02 16:27:10 UTC) #23
Tom Sepez
https://codereview.chromium.org/2470463002/diff/60001/components/payments/payment_request.mojom File components/payments/payment_request.mojom (right): https://codereview.chromium.org/2470463002/diff/60001/components/payments/payment_request.mojom#newcode100 components/payments/payment_request.mojom:100: // A JSON string built by the renderer from ...
4 years, 1 month ago (2016-11-02 20:23:22 UTC) #27
please use gerrit instead
https://codereview.chromium.org/2470463002/diff/60001/components/payments/payment_request.mojom File components/payments/payment_request.mojom (right): https://codereview.chromium.org/2470463002/diff/60001/components/payments/payment_request.mojom#newcode100 components/payments/payment_request.mojom:100: // A JSON string built by the renderer from ...
4 years, 1 month ago (2016-11-02 20:35:17 UTC) #28
Tom Sepez
> PaymentRequestImpl.java sanitizes and parses the string to JSONObject to > validate that the renderer ...
4 years, 1 month ago (2016-11-02 20:46:04 UTC) #29
haraken
Just drive-by. https://codereview.chromium.org/2470463002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp File third_party/WebKit/Source/modules/payments/PaymentRequest.cpp (right): https://codereview.chromium.org/2470463002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp#newcode167 third_party/WebKit/Source/modules/payments/PaymentRequest.cpp:167: v8::JSON::Stringify(data.context(), data.v8Value().As<v8::Object>()); Can you use ToLocal instead ...
4 years, 1 month ago (2016-11-03 15:21:32 UTC) #31
Tom Sepez
Unfortunately, we know android's java implementation is not memory safe so we do not rely ...
4 years, 1 month ago (2016-11-03 16:48:21 UTC) #32
Bernhard Bauer
On 2016/11/03 16:48:21, Tom Sepez wrote: > Unfortunately, we know android's java implementation is not ...
4 years, 1 month ago (2016-11-17 10:05:22 UTC) #34
Robert Sesek
+palmer who I discussed this with On 2016/11/17 10:05:22, Bernhard Bauer wrote: > On 2016/11/03 ...
4 years, 1 month ago (2016-11-18 20:58:02 UTC) #36
please use gerrit instead
On 2016/11/18 20:58:02, Robert Sesek wrote: > That said, if we can parse in the ...
4 years, 1 month ago (2016-11-18 20:59:23 UTC) #37
please use gerrit instead
On 2016/11/18 20:59:23, rouslan wrote: > On 2016/11/18 20:58:02, Robert Sesek wrote: > > That ...
4 years, 1 month ago (2016-11-18 21:00:33 UTC) #38
please use gerrit instead
mathp, tsepez, haraken: ptal patch 3. JSON parsing has been moved to the renderer, so ...
4 years ago (2016-11-28 22:20:41 UTC) #43
palmer
https://codereview.chromium.org/2470463002/diff/80001/components/payments/payment_request.mojom File components/payments/payment_request.mojom (right): https://codereview.chromium.org/2470463002/diff/80001/components/payments/payment_request.mojom#newcode116 components/payments/payment_request.mojom:116: // no one format for this object, so richer ...
4 years ago (2016-11-29 00:24:55 UTC) #46
haraken
https://codereview.chromium.org/2470463002/diff/80001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp File third_party/WebKit/Source/modules/payments/PaymentRequest.cpp (right): https://codereview.chromium.org/2470463002/diff/80001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp#newcode209 third_party/WebKit/Source/modules/payments/PaymentRequest.cpp:209: exceptionState.throwTypeError("ShippingOption id required"); Don't we need to clear output? ...
4 years ago (2016-11-29 01:58:26 UTC) #47
please use gerrit instead
palmer, haraken: ptal patch 4. https://codereview.chromium.org/2470463002/diff/80001/components/payments/payment_request.mojom File components/payments/payment_request.mojom (right): https://codereview.chromium.org/2470463002/diff/80001/components/payments/payment_request.mojom#newcode116 components/payments/payment_request.mojom:116: // no one format ...
4 years ago (2016-11-29 16:19:52 UTC) #50
please use gerrit instead
krb, ptal components/payments/payment_details_validation.cc in patch 4. Payment method names can have duplicates now.
4 years ago (2016-11-29 16:21:30 UTC) #52
Tom Sepez
lgtm
4 years ago (2016-11-29 17:13:06 UTC) #53
Kevin Bailey
https://codereview.chromium.org/2470463002/diff/80001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp File third_party/WebKit/Source/modules/payments/PaymentRequest.cpp (right): https://codereview.chromium.org/2470463002/diff/80001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp#newcode192 third_party/WebKit/Source/modules/payments/PaymentRequest.cpp:192: const PaymentItem& item = input[i]; On 2016/11/29 16:19:52, rouslan ...
4 years ago (2016-11-29 17:27:59 UTC) #54
please use gerrit instead
krb, ptal patch 5. haraken, should I IWYU for DCHECK() and arraysize()? Including "base/logging.h" and ...
4 years ago (2016-11-29 19:26:53 UTC) #58
haraken
LGTM
4 years ago (2016-11-30 04:49:22 UTC) #63
Kevin Bailey
lgtm
4 years ago (2016-12-01 17:48:31 UTC) #68
palmer
lgtm
4 years ago (2016-12-01 23:10:00 UTC) #76
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2470463002/160001
4 years ago (2016-12-01 23:51:42 UTC) #79
commit-bot: I haz the power
Committed patchset #7 (id:160001)
4 years ago (2016-12-02 00:00:40 UTC) #82
commit-bot: I haz the power
4 years ago (2016-12-02 00:03:26 UTC) #84
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/736ccd21ff339cf3243ee5857d3de0a661dfec3c
Cr-Commit-Position: refs/heads/master@{#435780}

Powered by Google App Engine
This is Rietveld 408576698