stripe/model/
source_order.rs

1use serde::{Serialize, Deserialize};
2use super::{Shipping, SourceOrderItem};
3///
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct SourceOrder {
6    ///A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.
7    pub amount: i64,
8    ///Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
9    pub currency: String,
10    ///The email address of the customer placing the order.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub email: Option<String>,
13    ///List of items constituting the order.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub items: Option<Vec<SourceOrderItem>>,
16    ///
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub shipping: Option<Shipping>,
19}
20impl std::fmt::Display for SourceOrder {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
22        write!(f, "{}", serde_json::to_string(self).unwrap())
23    }
24}