delopay 0.20.0

Official Rust SDK for the DeloPay payments API
Documentation
//! Processor cost schedule models: what the processor a merchant brought
//! itself charges it, as configured contract rates.

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

/// A recorded processor cost schedule.
///
/// A schedule prices the rails that report no fee on the payment itself. The
/// cost it produces is stamped `estimated` on the settlement line, never
/// `reported`.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ProcessorCostScheduleResponse {
    /// Schedule ID.
    pub id: String,
    /// The merchant the schedule belongs to.
    #[serde(default)]
    pub merchant_id: Option<String>,
    /// The one shop it covers. `None` covers every shop.
    #[serde(default)]
    pub shop_id: Option<String>,
    /// The connector the rate belongs to, e.g. `"stripe"`.
    pub connector: String,
    /// Payment-method scope, e.g. `"card"`. `None` covers any method.
    #[serde(default)]
    pub payment_method: Option<String>,
    /// Card-network scope, e.g. `"Visa"`. `None` covers any network.
    #[serde(default)]
    pub card_network: Option<String>,
    /// Payment-method-type scope. `None` covers any type.
    #[serde(default)]
    pub payment_method_type: Option<String>,
    /// The processor's own method identifier the rate is scoped to.
    #[serde(default)]
    pub connector_method_code: Option<String>,
    /// The processor's own commission, in percent.
    #[serde(default)]
    pub percentage: Option<f64>,
    /// The underlying provider's fee, in percent, added to
    /// [`percentage`](Self::percentage).
    #[serde(default)]
    pub provider_fee_percentage: Option<f64>,
    /// Flat component in minor units of [`flat_currency`](Self::flat_currency).
    #[serde(default)]
    pub flat_amount: Option<i64>,
    /// ISO 4217 currency of the fixed components. `None` states them in the
    /// transaction currency.
    #[serde(default)]
    pub flat_currency: Option<String>,
    /// Per-transaction floor.
    #[serde(default)]
    pub min_amount: Option<i64>,
    /// Per-transaction ceiling.
    #[serde(default)]
    pub max_amount: Option<i64>,
    /// When the rate starts applying (ISO 8601).
    pub effective_from: String,
    /// When it stops applying (ISO 8601, exclusive). `None` while open-ended.
    #[serde(default)]
    pub effective_to: Option<String>,
    /// Whether the schedule is active.
    pub is_active: bool,
    /// Free-text note.
    #[serde(default)]
    pub description: Option<String>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}