delopay 0.2.0

Official Rust SDK for the DeloPay payments API
Documentation
//! The refund model.

use serde::Deserialize;
use serde_json::Value;

use crate::core::models::common::RefundStatus;

/// A refund as returned by the API.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct RefundResponse {
    /// Unique refund ID.
    pub refund_id: String,
    /// ID of the payment this refund belongs to.
    pub payment_id: String,
    /// Refunded amount in minor units.
    pub amount: i64,
    /// Three-letter ISO 4217 currency code.
    pub currency: String,
    /// Current status.
    pub status: RefundStatus,
    /// Connector that processed the refund.
    #[serde(default)]
    pub connector: Option<String>,
    /// Reason provided at creation.
    #[serde(default)]
    pub reason: Option<String>,
    /// Gateway error code if the refund failed.
    #[serde(default)]
    pub error_code: Option<String>,
    /// Human-readable error message if the refund failed.
    #[serde(default)]
    pub error_message: Option<String>,
    /// Shop (business profile) ID.
    #[serde(default)]
    pub profile_id: Option<String>,
    /// ISO 8601 creation timestamp.
    #[serde(default)]
    pub created_at: Option<String>,
    /// Arbitrary metadata.
    #[serde(default)]
    pub metadata: Option<Value>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}