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

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

Issue 2348103002: PaymentRequest: Add support for payerName. (in blink side) (Closed)
Patch Set: test Created 4 years, 3 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 7c0d805526318bb481fd97c5967dbe8d35ebd990..65ada6c3543e7213e5f5d385d6ec30d704386017 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -134,6 +134,7 @@ struct TypeConverter<PaymentOptionsPtr, blink::PaymentOptions> {
static PaymentOptionsPtr Convert(const blink::PaymentOptions& input)
{
PaymentOptionsPtr output = PaymentOptions::New();
+ output->request_payer_name = input.requestPayerName();
output->request_payer_email = input.requestPayerEmail();
output->request_payer_phone = input.requestPayerPhone();
output->request_shipping = input.requestShipping();
@@ -612,8 +613,10 @@ void PaymentRequest::OnPaymentResponse(mojom::blink::PaymentResponsePtr response
}
}
- if ((m_options.requestPayerEmail() && response->payer_email.isEmpty())
+ if ((m_options.requestPayerName() && response->payer_name.isEmpty())
+ || (m_options.requestPayerEmail() && response->payer_email.isEmpty())
|| (m_options.requestPayerPhone() && response->payer_phone.isEmpty())
+ || (!m_options.requestPayerName() && !response->payer_name.isNull())
|| (!m_options.requestPayerEmail() && !response->payer_email.isNull())
|| (!m_options.requestPayerPhone() && !response->payer_phone.isNull())) {
m_showResolver->reject(DOMException::create(SyntaxError));

Powered by Google App Engine
This is Rietveld 408576698