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(router): `validate_psync_reference_id` only if call_connector_action is trigger in psync flow (#2106)
Sai Harsha Vardhan60c5fdb89a77
diff --git a/crates/router/src/core/payments/flows/psync_flow.rs b/crates/router/src/core/payments/flows/psync_flow.rsindex 5da9ff035c..b6920387b1 100644--- a/crates/router/src/core/payments/flows/psync_flow.rs+++ b/crates/router/src/core/payments/flows/psync_flow.rs@@ -9,7 +9,7 @@ use crate::{payments::{self, access_token, helpers, transformers, PaymentData},},routes::AppState,- services,+ services::{self, logger},types::{self, api, domain},};@@ -113,16 +113,19 @@ impl Feature<api::PSync, types::PaymentsSyncData>connector: &api::ConnectorData,call_connector_action: payments::CallConnectorAction,) -> RouterResult<(Option<services::Request>, bool)> {- if connector- .connector- .validate_psync_reference_id(self)- .is_err()- {- return Ok((None, false));- }-let request = match call_connector_action {payments::CallConnectorAction::Trigger => {+ //validate_psync_reference_id if call_connector_action is trigger+ if connector+ .connector+ .validate_psync_reference_id(self)+ .is_err()+ {+ logger::warn!(+ "validate_psync_reference_id failed, hence skipping call to connector"+ );+ return Ok((None, false));+ }let connector_integration: services::BoxedConnectorIntegration<'_,api::PSync,