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

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

Issue 2453463004: Add support for shipping type in web payments (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « components/payments/payment_request.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 578971e71759787a5919c8b86588a58bbcb4abfd..1488357c31357fea6fa5a2c0a6c33ec56c3364a1 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -49,6 +49,7 @@ using blink::mojom::blink::PaymentOptions;
using blink::mojom::blink::PaymentOptionsPtr;
using blink::mojom::blink::PaymentShippingOption;
using blink::mojom::blink::PaymentShippingOptionPtr;
+using blink::mojom::blink::PaymentShippingType;
template <>
struct TypeConverter<PaymentCurrencyAmountPtr, blink::PaymentCurrencyAmount> {
@@ -151,6 +152,14 @@ struct TypeConverter<PaymentOptionsPtr, blink::PaymentOptions> {
output->request_payer_email = input.requestPayerEmail();
output->request_payer_phone = input.requestPayerPhone();
output->request_shipping = input.requestShipping();
+
+ if (input.shippingType() == "delivery")
+ output->shipping_type = PaymentShippingType::DELIVERY;
+ else if (input.shippingType() == "pickup")
+ output->shipping_type = PaymentShippingType::PICKUP;
+ else
+ output->shipping_type = PaymentShippingType::SHIPPING;
+
return output;
}
};
« no previous file with comments | « components/payments/payment_request.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698