refactor(connector): [Payme] Rename types to follow naming conventions (#2096)

This commit is contained in:
Sakil Mostak
2023-09-06 23:38:24 +05:30
committed by GitHub
parent 8246f4e9c3
commit 98d70054e2

View File

@ -102,24 +102,24 @@ pub struct GenerateSaleRequest {
seller_payme_id: Secret<String>, seller_payme_id: Secret<String>,
sale_callback_url: String, sale_callback_url: String,
sale_payment_method: SalePaymentMethod, sale_payment_method: SalePaymentMethod,
services: Option<ThreeDS>, services: Option<ThreeDs>,
language: String, language: String,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub struct ThreeDS { pub struct ThreeDs {
name: ThreeDSType, name: ThreeDsType,
settings: ThreeDSSettings, settings: ThreeDsSettings,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub enum ThreeDSType { pub enum ThreeDsType {
#[serde(rename = "3D Secure")] #[serde(rename = "3D Secure")]
ThreeDS, ThreeDs,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub struct ThreeDSSettings { pub struct ThreeDsSettings {
active: bool, active: bool,
} }
@ -939,12 +939,12 @@ impl<F, T>
} }
} }
fn get_services(item: &types::PaymentsPreProcessingRouterData) -> Option<ThreeDS> { fn get_services(item: &types::PaymentsPreProcessingRouterData) -> Option<ThreeDs> {
match item.auth_type { match item.auth_type {
api_models::enums::AuthenticationType::ThreeDs => { api_models::enums::AuthenticationType::ThreeDs => {
let settings = ThreeDSSettings { active: true }; let settings = ThreeDsSettings { active: true };
Some(ThreeDS { Some(ThreeDs {
name: ThreeDSType::ThreeDS, name: ThreeDsType::ThreeDs,
settings, settings,
}) })
} }