1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use params::{Identifiable, List, Metadata, Timestamp};
use resources::Currency;

/// The resource representing a Stripe transfer reversal.
///
/// For more details see https://stripe.com/docs/api#transfer_reversal_object.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TransferReversal {
    pub id: String,
    pub object: String,
    pub amount: u64,
    pub balance_transaction: String,
    pub created: Timestamp,
    pub currency: Currency,
    pub metadata: Metadata,
    pub transfer: String,
}

impl Identifiable for TransferReversal {
    fn id(&self) -> &str {
        &self.id
    }
}

/// The resource representing a Stripe transfer.
///
/// For more details see https://stripe.com/docs/api#transfer_object.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Transfer {
    pub id: String,
    pub object: String,
    pub amount: u64,
    pub amount_reversed: u64,
    pub balance_transaction: String,
    pub created: Timestamp,
    pub currency: Currency,
    pub description: Option<String>,
    pub destination: String,
    pub destination_payment: String,
    pub livemode: bool,
    pub metadata: Metadata,
    pub reversals: List<TransferReversal>,
    pub reversed: bool,
    pub source_transaction: String,
    pub source_type: String,
    pub transfer_group: String,
}

impl Identifiable for Transfer {
    fn id(&self) -> &str {
        &self.id
    }
}