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
//! The saved payment method model.
use serde::Deserialize;
use serde_json::Value;
use crate::core::models::common::{PaymentMethod, PaymentMethodType};
/// A saved payment method as returned by the API.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodResponse {
/// Merchant account ID.
pub merchant_id: String,
/// Unique payment method ID.
pub payment_method_id: String,
/// Payment method family.
pub payment_method: PaymentMethod,
/// Owning customer, if any.
#[serde(default)]
pub customer_id: Option<String>,
/// Payment method sub-type.
#[serde(default)]
pub payment_method_type: Option<PaymentMethodType>,
/// Whether this method can be charged off-session (recurring).
#[serde(default)]
pub recurring_enabled: Option<bool>,
/// Token to charge this method on a later payment (pass as `payment_token`).
#[serde(default)]
pub payment_token: Option<String>,
/// Lifecycle status.
#[serde(default)]
pub status: Option<String>,
/// ISO 8601 creation timestamp.
#[serde(default)]
pub created: Option<String>,
/// Any additional response fields not modeled above (e.g. `card`).
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}