Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(external_services): Fixed Url for Unified Connector Service gRPC Client (#8587)
Debarshi Gupta988c1707263b
diff --git a/config/config.example.toml b/config/config.example.tomlindex 55ab867560..6323583b1c 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -1145,8 +1145,7 @@ static_routing_enabled = true # Enable or disable Open Router for staturl = "http://localhost:8080" # Open Router URL[grpc_client.unified_connector_service]-host = "localhost" # Unified Connector Service Client Host-port = 8000 # Unified Connector Service Client Port+base_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Seconds[billing_connectors_invoice_sync]diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.tomlindex 23ff9f16e7..49ef2a0b80 100644--- a/config/deployments/env_specific.toml+++ b/config/deployments/env_specific.toml@@ -379,8 +379,7 @@ merchant_ids = "merchant_ids" # Comma-separated list of allowed merchaconnector_names = "connector_names" # Comma-separated list of allowed connector names[grpc_client.unified_connector_service]-host = "localhost" # Unified Connector Service Client Host-port = 8000 # Unified Connector Service Client Port+base_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Seconds[chat]diff --git a/config/development.toml b/config/development.tomlindex a7f6a518b3..ca848b50c7 100644--- a/config/development.toml+++ b/config/development.toml@@ -1245,8 +1245,7 @@ static_routing_enabled = falseurl = "http://localhost:8080"[grpc_client.unified_connector_service]-host = "localhost"-port = 8000+base_url = "http://localhost:8000"connection_timeout = 10ucs_only_connectors = ["razorpay",diff --git a/crates/external_services/src/grpc_client/unified_connector_service.rs b/crates/external_services/src/grpc_client/unified_connector_service.rsindex 7ca74cdda3..8db71c930f 100644--- a/crates/external_services/src/grpc_client/unified_connector_service.rs+++ b/crates/external_services/src/grpc_client/unified_connector_service.rs@@ -1,4 +1,4 @@-use common_utils::{consts as common_utils_consts, errors::CustomResult};+use common_utils::{consts as common_utils_consts, errors::CustomResult, types::Url};use error_stack::ResultExt;use masking::{PeekInterface, Secret};use router_env::logger;@@ -110,11 +110,8 @@ pub struct UnifiedConnectorServiceClient {/// Contains the Unified Connector Service Client config#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]pub struct UnifiedConnectorServiceClientConfig {- /// Host for the gRPC Client- pub host: String,-- /// Port of the gRPC Client- pub port: u16,+ /// Base URL of the gRPC Server+ pub base_url: Url,/// Contains the connection timeout duration in secondspub connection_timeout: u64,@@ -151,13 +148,11 @@ impl UnifiedConnectorServiceClient {pub async fn build_connections(config: &GrpcClientSettings) -> Option<Self> {match &config.unified_connector_service {Some(unified_connector_service_client_config) => {- let uri_str = format!(- "https://{}:{}",- unified_connector_service_client_config.host,- unified_connector_service_client_config.port- );-- let uri: Uri = match uri_str.parse() {+ let uri: Uri = match unified_connector_service_client_config+ .base_url+ .get_string_repr()+ .parse()+ {Ok(parsed_uri) => parsed_uri,Err(err) => {logger::error!(error = ?err, "Failed to parse URI for Unified Connector Service");