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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
use params::{List, Metadata, Timestamp};
use resources::BankAccount;
use serde_json as json;
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct DeclineChargeDetails {
#[serde(skip_serializing_if = "Option::is_none")]
pub avs_failure: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cvc_failure: Option<bool>,
}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct PayoutScheduleDetails {
pub delay_days: u64,
pub interval: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub monthly_anchor: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub weekly_anchor: Option<String>,
}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct TOSAcceptanceDetails {
#[serde(skip_serializing_if = "Option::is_none")]
pub date: Option<Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub user_agent: Option<String>,
}
#[derive(Serialize)]
pub struct AccountParams<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<&'a str>,
#[serde(rename = "type")]
pub account_type: &'static str,
}
#[derive(Debug, Deserialize)]
pub struct Account {
pub id: String,
pub object: String,
pub business_name: String,
pub business_url: Option<String>,
pub charges_enabed: bool,
pub country: String,
pub debit_negative_balances: Option<bool>,
pub decline_charge_on: Option<DeclineChargeDetails>,
pub default_currency: String,
pub details_submitted: bool,
pub display_name: String,
pub email: String,
pub external_accounts: List<BankAccount>,
pub legal_entity: Option<json::Value>,
pub metadata: Metadata,
pub payout_schedule: Option<PayoutScheduleDetails>,
pub payout_statement_descriptor: Option<String>,
pub payouts_enabled: bool,
pub product_description: Option<String>,
pub statement_descriptor: String,
pub support_email: String,
pub support_phone: String,
pub timezone: String,
pub tos_acceptance: Option<TOSAcceptanceDetails>,
#[serde(rename = "type")]
pub account_type: Option<String>,
pub verification: Option<json::Value>,
}