| 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 521b20d7aae471225e44894f7c9c1f2ddde7e028..a2b37f32b999163d337bfc3e669cee1278558998 100644
|
| --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
|
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
|
| @@ -476,6 +476,30 @@ void PaymentRequest::OnPaymentResponse(mojom::blink::PaymentResponsePtr response
|
| }
|
| }
|
|
|
| + if (m_options.requestPayerEmail() && response->payer_email.isEmpty()) {
|
| + m_showResolver->reject(DOMException::create(SyntaxError));
|
| + clearResolversAndCloseMojoConnection();
|
| + return;
|
| + }
|
| +
|
| + if (!m_options.requestPayerEmail() && !response->payer_email.isNull()) {
|
| + m_showResolver->reject(DOMException::create(SyntaxError));
|
| + clearResolversAndCloseMojoConnection();
|
| + return;
|
| + }
|
| +
|
| + if (m_options.requestPayerPhone() && response->payer_phone.isEmpty()) {
|
| + m_showResolver->reject(DOMException::create(SyntaxError));
|
| + clearResolversAndCloseMojoConnection();
|
| + return;
|
| + }
|
| +
|
| + if (!m_options.requestPayerPhone() && !response->payer_phone.isNull()) {
|
| + 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
|
|
|