stripe/model/
treasury_inbound_transfer.rs

1use serde::{Serialize, Deserialize};
2use super::{
3    TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows,
4    TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions,
5};
6///Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
7#[derive(Debug, Clone, Serialize, Deserialize, Default)]
8pub struct TreasuryInboundTransfer {
9    ///Amount (in cents) transferred.
10    pub amount: i64,
11    ///Returns `true` if the InboundTransfer is able to be canceled.
12    pub cancelable: bool,
13    ///Time at which the object was created. Measured in seconds since the Unix epoch.
14    pub created: i64,
15    ///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).
16    pub currency: String,
17    ///An arbitrary string attached to the object. Often useful for displaying to users.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub description: Option<String>,
20    ///Details about this InboundTransfer's failure. Only set when status is `failed`.
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub failure_details: Option<serde_json::Value>,
23    ///The FinancialAccount that received the funds.
24    pub financial_account: String,
25    ///A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub hosted_regulatory_receipt_url: Option<String>,
28    ///Unique identifier for the object.
29    pub id: String,
30    ///
31    pub linked_flows: TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows,
32    ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
33    pub livemode: bool,
34    ///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.
35    pub metadata: serde_json::Value,
36    ///String representing the object's type. Objects of the same type share the same value.
37    pub object: String,
38    ///The origin payment method to be debited for an InboundTransfer.
39    pub origin_payment_method: String,
40    ///Details about the PaymentMethod for an InboundTransfer.
41    #[serde(skip_serializing_if = "Option::is_none")]
42    pub origin_payment_method_details: Option<serde_json::Value>,
43    ///Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state.
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub returned: Option<bool>,
46    ///Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`.
47    pub statement_descriptor: String,
48    ///Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails.
49    pub status: String,
50    ///
51    pub status_transitions: TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions,
52    ///The Transaction associated with this object.
53    #[serde(skip_serializing_if = "Option::is_none")]
54    pub transaction: Option<serde_json::Value>,
55}
56impl std::fmt::Display for TreasuryInboundTransfer {
57    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
58        write!(f, "{}", serde_json::to_string(self).unwrap())
59    }
60}