fix(docs): open-api fix for payment response (#5103)

Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-G961M60MK7.local>
This commit is contained in:
chikke srujan
2024-06-26 19:00:02 +05:30
committed by GitHub
parent 1c464acc56
commit 2e1167acbc
3 changed files with 299 additions and 8 deletions

View File

@ -2662,17 +2662,21 @@ pub struct ApplepayPaymentMethod {
pub pm_type: String,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct CardResponse {
pub last4: Option<String>,
pub card_type: Option<String>,
#[schema(value_type = Option<CardNetwork>, example = "Visa")]
pub card_network: Option<api_enums::CardNetwork>,
pub card_issuer: Option<String>,
pub card_issuing_country: Option<String>,
pub card_isin: Option<String>,
pub card_extended_bin: Option<String>,
#[schema(value_type = Option<String>)]
pub card_exp_month: Option<Secret<String>>,
#[schema(value_type = Option<String>)]
pub card_exp_year: Option<Secret<String>>,
#[schema(value_type = Option<String>)]
pub card_holder_name: Option<Secret<String>>,
pub payment_checks: Option<serde_json::Value>,
pub authentication_data: Option<serde_json::Value>,
@ -2799,7 +2803,7 @@ where
}
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodDataResponse {
#[serde(rename = "card")]
@ -2821,12 +2825,12 @@ pub enum PaymentMethodDataResponse {
CardToken {},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct PaylaterResponse {
klarna_sdk: Option<KlarnaSdkPaymentMethodResponse>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct KlarnaSdkPaymentMethodResponse {
pub payment_type: Option<String>,
@ -3400,12 +3404,12 @@ pub struct PaymentsResponse {
pub capture_method: Option<api_enums::CaptureMethod>,
/// The payment method that is to be used
#[schema(value_type = PaymentMethodType, example = "bank_transfer")]
#[schema(value_type = PaymentMethod, example = "bank_transfer")]
#[auth_based]
pub payment_method: Option<api_enums::PaymentMethod>,
/// The payment method information provided for making a payment
#[schema(value_type = Option<PaymentMethod>, example = "bank_transfer")]
#[schema(value_type = Option<PaymentMethodDataResponseWithBilling>, example = "bank_transfer")]
#[auth_based]
#[serde(serialize_with = "serialize_payment_method_data_response")]
pub payment_method_data: Option<PaymentMethodDataResponseWithBilling>,