When PaymentRequest.onShippingAddressChange or PaymentRequest.onShippingOptionChange event fires, the event type should be PaymentRequestUpdateEvent with a method updateWith(). This method should allow the merchant to update the shipping options and the total price. https://w3c.github.io/browser-payment-api/specs/paymentrequest.html#idl-def-paymentrequestupdateevent
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/84234b56d641a989f709976793cff331b5488684 commit 84234b56d641a989f709976793cff331b5488684 Author: rouslan <rouslan@chromium.org> Date: Fri May 06 04:22:53 2016 Implement PaymentRequestUpdateEvent When onShippingAddressChange or onShippingOptionChange event fires, the event type should be PaymentRequestUpdateEvent with an updateWith() method. - The updateWith() method lets the merchant update the shipping options and the total price. - The updateWith() method cannot be called twice for the same event. - The updateWith() method can be called only when the event is being dispatched. - Dispatching a PaymentRequestUpdateEvent created in JavaScript is a no-op. https://w3c.github.io/browser-payment-api/specs/paymentrequest.html#idl-def-paymentrequestupdateevent BUG= 607705 Review-Url: https://codereview.chromium.org/1931233002 Cr-Commit-Position: refs/heads/master@{#392002} [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/chrome/test/data/android/payments/payment_request_no_shipping_test.html [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/core/frame/UseCounter.h [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/modules.gypi [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequest.h [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp [add] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp [add] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.h [add] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.idl [add] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEventInit.idl [add] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEventTest.cpp [add] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/PaymentUpdater.h [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/Source/modules/payments/ShippingAddress.idl [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/third_party/WebKit/public/platform/modules/payments/payment_request.mojom [modify] https://crrev.com/84234b56d641a989f709976793cff331b5488684/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1222c2859b500ee61b3070f4c39db4a77a16be77 commit 1222c2859b500ee61b3070f4c39db4a77a16be77 Author: rouslan <rouslan@chromium.org> Date: Wed May 11 01:51:47 2016 Preserve the selected shipping option index. When the user selects a shipping option, the merchant can update the list of line items and shipping options. If the merchant sends back unchanged shipping options, then this update should not clear user's shipping option selection. BUG= 607705 Review-Url: https://codereview.chromium.org/1957973003 Cr-Commit-Position: refs/heads/master@{#392816} [modify] https://crrev.com/1222c2859b500ee61b3070f4c39db4a77a16be77/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
Comment 1 by rouslan@chromium.org
, Apr 28 2016