stripe/model/
fee.rs

1use serde::{Serialize, Deserialize};
2///
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct Fee {
5    ///Amount of the fee, in cents.
6    pub amount: i64,
7    ///ID of the Connect application that earned the fee.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub application: Option<String>,
10    ///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).
11    pub currency: String,
12    ///An arbitrary string attached to the object. Often useful for displaying to users.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub description: Option<String>,
15    ///Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`.
16    #[serde(rename = "type")]
17    pub type_: String,
18}
19impl std::fmt::Display for Fee {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21        write!(f, "{}", serde_json::to_string(self).unwrap())
22    }
23}