diff --git a/config/config.example.toml b/config/config.example.toml index a3b7432cb8..3490ee80ea 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -1204,6 +1204,7 @@ url = "http://localhost:8080" # Open Router URL base_url = "http://localhost:8000" # Unified Connector Service Base URL connection_timeout = 10 # Connection Timeout Duration in Seconds ucs_only_connectors = "paytm, phonepe" # Comma-separated list of connectors that use UCS only +ucs_psync_disabled_connectors = "cashtocode" # Comma-separated list of connectors to disable UCS PSync call [grpc_client.recovery_decider_client] # Revenue recovery client base url base_url = "http://127.0.0.1:8080" #Base URL diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml index 77fef22792..bfba035c1f 100644 --- a/config/deployments/env_specific.toml +++ b/config/deployments/env_specific.toml @@ -385,6 +385,7 @@ connector_names = "connector_names" # Comma-separated list of allowed connec base_url = "http://localhost:8000" # Unified Connector Service Base URL connection_timeout = 10 # Connection Timeout Duration in Seconds ucs_only_connectors = "paytm, phonepe" # Comma-separated list of connectors that use UCS only +ucs_psync_disabled_connectors = "cashtocode" # Comma-separated list of connectors to disable UCS PSync call [revenue_recovery] # monitoring threshold - 120 days diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index c3b43b9e29..0867ca7014 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -893,3 +893,4 @@ connector_list = "worldpayvantiv" [grpc_client.unified_connector_service] ucs_only_connectors = "paytm, phonepe" # Comma-separated list of connectors that use UCS only +ucs_psync_disabled_connectors = "cashtocode" # Comma-separated list of connectors to disable UCS PSync call diff --git a/config/deployments/production.toml b/config/deployments/production.toml index e476068348..20040502e1 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -902,4 +902,5 @@ click_to_pay = {connector_list = "adyen, cybersource, trustpay"} [grpc_client.unified_connector_service] ucs_only_connectors = "paytm, phonepe" # Comma-separated list of connectors that use UCS only +ucs_psync_disabled_connectors = "cashtocode" # Comma-separated list of connectors to disable UCS PSync call diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index ebcfa28016..23a362581e 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -912,3 +912,4 @@ connector_list = "worldpayvantiv" [grpc_client.unified_connector_service] ucs_only_connectors = "paytm, phonepe" # Comma-separated list of connectors that use UCS only +ucs_psync_disabled_connectors = "cashtocode" # Comma-separated list of connectors to disable UCS PSync call diff --git a/config/development.toml b/config/development.toml index fe311ef2c0..01506adb60 100644 --- a/config/development.toml +++ b/config/development.toml @@ -1326,6 +1326,7 @@ enabled = "true" base_url = "http://localhost:8000" connection_timeout = 10 ucs_only_connectors = "paytm, phonepe" # Comma-separated list of connectors that use UCS only +ucs_psync_disabled_connectors = "cashtocode" # Comma-separated list of connectors to disable UCS PSync call [revenue_recovery] monitoring_threshold_in_seconds = 60 diff --git a/crates/external_services/src/grpc_client/unified_connector_service.rs b/crates/external_services/src/grpc_client/unified_connector_service.rs index c8c29d1e42..719e741137 100644 --- a/crates/external_services/src/grpc_client/unified_connector_service.rs +++ b/crates/external_services/src/grpc_client/unified_connector_service.rs @@ -128,6 +128,10 @@ pub struct UnifiedConnectorServiceClientConfig { /// Set of external services/connectors available for the unified connector service #[serde(default, deserialize_with = "deserialize_hashset")] pub ucs_only_connectors: HashSet, + + /// Set of connectors for which psync is disabled in unified connector service + #[serde(default, deserialize_with = "deserialize_hashset")] + pub ucs_psync_disabled_connectors: HashSet, } /// Contains the Connector Auth Type and related authentication data. diff --git a/crates/router/src/core/payments/flows/psync_flow.rs b/crates/router/src/core/payments/flows/psync_flow.rs index 802bd3d5bc..198a9bcb47 100644 --- a/crates/router/src/core/payments/flows/psync_flow.rs +++ b/crates/router/src/core/payments/flows/psync_flow.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use std::{collections::HashMap, str::FromStr}; use async_trait::async_trait; use error_stack::ResultExt; @@ -226,6 +226,29 @@ impl Feature merchant_connector_account: domain::MerchantConnectorAccountTypeDetails, merchant_context: &domain::MerchantContext, ) -> RouterResult<()> { + let connector_name = self.connector.clone(); + let connector_enum = common_enums::connector_enums::Connector::from_str(&connector_name) + .change_context(ApiErrorResponse::IncorrectConnectorNameGiven)?; + + let is_ucs_psync_disabled = state + .conf + .grpc_client + .unified_connector_service + .as_ref() + .is_some_and(|config| { + config + .ucs_psync_disabled_connectors + .contains(&connector_enum) + }); + + if is_ucs_psync_disabled { + logger::info!( + "UCS PSync call disabled for connector: {}, skipping UCS call", + connector_name + ); + return Ok(()); + } + let client = state .grpc_client .unified_connector_service_client