doc: update openapi (#453)

Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in>
Co-authored-by: dracarys18 <karthikey.hegde@juspay.in>
Co-authored-by: bernard eugine <bernard.eugine@bernard.eugine-MacBookPro>
Co-authored-by: Abhishek Marrivagu <abhi.codes10@gmail.com>
This commit is contained in:
bernard-eugine
2023-01-30 16:56:37 +05:30
committed by GitHub
parent d3ef24e8e9
commit ec2f4ba257
40 changed files with 3314 additions and 283 deletions

View File

@ -1,5 +1,6 @@
use masking::Secret;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
use crate::{enums as api_enums, payments};
@ -8,30 +9,54 @@ pub struct MandateId {
pub mandate_id: String,
}
#[derive(Default, Debug, Deserialize, Serialize)]
#[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)]
#[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<MandateCardDetails>,
/// Details about the customers acceptance
#[schema(value_type = Option<CustomerAcceptance>)]
pub customer_acceptance: Option<payments::CustomerAcceptance>,
}
#[derive(Default, Debug, Deserialize, Serialize)]
#[derive(Default, Debug, Deserialize, Serialize, ToSchema)]
pub struct MandateCardDetails {
/// The last 4 digits of card
pub last4_digits: Option<String>,
/// The expiry month of card
#[schema(value_type = Option<String>)]
pub card_exp_month: Option<Secret<String>>,
/// The expiry year of card
#[schema(value_type = Option<String>)]
pub card_exp_year: Option<Secret<String>>,
/// The card holder name
#[schema(value_type = Option<String>)]
pub card_holder_name: Option<Secret<String>>,
/// The token from card locker
#[schema(value_type = Option<String>)]
pub card_token: Option<Secret<String>>,
/// The card scheme network for the particular card
pub scheme: Option<String>,
/// The country code in in which the card was issued
pub issuer_country: Option<String>,
#[schema(value_type = Option<String>)]
/// A unique identifier alias to identify a particular card
pub card_fingerprint: Option<Secret<String>>,
}