feat(router): Add support for Vault in connector_accounts endpoint (#7814)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Anurag Thakur
2025-05-15 15:36:44 +05:30
committed by GitHub
parent 32df40124a
commit 89b421f81c
26 changed files with 1376 additions and 7 deletions

View File

@ -34,9 +34,9 @@ pub use hyperswitch_connectors::connectors::{
square::Square, stax, stax::Stax, stripebilling, stripebilling::Stripebilling, taxjar,
taxjar::Taxjar, threedsecureio, threedsecureio::Threedsecureio, thunes, thunes::Thunes,
trustpay, trustpay::Trustpay, tsys, tsys::Tsys, unified_authentication_service,
unified_authentication_service::UnifiedAuthenticationService, volt, volt::Volt, wellsfargo,
wellsfargo::Wellsfargo, wellsfargopayout, wellsfargopayout::Wellsfargopayout, wise, wise::Wise,
worldline, worldline::Worldline, worldpay, worldpay::Worldpay, worldpayxml,
unified_authentication_service::UnifiedAuthenticationService, vgs, vgs::Vgs, volt, volt::Volt,
wellsfargo, wellsfargo::Wellsfargo, wellsfargopayout, wellsfargopayout::Wellsfargopayout, wise,
wise::Wise, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, worldpayxml,
worldpayxml::Worldpayxml, xendit, xendit::Xendit, zen, zen::Zen, zsl, zsl::Zsl,
};

View File

@ -1291,6 +1291,10 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {
use crate::connector::*;
match self.connector_name {
api_enums::Connector::Vgs => {
vgs::transformers::VgsAuthType::try_from(self.auth_type)?;
Ok(())
}
api_enums::Connector::Adyenplatform => {
adyenplatform::transformers::AdyenplatformAuthType::try_from(self.auth_type)?;
Ok(())
@ -1925,6 +1929,8 @@ impl ConnectorTypeAndConnectorName<'_> {
let mut routable_connector =
api_enums::RoutableConnectors::from_str(&self.connector_name.to_string()).ok();
let vault_connector =
api_enums::convert_vault_connector(self.connector_name.to_string().as_str());
let pm_auth_connector =
api_enums::convert_pm_auth_connector(self.connector_name.to_string().as_str());
let authentication_connector =
@ -1964,6 +1970,13 @@ impl ConnectorTypeAndConnectorName<'_> {
}
.into());
}
} else if vault_connector.is_some() {
if self.connector_type != &api_enums::ConnectorType::VaultProcessor {
return Err(errors::ApiErrorResponse::InvalidRequestData {
message: "Invalid connector type given".to_string(),
}
.into());
}
} else {
let routable_connector_option = self
.connector_name

View File

@ -556,6 +556,7 @@ impl ConnectorData {
// enums::Connector::UnifiedAuthenticationService => Ok(ConnectorEnum::Old(Box::new(
// connector::UnifiedAuthenticationService,
// ))),
enums::Connector::Vgs => Ok(ConnectorEnum::Old(Box::new(connector::Vgs::new()))),
enums::Connector::Volt => Ok(ConnectorEnum::Old(Box::new(connector::Volt::new()))),
enums::Connector::Wellsfargo => {
Ok(ConnectorEnum::Old(Box::new(connector::Wellsfargo::new())))

View File

@ -325,6 +325,7 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
// api_enums::Connector::UnifiedAuthenticationService => {
// Self::UnifiedAuthenticationService
// }
// api_enums::Connector::Vgs => Self::Vgs,
api_enums::Connector::Volt => Self::Volt,
api_enums::Connector::Wellsfargo => Self::Wellsfargo,
// api_enums::Connector::Wellsfargopayout => Self::Wellsfargopayout,
@ -365,6 +366,11 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
message: "Taxjar is not a routable connector".to_string(),
})?
}
api_enums::Connector::Vgs => {
Err(common_utils::errors::ValidationError::InvalidValue {
message: "Vgs is not a routable connector".to_string(),
})?
}
})
}
}