From a384d96d026ecfa4723423b7f1026fca60ed0b61 Mon Sep 17 00:00:00 2001 From: "kiran.kummari" Date: Tue, 6 Aug 2024 09:19:41 +0530 Subject: [PATCH] changes to configs urls --- crates/hyperswitch_interfaces/src/configs.rs | 15 +++++++++++--- crates/router/src/connector/adyen.rs | 21 +++----------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/crates/hyperswitch_interfaces/src/configs.rs b/crates/hyperswitch_interfaces/src/configs.rs index 1fe4aac8eaf1..8a599f597cda 100644 --- a/crates/hyperswitch_interfaces/src/configs.rs +++ b/crates/hyperswitch_interfaces/src/configs.rs @@ -23,7 +23,7 @@ pub struct Connectors { pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, - pub bluesnap: ConnectorParamsWithThreeBaseUrls, + pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, @@ -139,7 +139,7 @@ pub struct ConnectorParamsWithFileUploadUrl { pub base_url_file_upload: String, } -/// struct ConnectorParamsWithSecondaryBaseUrl +/// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeBaseUrls { @@ -148,5 +148,14 @@ pub struct ConnectorParamsWithThreeBaseUrls { /// secondary base url pub secondary_base_url: String, /// third base url - pub third_base_url: Option, + pub third_base_url: String, +} +/// struct ConnectorParamsWithSecondaryBaseUrl +#[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] +#[serde(default)] +pub struct ConnectorParamsWithSecondaryBaseUrl { + /// base url + pub base_url: String, + /// secondary base url + pub secondary_base_url: String, } diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index 03ca17d8ed0b..d418cd77614b 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -1946,12 +1946,7 @@ impl connectors: &settings::Connectors, ) -> CustomResult { let endpoint = build_env_specific_endpoint( - connectors - .adyen - .third_base_url - .clone() - .ok_or(errors::ConnectorError::FailedToObtainIntegrationUrl)? - .as_str(), + connectors.adyen.third_base_url.as_str(), req.test_mode, &req.connector_meta_data, )?; @@ -2042,12 +2037,7 @@ impl connectors: &settings::Connectors, ) -> CustomResult { let endpoint = build_env_specific_endpoint( - connectors - .adyen - .third_base_url - .clone() - .ok_or(errors::ConnectorError::FailedToObtainIntegrationUrl)? - .as_str(), + connectors.adyen.third_base_url.as_str(), req.test_mode, &req.connector_meta_data, )?; @@ -2138,12 +2128,7 @@ impl connectors: &settings::Connectors, ) -> CustomResult { let endpoint = build_env_specific_endpoint( - connectors - .adyen - .third_base_url - .clone() - .ok_or(errors::ConnectorError::FailedToObtainIntegrationUrl)? - .as_str(), + connectors.adyen.third_base_url.as_str(), req.test_mode, &req.connector_meta_data, )?;