coinbase_advanced/models/payment.rs
1//! Payment method types.
2
3use serde::Deserialize;
4
5/// A payment method available to the user.
6#[derive(Debug, Clone, Deserialize)]
7pub struct PaymentMethod {
8 /// Unique identifier for the payment method.
9 pub id: String,
10 /// The payment method type.
11 #[serde(rename = "type")]
12 pub payment_type: String,
13 /// Name for the payment method.
14 pub name: String,
15 /// Currency symbol for the payment method.
16 pub currency: String,
17 /// The verified status of the payment method.
18 #[serde(default)]
19 pub verified: bool,
20 /// Whether this payment method can perform buys.
21 #[serde(default)]
22 pub allow_buy: bool,
23 /// Whether this payment method can perform sells.
24 #[serde(default)]
25 pub allow_sell: bool,
26 /// Whether this payment method can perform deposits.
27 #[serde(default)]
28 pub allow_deposit: bool,
29 /// Whether this payment method can perform withdrawals.
30 #[serde(default)]
31 pub allow_withdraw: bool,
32 /// Time at which this payment method was created.
33 #[serde(default)]
34 pub created_at: Option<String>,
35 /// Time at which this payment method was updated.
36 #[serde(default)]
37 pub updated_at: Option<String>,
38}
39
40/// Response containing a list of payment methods.
41#[derive(Debug, Clone, Deserialize)]
42pub struct ListPaymentMethodsResponse {
43 /// The payment methods.
44 pub payment_methods: Vec<PaymentMethod>,
45}
46
47/// Response containing a single payment method.
48#[derive(Debug, Clone, Deserialize)]
49pub struct GetPaymentMethodResponse {
50 /// The payment method.
51 pub payment_method: PaymentMethod,
52}