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

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

Issue 2038423002: Adding support for phone and email. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 d5b31b83a475329c0203d2d99af7cb3838baedd4..eab0b3eded70bc3cdeab9f6d8952849aac0e4d49 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -451,6 +451,18 @@ void PaymentRequest::OnPaymentResponse(mojom::blink::PaymentResponsePtr response
}
}
+ if (m_options.requestPayerEmail() && (response->payer_email.isNull() || response->payer_email.isEmpty())) {
zino 2016/06/07 16:40:08 nit: Should be "if (m_options.requestPayerEmail()
+ m_showResolver->reject(DOMException::create(SyntaxError));
+ clearResolversAndCloseMojoConnection();
+ return;
+ }
+
+ if (m_options.requestPayerPhone() && (response->payer_phone.isNull() || response->payer_phone.isEmpty())) {
zino 2016/06/07 16:40:08 ditto
+ m_showResolver->reject(DOMException::create(SyntaxError));
+ clearResolversAndCloseMojoConnection();
+ return;
+ }
+
m_showResolver->resolve(new PaymentResponse(std::move(response), this));
// Do not close the mojo connection here. The merchant website should call

Powered by Google App Engine
This is Rietveld 408576698