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
fix: Disable UCS PSync call for Cashtocode (#9093)
Saptak Dutta7c6e5f6ed050
diff --git a/config/config.example.toml b/config/config.example.tomlindex a3b7432cb8..3490ee80ea 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -1204,6 +1204,7 @@ url = "http://localhost:8080" # Open Router URLbase_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Secondsucs_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 urlbase_url = "http://127.0.0.1:8080" #Base URLdiff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.tomlindex 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 connecbase_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Secondsucs_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 daysdiff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.tomlindex 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 calldiff --git a/config/deployments/production.toml b/config/deployments/production.tomlindex 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 calldiff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.tomlindex 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 calldiff --git a/config/development.toml b/config/development.tomlindex fe311ef2c0..01506adb60 100644--- a/config/development.toml+++ b/config/development.toml@@ -1326,6 +1326,7 @@ enabled = "true"base_url = "http://localhost:8000"connection_timeout = 10ucs_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 = 60diff --git a/crates/external_services/src/grpc_client/unified_connector_service.rs b/crates/external_services/src/grpc_client/unified_connector_service.rsindex 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<Connector>,++ /// Set of connectors for which psync is disabled in unified connector service+ #[serde(default, deserialize_with = "deserialize_hashset")]+ pub ucs_psync_disabled_connectors: HashSet<Connector>,}/// 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.rsindex 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<api::PSync, types::PaymentsSyncData>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