stripe/model/issuing_transaction.rs
1use serde::{Serialize, Deserialize};
2use super::IssuingAuthorizationMerchantData;
3/**Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving
4your Stripe account, such as a completed purchase or refund, is represented by an Issuing
5`Transaction` object.
6
7Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions)*/
8#[derive(Debug, Clone, Serialize, Deserialize, Default)]
9pub struct IssuingTransaction {
10 ///The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11 pub amount: i64,
12 ///Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
13 #[serde(skip_serializing_if = "Option::is_none")]
14 pub amount_details: Option<serde_json::Value>,
15 ///The `Authorization` object that led to this transaction.
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub authorization: Option<serde_json::Value>,
18 ///ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction.
19 #[serde(skip_serializing_if = "Option::is_none")]
20 pub balance_transaction: Option<serde_json::Value>,
21 ///The card used to make this transaction.
22 pub card: serde_json::Value,
23 ///The cardholder to whom this transaction belongs.
24 #[serde(skip_serializing_if = "Option::is_none")]
25 pub cardholder: Option<serde_json::Value>,
26 ///Time at which the object was created. Measured in seconds since the Unix epoch.
27 pub created: i64,
28 ///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).
29 pub currency: String,
30 ///If you've disputed the transaction, the ID of the dispute.
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub dispute: Option<serde_json::Value>,
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 ///The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency.
38 pub merchant_amount: i64,
39 ///The currency with which the merchant is taking payment.
40 pub merchant_currency: String,
41 ///
42 pub merchant_data: IssuingAuthorizationMerchantData,
43 ///Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
44 pub metadata: serde_json::Value,
45 ///Details about the transaction, such as processing dates, set by the card network.
46 #[serde(skip_serializing_if = "Option::is_none")]
47 pub network_data: Option<serde_json::Value>,
48 ///String representing the object's type. Objects of the same type share the same value.
49 pub object: String,
50 ///Additional purchase information that is optionally provided by the merchant.
51 #[serde(skip_serializing_if = "Option::is_none")]
52 pub purchase_details: Option<serde_json::Value>,
53 ///[Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub token: Option<serde_json::Value>,
56 ///[Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
57 #[serde(skip_serializing_if = "Option::is_none")]
58 pub treasury: Option<serde_json::Value>,
59 ///The nature of the transaction.
60 #[serde(rename = "type")]
61 pub type_: String,
62 ///The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`.
63 #[serde(skip_serializing_if = "Option::is_none")]
64 pub wallet: Option<String>,
65}
66impl std::fmt::Display for IssuingTransaction {
67 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
68 write!(f, "{}", serde_json::to_string(self).unwrap())
69 }
70}