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

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

Issue 2348103002: PaymentRequest: Add support for payerName. (in blink side) (Closed)
Patch Set: PaymentRequest: Add support for payerName. (in blink side) 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 4d453547a2c7e48ec6abf6e41700a1f88176814a..c0704ba17b4e4039b216dfeff3b8450e9aba9930 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())
foolip 2016/09/19 15:34:40 Off-topic: does this API not allow for a way to re
+ || (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