blob: a92ccce9d7d97719080f57a6b51d48cb4ee23a5f [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/strings/string16.h"
#include "components/payments/core/payment_currency_amount.h"
// C++ bindings for the PaymentRequest API PaymentShippingOption. Conforms to
// the following spec:
namespace base {
class DictionaryValue;
namespace payments {
// Information describing a shipping option.
class PaymentShippingOption {
PaymentShippingOption(const PaymentShippingOption& other);
bool operator==(const PaymentShippingOption& other) const;
bool operator!=(const PaymentShippingOption& other) const;
PaymentShippingOption& operator=(const PaymentShippingOption& other);
// Populates the properties of this PaymentShippingOption from |value|.
// Returns true if the required values are present.
bool FromDictionaryValue(const base::DictionaryValue& value);
// An identifier used to reference this PaymentShippingOption. It is unique
// for a given PaymentRequest.
std::string id;
// A human-readable description of the item. The user agent should use this
// string to display the shipping option to the user.
std::string label;
// A PaymentCurrencyAmount containing the monetary amount for the option.
mojom::PaymentCurrencyAmountPtr amount;
// This is set to true to indicate that this is the default selected
// PaymentShippingOption in a sequence. User agents should display this option
// by default in the user interface.
bool selected;
} // namespace payments