stripe/model/treasury_transaction.rs
1use serde::{Serialize, Deserialize};
2use super::{
3 TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions,
4 TreasuryTransactionsResourceBalanceImpact,
5 TreasuryTransactionsResourceTransactionEntryList,
6};
7///Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance.
8#[derive(Debug, Clone, Serialize, Deserialize, Default)]
9pub struct TreasuryTransaction {
10 ///Amount (in cents) transferred.
11 pub amount: i64,
12 ///Change to a FinancialAccount's balance
13 pub balance_impact: TreasuryTransactionsResourceBalanceImpact,
14 ///Time at which the object was created. Measured in seconds since the Unix epoch.
15 pub created: i64,
16 ///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).
17 pub currency: String,
18 ///An arbitrary string attached to the object. Often useful for displaying to users.
19 pub description: String,
20 ///A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints.
21 #[serde(skip_serializing_if = "Option::is_none")]
22 pub entries: Option<TreasuryTransactionsResourceTransactionEntryList>,
23 ///The FinancialAccount associated with this object.
24 pub financial_account: String,
25 ///ID of the flow that created the Transaction.
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub flow: Option<String>,
28 ///Details of the flow that created the Transaction.
29 #[serde(skip_serializing_if = "Option::is_none")]
30 pub flow_details: Option<serde_json::Value>,
31 ///Type of the flow that created the Transaction.
32 pub flow_type: String,
33 ///Unique identifier for the object.
34 pub id: String,
35 ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
36 pub livemode: bool,
37 ///String representing the object's type. Objects of the same type share the same value.
38 pub object: String,
39 ///Status of the Transaction.
40 pub status: String,
41 ///
42 pub status_transitions: TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions,
43}
44impl std::fmt::Display for TreasuryTransaction {
45 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
46 write!(f, "{}", serde_json::to_string(self).unwrap())
47 }
48}