use masking::Secret; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; use utoipa::ToSchema; use crate::{enums as api_enums, payments}; #[derive(Default, Debug, Deserialize, Serialize)] pub struct MandateId { pub mandate_id: String, } #[derive(Default, Debug, Deserialize, Serialize, ToSchema)] pub struct MandateRevokedResponse { /// The identifier for mandate pub mandate_id: String, /// The status for mandates #[schema(value_type = MandateStatus)] pub status: api_enums::MandateStatus, } #[derive(Default, Debug, Deserialize, Serialize, ToSchema)] pub struct MandateResponse { /// The identifier for mandate pub mandate_id: String, /// The status for mandates #[schema(value_type = MandateStatus)] pub status: api_enums::MandateStatus, /// The identifier for payment method pub payment_method_id: String, /// The payment method pub payment_method: String, /// The card details for mandate pub card: Option, /// Details about the customer’s acceptance #[schema(value_type = Option)] pub customer_acceptance: Option, } #[derive(Default, Debug, Deserialize, Serialize, ToSchema)] pub struct MandateCardDetails { /// The last 4 digits of card pub last4_digits: Option, /// The expiry month of card #[schema(value_type = Option)] pub card_exp_month: Option>, /// The expiry year of card #[schema(value_type = Option)] pub card_exp_year: Option>, /// The card holder name #[schema(value_type = Option)] pub card_holder_name: Option>, /// The token from card locker #[schema(value_type = Option)] pub card_token: Option>, /// The card scheme network for the particular card pub scheme: Option, /// The country code in in which the card was issued pub issuer_country: Option, #[schema(value_type = Option)] /// A unique identifier alias to identify a particular card pub card_fingerprint: Option>, } #[derive(Clone, Debug, Deserialize, ToSchema)] #[serde(deny_unknown_fields)] pub struct MandateListConstraints { /// limit on the number of objects to return pub limit: Option, /// status of the mandate pub mandate_status: Option, /// connector linked to mandate pub connector: Option, /// The time at which mandate is created #[schema(example = "2022-09-10T10:11:12Z")] pub created_time: Option, /// Time less than the mandate created time #[schema(example = "2022-09-10T10:11:12Z")] #[serde(rename = "created_time.lt")] pub created_time_lt: Option, /// Time greater than the mandate created time #[schema(example = "2022-09-10T10:11:12Z")] #[serde(rename = "created_time.gt")] pub created_time_gt: Option, /// Time less than or equals to the mandate created time #[schema(example = "2022-09-10T10:11:12Z")] #[serde(rename = "created_time.lte")] pub created_time_lte: Option, /// Time greater than or equals to the mandate created time #[schema(example = "2022-09-10T10:11:12Z")] #[serde(rename = "created_time.gte")] pub created_time_gte: Option, }