mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
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:
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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())))
|
||||
|
||||
@ -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(),
|
||||
})?
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user