Skip to content

Commit 50784ad

Browse files
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>
1 parent 9772cb3 commit 50784ad

File tree

8 files changed

+28
-17
lines changed

8 files changed

+28
-17
lines changed

api-reference-v2/openapi_spec.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6471,14 +6471,14 @@
64716471
"type": "object",
64726472
"required": [
64736473
"three_ds",
6474-
"non_three_ds",
6474+
"no_three_ds",
64756475
"supported_card_networks"
64766476
],
64776477
"properties": {
64786478
"three_ds": {
64796479
"$ref": "#/components/schemas/FeatureStatus"
64806480
},
6481-
"non_three_ds": {
6481+
"no_three_ds": {
64826482
"$ref": "#/components/schemas/FeatureStatus"
64836483
},
64846484
"supported_card_networks": {
@@ -6776,6 +6776,10 @@
67766776
"name": {
67776777
"type": "string"
67786778
},
6779+
"display_name": {
6780+
"type": "string",
6781+
"nullable": true
6782+
},
67796783
"description": {
67806784
"type": "string",
67816785
"nullable": true

api-reference/openapi_spec.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9228,14 +9228,14 @@
92289228
"type": "object",
92299229
"required": [
92309230
"three_ds",
9231-
"non_three_ds",
9231+
"no_three_ds",
92329232
"supported_card_networks"
92339233
],
92349234
"properties": {
92359235
"three_ds": {
92369236
"$ref": "#/components/schemas/FeatureStatus"
92379237
},
9238-
"non_three_ds": {
9238+
"no_three_ds": {
92399239
"$ref": "#/components/schemas/FeatureStatus"
92409240
},
92419241
"supported_card_networks": {
@@ -9526,6 +9526,10 @@
95269526
"name": {
95279527
"type": "string"
95289528
},
9529+
"display_name": {
9530+
"type": "string",
9531+
"nullable": true
9532+
},
95299533
"description": {
95309534
"type": "string",
95319535
"nullable": true

crates/api_models/src/feature_matrix.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct CardSpecificFeatures {
1919
/// Indicates whether three_ds card payments are supported.
2020
pub three_ds: FeatureStatus,
2121
/// Indicates whether non three_ds card payments are supported.
22-
pub non_three_ds: FeatureStatus,
22+
pub no_three_ds: FeatureStatus,
2323
/// List of supported card networks
2424
pub supported_card_networks: Vec<CardNetwork>,
2525
}
@@ -47,6 +47,7 @@ pub struct SupportedPaymentMethod {
4747
#[derive(Debug, ToSchema, Serialize)]
4848
pub struct ConnectorFeatureMatrixResponse {
4949
pub name: String,
50+
pub display_name: Option<String>,
5051
pub description: Option<String>,
5152
pub category: Option<PaymentConnectorCategory>,
5253
pub supported_payment_methods: Vec<SupportedPaymentMethod>,

crates/hyperswitch_connectors/src/connectors/bambora.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ lazy_static! {
847847
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
848848
api_models::feature_matrix::CardSpecificFeatures {
849849
three_ds: common_enums::FeatureStatus::Supported,
850-
non_three_ds: common_enums::FeatureStatus::Supported,
850+
no_three_ds: common_enums::FeatureStatus::Supported,
851851
supported_card_networks: supported_card_network.clone(),
852852
}
853853
}),
@@ -858,8 +858,8 @@ lazy_static! {
858858
bambora_supported_payment_methods
859859
};
860860
static ref BAMBORA_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
861-
description: "Bambora is a leading online payment provider in Canada and United States."
862-
.to_string(),
861+
display_name: "Bambora",
862+
description: "Bambora is a leading online payment provider in Canada and United States.",
863863
connector_type: enums::PaymentConnectorCategory::PaymentGateway,
864864
};
865865
static ref BAMBORA_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();

crates/hyperswitch_connectors/src/connectors/deutschebank.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ lazy_static! {
10311031
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
10321032
api_models::feature_matrix::CardSpecificFeatures {
10331033
three_ds: common_enums::FeatureStatus::Supported,
1034-
non_three_ds: common_enums::FeatureStatus::NotSupported,
1034+
no_three_ds: common_enums::FeatureStatus::NotSupported,
10351035
supported_card_networks: supported_card_network.clone(),
10361036
}
10371037
}),
@@ -1050,7 +1050,7 @@ lazy_static! {
10501050
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
10511051
api_models::feature_matrix::CardSpecificFeatures {
10521052
three_ds: common_enums::FeatureStatus::Supported,
1053-
non_three_ds: common_enums::FeatureStatus::NotSupported,
1053+
no_three_ds: common_enums::FeatureStatus::NotSupported,
10541054
supported_card_networks: supported_card_network.clone(),
10551055
}
10561056
}),
@@ -1062,9 +1062,9 @@ lazy_static! {
10621062
};
10631063

10641064
static ref DEUTSCHEBANK_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
1065+
display_name: "Deutsche Bank",
10651066
description:
1066-
"Deutsche Bank is a German multinational investment bank and financial services company "
1067-
.to_string(),
1067+
"Deutsche Bank is a German multinational investment bank and financial services company ",
10681068
connector_type: enums::PaymentConnectorCategory::BankAcquirer,
10691069
};
10701070

crates/hyperswitch_connectors/src/connectors/zsl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ lazy_static! {
466466
};
467467

468468
static ref ZSL_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
469+
display_name: "ZSL",
469470
description:
470-
"Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers"
471-
.to_string(),
471+
"Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers",
472472
connector_type: enums::PaymentConnectorCategory::PaymentGateway,
473473
};
474474

crates/hyperswitch_domain_models/src/router_response_types.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,10 @@ pub type SupportedPaymentMethods = HashMap<common_enums::PaymentMethod, PaymentM
569569

570570
#[derive(Debug, Clone)]
571571
pub struct ConnectorInfo {
572+
/// Display name of the Connector
573+
pub display_name: &'static str,
572574
/// Description of the connector.
573-
pub description: String,
574-
575+
pub description: &'static str,
575576
/// Connector Type
576577
pub connector_type: common_enums::PaymentConnectorCategory,
577578
}

crates/router/src/routes/feature_matrix.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ fn build_connector_feature_details(
9999
.map(|webhook_flows| webhook_flows.to_vec());
100100
feature_matrix::ConnectorFeatureMatrixResponse {
101101
name: connector_name.to_uppercase(),
102-
description: connector_about.map(|about| about.description.clone()),
102+
display_name: connector_about.map(|about| about.display_name.to_string()),
103+
description: connector_about.map(|about| about.description.to_string()),
103104
category: connector_about.map(|about| about.connector_type),
104105
supported_webhook_flows,
105106
supported_payment_methods,

0 commit comments

Comments
 (0)