Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(router): remove metadata, additional_merchant_data and connector_wallets_details from connector list api (#6583)

AkshayaFoiger5611769964e3
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index c6a1fad0d3..661e51f6c1 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -10020,11 +10020,6 @@
],
"nullable": true
},
- "metadata": {
- "type": "object",
- "description": "Metadata is useful for storing additional, unstructured information on an object.",
- "nullable": true
- },
"disabled": {
"type": "boolean",
"description": "A boolean value to indicate if the connector is disabled. By default, its value is false.",
@@ -10055,22 +10050,6 @@
},
"status": {
"$ref": "#/components/schemas/ConnectorStatus"
- },
- "additional_merchant_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/AdditionalMerchantData"
- }
- ],
- "nullable": true
- },
- "connector_wallets_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ConnectorWalletDetails"
- }
- ],
- "nullable": true
}
},
"additionalProperties": false
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index 353e9d5d49..801b32b490 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -13159,11 +13159,6 @@
],
"nullable": true
},
- "metadata": {
- "type": "object",
- "description": "Metadata is useful for storing additional, unstructured information on an object.",
- "nullable": true
- },
"test_mode": {
"type": "boolean",
"description": "A boolean value to indicate if the connector is in Test mode. By default, its value is false.",
@@ -13221,22 +13216,6 @@
},
"status": {
"$ref": "#/components/schemas/ConnectorStatus"
- },
- "additional_merchant_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/AdditionalMerchantData"
- }
- ],
- "nullable": true
- },
- "connector_wallets_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ConnectorWalletDetails"
- }
- ],
- "nullable": true
}
},
"additionalProperties": false
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index d80a4ea11b..8ba5064923 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<Vec<PaymentMethodsEnabled>>,
- /// Metadata is useful for storing additional, unstructured information on an object.
- #[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
- pub metadata: Option<pii::SecretSerdeValue>,
-
/// 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<bool>,
@@ -1349,13 +1345,6 @@ pub struct MerchantConnectorListResponse {
#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: api_enums::ConnectorStatus,
-
- #[schema(value_type = Option<AdditionalMerchantData>)]
- pub additional_merchant_data: Option<AdditionalMerchantData>,
-
- /// The connector_wallets_details is used to store wallet details such as certificates and wallet credentials
- #[schema(value_type = Option<ConnectorWalletDetails>)]
- pub connector_wallets_details: Option<ConnectorWalletDetails>,
}
#[cfg(feature = "v1")]
@@ -1423,10 +1412,6 @@ pub struct MerchantConnectorListResponse {
]))]
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
- /// Metadata is useful for storing additional, unstructured information on an object.
- #[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
- pub metadata: Option<pii::SecretSerdeValue>,
-
/// A boolean value to indicate if the connector is disabled. By default, its value is false.
#[schema(default = false, example = false)]
pub disabled: Option<bool>,
@@ -1443,13 +1428,6 @@ pub struct MerchantConnectorListResponse {
#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: api_enums::ConnectorStatus,
-
- #[schema(value_type = Option<AdditionalMerchantData>)]
- pub additional_merchant_data: Option<AdditionalMerchantData>,
-
- /// The connector_wallets_details is used to store wallet details such as certificates and wallet credentials
- #[schema(value_type = Option<ConnectorWalletDetails>)]
- pub connector_wallets_details: Option<ConnectorWalletDetails>,
}
#[cfg(feature = "v2")]
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index 8fe910cd7b..c47c0ca342 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -1028,7 +1028,6 @@ impl ForeignTryFrom<domain::MerchantConnectorAccount>
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,
@@ -1037,31 +1036,6 @@ impl ForeignTryFrom<domain::MerchantConnectorAccount>
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::<router_types::AdditionalMerchantData>(
- 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::<api_models::admin::ConnectorWalletDetails>(
- "ConnectorWalletDetails",
- )
- .attach_printable("Unable to deserialize connector_wallets_details")
- .change_context(errors::ApiErrorResponse::InternalServerError)
- })
- .transpose()?,
};
#[cfg(feature = "v2")]
let response = Self {
@@ -1071,37 +1045,11 @@ impl ForeignTryFrom<domain::MerchantConnectorAccount>
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::<router_types::AdditionalMerchantData>(
- 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::<api_models::admin::ConnectorWalletDetails>(
- "ConnectorWalletDetails",
- )
- .attach_printable("Unable to deserialize connector_wallets_details")
- .change_context(errors::ApiErrorResponse::InternalServerError)
- })
- .transpose()?,
};
Ok(response)
}
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 6204c86f44..5ed6617ae4 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -631,6 +631,11 @@ Cypress.Commands.add("connectorListByMid", (globalState) => {
logRequestId(response.headers["x-request-id"]);
expect(response.headers["content-type"]).to.include("application/json");
expect(response.body).to.be.an("array").and.not.empty;
+ response.body.forEach((item) => {
+ expect(item).to.not.have.property("metadata");
+ expect(item).to.not.have.property("additional_merchant_data");
+ expect(item).to.not.have.property("connector_wallets_details");
+ });
});
});