mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix: Disable UCS PSync call for Cashtocode (#9093)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user