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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

Issue 2073603002: Add shippingOption to PaymentResponse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase #2 Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
index 12eed355a177f7335987c4280fccaf1ee30b9a29..ce4cc78953d8cc68aa03ebffe9fd6e3219bb4c9d 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -457,7 +457,7 @@ void PaymentRequest::OnPaymentResponse(mojom::blink::PaymentResponsePtr response
DCHECK(!m_completeResolver);
if (m_options.requestShipping()) {
- if (!response->shipping_address) {
+ if (!response->shipping_address || response->shipping_option.isEmpty()) {
m_showResolver->reject(DOMException::create(SyntaxError));
clearResolversAndCloseMojoConnection();
return;
@@ -471,9 +471,9 @@ void PaymentRequest::OnPaymentResponse(mojom::blink::PaymentResponsePtr response
}
m_shippingAddress = new PaymentAddress(response->shipping_address.Clone());
- m_shippingOption = response->shipping_option_id;
+ m_shippingOption = response->shipping_option;
} else {
- if (response->shipping_address) {
+ if (response->shipping_address || !response->shipping_option.isNull()) {
m_showResolver->reject(DOMException::create(SyntaxError));
clearResolversAndCloseMojoConnection();
return;

Powered by Google App Engine
This is Rietveld 408576698