paypal_rust/resources/shipping_option.rs
1use crate::resources::enums::shipping_type::ShippingType;
2use crate::resources::money::Money;
3use serde::{Deserialize, Serialize};
4use serde_with::skip_serializing_none;
5
6#[skip_serializing_none]
7#[derive(Clone, Debug, Default, Deserialize, Serialize)]
8pub struct ShippingOption {
9 /// A unique ID that identifies a payer-selected shipping option.
10 pub id: String,
11
12 /// A description that the payer sees, which helps them choose an appropriate shipping option. For example, Free Shipping,
13 /// USPS Priority Shipping, Expédition prioritaire USPS, or USPS yōuxiān fā huò. Localize this description to the payer's locale.
14 pub label: String,
15
16 /// The method by which the payer wants to get their items.
17 #[serde(rename = "type")]
18 pub type_: Option<ShippingType>,
19
20 /// The shipping cost for the selected option.
21 pub amount: Option<Money>,
22
23 /// If the API request sets selected = true, it represents the shipping option that the payee or merchant expects to be pre-selected
24 /// for the payer when they first view the shipping.options in the PayPal Checkout experience. As part of the response if a
25 /// `shipping.option` contains selected=true, it represents the shippingoption that the payer selected during the course of checkout with
26 /// PayPal. Only one shipping.option can be set to selected=true.
27 pub selected: bool,
28}