From 50784ad1c13f0aa66a1da566ddd25e2621021538 Mon Sep 17 00:00:00 2001 From: AkshayaFoiger <131388445+AkshayaFoiger@users.noreply.github.com> Date: Fri, 7 Feb 2025 12:49:46 +0530 Subject: [PATCH] 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> --- api-reference-v2/openapi_spec.json | 8 ++++++-- api-reference/openapi_spec.json | 8 ++++++-- crates/api_models/src/feature_matrix.rs | 3 ++- crates/hyperswitch_connectors/src/connectors/bambora.rs | 6 +++--- .../hyperswitch_connectors/src/connectors/deutschebank.rs | 8 ++++---- crates/hyperswitch_connectors/src/connectors/zsl.rs | 4 ++-- .../src/router_response_types.rs | 5 +++-- crates/router/src/routes/feature_matrix.rs | 3 ++- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index ebfbfc3bf0..329bab6f3d 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -6471,14 +6471,14 @@ "type": "object", "required": [ "three_ds", - "non_three_ds", + "no_three_ds", "supported_card_networks" ], "properties": { "three_ds": { "$ref": "#/components/schemas/FeatureStatus" }, - "non_three_ds": { + "no_three_ds": { "$ref": "#/components/schemas/FeatureStatus" }, "supported_card_networks": { @@ -6776,6 +6776,10 @@ "name": { "type": "string" }, + "display_name": { + "type": "string", + "nullable": true + }, "description": { "type": "string", "nullable": true diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index 7132fe905c..d1bfc5dfdb 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -9228,14 +9228,14 @@ "type": "object", "required": [ "three_ds", - "non_three_ds", + "no_three_ds", "supported_card_networks" ], "properties": { "three_ds": { "$ref": "#/components/schemas/FeatureStatus" }, - "non_three_ds": { + "no_three_ds": { "$ref": "#/components/schemas/FeatureStatus" }, "supported_card_networks": { @@ -9526,6 +9526,10 @@ "name": { "type": "string" }, + "display_name": { + "type": "string", + "nullable": true + }, "description": { "type": "string", "nullable": true diff --git a/crates/api_models/src/feature_matrix.rs b/crates/api_models/src/feature_matrix.rs index c1eb699705..caa5aed111 100644 --- a/crates/api_models/src/feature_matrix.rs +++ b/crates/api_models/src/feature_matrix.rs @@ -19,7 +19,7 @@ pub struct CardSpecificFeatures { /// Indicates whether three_ds card payments are supported. pub three_ds: FeatureStatus, /// Indicates whether non three_ds card payments are supported. - pub non_three_ds: FeatureStatus, + pub no_three_ds: FeatureStatus, /// List of supported card networks pub supported_card_networks: Vec, } @@ -47,6 +47,7 @@ pub struct SupportedPaymentMethod { #[derive(Debug, ToSchema, Serialize)] pub struct ConnectorFeatureMatrixResponse { pub name: String, + pub display_name: Option, pub description: Option, pub category: Option, pub supported_payment_methods: Vec, diff --git a/crates/hyperswitch_connectors/src/connectors/bambora.rs b/crates/hyperswitch_connectors/src/connectors/bambora.rs index d972e004f2..c4a9edea65 100644 --- a/crates/hyperswitch_connectors/src/connectors/bambora.rs +++ b/crates/hyperswitch_connectors/src/connectors/bambora.rs @@ -847,7 +847,7 @@ lazy_static! { api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({ api_models::feature_matrix::CardSpecificFeatures { 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(), } }), @@ -858,8 +858,8 @@ lazy_static! { bambora_supported_payment_methods }; static ref BAMBORA_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo { - description: "Bambora is a leading online payment provider in Canada and United States." - .to_string(), + display_name: "Bambora", + description: "Bambora is a leading online payment provider in Canada and United States.", connector_type: enums::PaymentConnectorCategory::PaymentGateway, }; static ref BAMBORA_SUPPORTED_WEBHOOK_FLOWS: Vec = Vec::new(); diff --git a/crates/hyperswitch_connectors/src/connectors/deutschebank.rs b/crates/hyperswitch_connectors/src/connectors/deutschebank.rs index 0b6b2f132e..0b92cb2538 100644 --- a/crates/hyperswitch_connectors/src/connectors/deutschebank.rs +++ b/crates/hyperswitch_connectors/src/connectors/deutschebank.rs @@ -1031,7 +1031,7 @@ lazy_static! { api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({ api_models::feature_matrix::CardSpecificFeatures { 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(), } }), @@ -1050,7 +1050,7 @@ lazy_static! { api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({ api_models::feature_matrix::CardSpecificFeatures { 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(), } }), @@ -1062,9 +1062,9 @@ lazy_static! { }; static ref DEUTSCHEBANK_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo { + display_name: "Deutsche Bank", description: - "Deutsche Bank is a German multinational investment bank and financial services company " - .to_string(), + "Deutsche Bank is a German multinational investment bank and financial services company ", connector_type: enums::PaymentConnectorCategory::BankAcquirer, }; diff --git a/crates/hyperswitch_connectors/src/connectors/zsl.rs b/crates/hyperswitch_connectors/src/connectors/zsl.rs index cf01c31b74..d7c0152b7a 100644 --- a/crates/hyperswitch_connectors/src/connectors/zsl.rs +++ b/crates/hyperswitch_connectors/src/connectors/zsl.rs @@ -466,9 +466,9 @@ lazy_static! { }; static ref ZSL_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo { + display_name: "ZSL", description: - "Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers" - .to_string(), + "Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers", connector_type: enums::PaymentConnectorCategory::PaymentGateway, }; diff --git a/crates/hyperswitch_domain_models/src/router_response_types.rs b/crates/hyperswitch_domain_models/src/router_response_types.rs index 4d15d715ff..5578647025 100644 --- a/crates/hyperswitch_domain_models/src/router_response_types.rs +++ b/crates/hyperswitch_domain_models/src/router_response_types.rs @@ -569,9 +569,10 @@ pub type SupportedPaymentMethods = HashMap