stripe/model/
treasury_outbound_transfer.rs

1use serde::{Serialize, Deserialize};
2use super::{
3    OutboundTransfersPaymentMethodDetails,
4    TreasuryOutboundTransfersResourceStatusTransitions,
5};
6/**Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
7
8Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.*/
9#[derive(Debug, Clone, Serialize, Deserialize, Default)]
10pub struct TreasuryOutboundTransfer {
11    ///Amount (in cents) transferred.
12    pub amount: i64,
13    ///Returns `true` if the object can be canceled, and `false` otherwise.
14    pub cancelable: bool,
15    ///Time at which the object was created. Measured in seconds since the Unix epoch.
16    pub created: i64,
17    ///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).
18    pub currency: String,
19    ///An arbitrary string attached to the object. Often useful for displaying to users.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    ///The PaymentMethod used as the payment instrument for an OutboundTransfer.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub destination_payment_method: Option<String>,
25    ///
26    pub destination_payment_method_details: OutboundTransfersPaymentMethodDetails,
27    ///The date when funds are expected to arrive in the destination account.
28    pub expected_arrival_date: i64,
29    ///The FinancialAccount that funds were pulled from.
30    pub financial_account: String,
31    ///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.
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub hosted_regulatory_receipt_url: Option<String>,
34    ///Unique identifier for the object.
35    pub id: String,
36    ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
37    pub livemode: bool,
38    ///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.
39    pub metadata: serde_json::Value,
40    ///String representing the object's type. Objects of the same type share the same value.
41    pub object: String,
42    ///Details about a returned OutboundTransfer. Only set when the status is `returned`.
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub returned_details: Option<serde_json::Value>,
45    ///Information about the OutboundTransfer to be sent to the recipient account.
46    pub statement_descriptor: String,
47    ///Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`.
48    pub status: String,
49    ///
50    pub status_transitions: TreasuryOutboundTransfersResourceStatusTransitions,
51    ///The Transaction associated with this object.
52    pub transaction: serde_json::Value,
53}
54impl std::fmt::Display for TreasuryOutboundTransfer {
55    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
56        write!(f, "{}", serde_json::to_string(self).unwrap())
57    }
58}