delopay 0.2.0

Official Rust SDK for the DeloPay payments API
Documentation
//! 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>,
}