refactor(router): add display_name field to connector feature api (#7121)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2025-02-07 12:49:46 +05:30
committed by GitHub
parent 9772cb36ee
commit 50784ad1c1
8 changed files with 28 additions and 17 deletions

View File

@ -6471,14 +6471,14 @@
"type": "object", "type": "object",
"required": [ "required": [
"three_ds", "three_ds",
"non_three_ds", "no_three_ds",
"supported_card_networks" "supported_card_networks"
], ],
"properties": { "properties": {
"three_ds": { "three_ds": {
"$ref": "#/components/schemas/FeatureStatus" "$ref": "#/components/schemas/FeatureStatus"
}, },
"non_three_ds": { "no_three_ds": {
"$ref": "#/components/schemas/FeatureStatus" "$ref": "#/components/schemas/FeatureStatus"
}, },
"supported_card_networks": { "supported_card_networks": {
@ -6776,6 +6776,10 @@
"name": { "name": {
"type": "string" "type": "string"
}, },
"display_name": {
"type": "string",
"nullable": true
},
"description": { "description": {
"type": "string", "type": "string",
"nullable": true "nullable": true

View File

@ -9228,14 +9228,14 @@
"type": "object", "type": "object",
"required": [ "required": [
"three_ds", "three_ds",
"non_three_ds", "no_three_ds",
"supported_card_networks" "supported_card_networks"
], ],
"properties": { "properties": {
"three_ds": { "three_ds": {
"$ref": "#/components/schemas/FeatureStatus" "$ref": "#/components/schemas/FeatureStatus"
}, },
"non_three_ds": { "no_three_ds": {
"$ref": "#/components/schemas/FeatureStatus" "$ref": "#/components/schemas/FeatureStatus"
}, },
"supported_card_networks": { "supported_card_networks": {
@ -9526,6 +9526,10 @@
"name": { "name": {
"type": "string" "type": "string"
}, },
"display_name": {
"type": "string",
"nullable": true
},
"description": { "description": {
"type": "string", "type": "string",
"nullable": true "nullable": true

View File

@ -19,7 +19,7 @@ pub struct CardSpecificFeatures {
/// Indicates whether three_ds card payments are supported. /// Indicates whether three_ds card payments are supported.
pub three_ds: FeatureStatus, pub three_ds: FeatureStatus,
/// Indicates whether non three_ds card payments are supported. /// Indicates whether non three_ds card payments are supported.
pub non_three_ds: FeatureStatus, pub no_three_ds: FeatureStatus,
/// List of supported card networks /// List of supported card networks
pub supported_card_networks: Vec<CardNetwork>, pub supported_card_networks: Vec<CardNetwork>,
} }
@ -47,6 +47,7 @@ pub struct SupportedPaymentMethod {
#[derive(Debug, ToSchema, Serialize)] #[derive(Debug, ToSchema, Serialize)]
pub struct ConnectorFeatureMatrixResponse { pub struct ConnectorFeatureMatrixResponse {
pub name: String, pub name: String,
pub display_name: Option<String>,
pub description: Option<String>, pub description: Option<String>,
pub category: Option<PaymentConnectorCategory>, pub category: Option<PaymentConnectorCategory>,
pub supported_payment_methods: Vec<SupportedPaymentMethod>, pub supported_payment_methods: Vec<SupportedPaymentMethod>,

View File

@ -847,7 +847,7 @@ lazy_static! {
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({ api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
api_models::feature_matrix::CardSpecificFeatures { api_models::feature_matrix::CardSpecificFeatures {
three_ds: common_enums::FeatureStatus::Supported, three_ds: common_enums::FeatureStatus::Supported,
non_three_ds: common_enums::FeatureStatus::Supported, no_three_ds: common_enums::FeatureStatus::Supported,
supported_card_networks: supported_card_network.clone(), supported_card_networks: supported_card_network.clone(),
} }
}), }),
@ -858,8 +858,8 @@ lazy_static! {
bambora_supported_payment_methods bambora_supported_payment_methods
}; };
static ref BAMBORA_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo { static ref BAMBORA_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
description: "Bambora is a leading online payment provider in Canada and United States." display_name: "Bambora",
.to_string(), description: "Bambora is a leading online payment provider in Canada and United States.",
connector_type: enums::PaymentConnectorCategory::PaymentGateway, connector_type: enums::PaymentConnectorCategory::PaymentGateway,
}; };
static ref BAMBORA_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new(); static ref BAMBORA_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();

View File

@ -1031,7 +1031,7 @@ lazy_static! {
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({ api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
api_models::feature_matrix::CardSpecificFeatures { api_models::feature_matrix::CardSpecificFeatures {
three_ds: common_enums::FeatureStatus::Supported, three_ds: common_enums::FeatureStatus::Supported,
non_three_ds: common_enums::FeatureStatus::NotSupported, no_three_ds: common_enums::FeatureStatus::NotSupported,
supported_card_networks: supported_card_network.clone(), supported_card_networks: supported_card_network.clone(),
} }
}), }),
@ -1050,7 +1050,7 @@ lazy_static! {
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({ api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
api_models::feature_matrix::CardSpecificFeatures { api_models::feature_matrix::CardSpecificFeatures {
three_ds: common_enums::FeatureStatus::Supported, three_ds: common_enums::FeatureStatus::Supported,
non_three_ds: common_enums::FeatureStatus::NotSupported, no_three_ds: common_enums::FeatureStatus::NotSupported,
supported_card_networks: supported_card_network.clone(), supported_card_networks: supported_card_network.clone(),
} }
}), }),
@ -1062,9 +1062,9 @@ lazy_static! {
}; };
static ref DEUTSCHEBANK_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo { static ref DEUTSCHEBANK_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
display_name: "Deutsche Bank",
description: description:
"Deutsche Bank is a German multinational investment bank and financial services company " "Deutsche Bank is a German multinational investment bank and financial services company ",
.to_string(),
connector_type: enums::PaymentConnectorCategory::BankAcquirer, connector_type: enums::PaymentConnectorCategory::BankAcquirer,
}; };

View File

@ -466,9 +466,9 @@ lazy_static! {
}; };
static ref ZSL_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo { static ref ZSL_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
display_name: "ZSL",
description: description:
"Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers" "Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers",
.to_string(),
connector_type: enums::PaymentConnectorCategory::PaymentGateway, connector_type: enums::PaymentConnectorCategory::PaymentGateway,
}; };

View File

@ -569,9 +569,10 @@ pub type SupportedPaymentMethods = HashMap<common_enums::PaymentMethod, PaymentM
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ConnectorInfo { pub struct ConnectorInfo {
/// Display name of the Connector
pub display_name: &'static str,
/// Description of the connector. /// Description of the connector.
pub description: String, pub description: &'static str,
/// Connector Type /// Connector Type
pub connector_type: common_enums::PaymentConnectorCategory, pub connector_type: common_enums::PaymentConnectorCategory,
} }

View File

@ -99,7 +99,8 @@ fn build_connector_feature_details(
.map(|webhook_flows| webhook_flows.to_vec()); .map(|webhook_flows| webhook_flows.to_vec());
feature_matrix::ConnectorFeatureMatrixResponse { feature_matrix::ConnectorFeatureMatrixResponse {
name: connector_name.to_uppercase(), name: connector_name.to_uppercase(),
description: connector_about.map(|about| about.description.clone()), display_name: connector_about.map(|about| about.display_name.to_string()),
description: connector_about.map(|about| about.description.to_string()),
category: connector_about.map(|about| about.connector_type), category: connector_about.map(|about| about.connector_type),
supported_webhook_flows, supported_webhook_flows,
supported_payment_methods, supported_payment_methods,