From e04e0fcbf2b9e02fb82afe9bc6388307e70af5e0 Mon Sep 17 00:00:00 2001 From: AkshayaFoiger Date: Fri, 15 Nov 2024 16:03:35 +0530 Subject: [PATCH] remove fields from MerchantConnectorListResponse --- crates/api_models/src/admin.rs | 22 ----------- crates/router/src/types/transformers.rs | 52 ------------------------- 2 files changed, 74 deletions(-) diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs index 96335f34710c..1c1a9484f268 100644 --- a/crates/api_models/src/admin.rs +++ b/crates/api_models/src/admin.rs @@ -1313,10 +1313,6 @@ pub struct MerchantConnectorListResponse { ]))] pub payment_methods_enabled: Option>, - /// Metadata is useful for storing additional, unstructured information on an object. - #[schema(value_type = Option,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))] - pub metadata: Option, - /// A boolean value to indicate if the connector is in Test mode. By default, its value is false. #[schema(default = false, example = false)] pub test_mode: Option, @@ -1349,13 +1345,6 @@ pub struct MerchantConnectorListResponse { #[schema(value_type = ConnectorStatus, example = "inactive")] pub status: api_enums::ConnectorStatus, - - #[schema(value_type = Option)] - pub additional_merchant_data: Option, - - /// The connector_wallets_details is used to store wallet details such as certificates and wallet credentials - #[schema(value_type = Option)] - pub connector_wallets_details: Option, } #[cfg(feature = "v1")] @@ -1423,10 +1412,6 @@ pub struct MerchantConnectorListResponse { ]))] pub payment_methods_enabled: Option>, - /// Metadata is useful for storing additional, unstructured information on an object. - #[schema(value_type = Option,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))] - pub metadata: Option, - /// A boolean value to indicate if the connector is disabled. By default, its value is false. #[schema(default = false, example = false)] pub disabled: Option, @@ -1443,13 +1428,6 @@ pub struct MerchantConnectorListResponse { #[schema(value_type = ConnectorStatus, example = "inactive")] pub status: api_enums::ConnectorStatus, - - #[schema(value_type = Option)] - pub additional_merchant_data: Option, - - /// The connector_wallets_details is used to store wallet details such as certificates and wallet credentials - #[schema(value_type = Option)] - pub connector_wallets_details: Option, } #[cfg(feature = "v2")] diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index c97084a22977..be6866777e89 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -1022,7 +1022,6 @@ impl ForeignTryFrom test_mode: item.test_mode, disabled: item.disabled, payment_methods_enabled, - metadata: item.metadata, business_country: item.business_country, business_label: item.business_label, business_sub_label: item.business_sub_label, @@ -1031,31 +1030,6 @@ impl ForeignTryFrom applepay_verified_domains: item.applepay_verified_domains, pm_auth_config: item.pm_auth_config, status: item.status, - additional_merchant_data: item - .additional_merchant_data - .map(|data| { - let data = data.into_inner(); - serde_json::Value::parse_value::( - data.expose(), - "AdditionalMerchantData", - ) - .attach_printable("Unable to deserialize additional_merchant_data") - .change_context(errors::ApiErrorResponse::InternalServerError) - }) - .transpose()? - .map(api_models::admin::AdditionalMerchantData::foreign_from), - connector_wallets_details: item - .connector_wallets_details - .map(|data| { - data.into_inner() - .expose() - .parse_value::( - "ConnectorWalletDetails", - ) - .attach_printable("Unable to deserialize connector_wallets_details") - .change_context(errors::ApiErrorResponse::InternalServerError) - }) - .transpose()?, }; #[cfg(feature = "v2")] let response = Self { @@ -1065,37 +1039,11 @@ impl ForeignTryFrom connector_label: item.connector_label, disabled: item.disabled, payment_methods_enabled, - metadata: item.metadata, frm_configs, profile_id: item.profile_id, applepay_verified_domains: item.applepay_verified_domains, pm_auth_config: item.pm_auth_config, status: item.status, - additional_merchant_data: item - .additional_merchant_data - .map(|data| { - let data = data.into_inner(); - serde_json::Value::parse_value::( - data.expose(), - "AdditionalMerchantData", - ) - .attach_printable("Unable to deserialize additional_merchant_data") - .change_context(errors::ApiErrorResponse::InternalServerError) - }) - .transpose()? - .map(api_models::admin::AdditionalMerchantData::foreign_from), - connector_wallets_details: item - .connector_wallets_details - .map(|data| { - data.into_inner() - .expose() - .parse_value::( - "ConnectorWalletDetails", - ) - .attach_printable("Unable to deserialize connector_wallets_details") - .change_context(errors::ApiErrorResponse::InternalServerError) - }) - .transpose()?, }; Ok(response) }