diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index aa2cf09cb6..edda62d79f 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -1336,6 +1336,16 @@ impl ValidateRequest for PaymentConfir .clone() .ok_or(report!(errors::ApiErrorResponse::PaymentNotFound))?; + let _request_straight_through: Option = request + .routing + .clone() + .map(|val| val.parse_value("RoutingAlgorithm")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidRequestData { + message: "Invalid straight through routing rules format".to_string(), + }) + .attach_printable("Invalid straight through routing rules format")?; + Ok(( Box::new(self), operations::ValidateResult { diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index 4d4444a280..9a4e878905 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -735,6 +735,16 @@ impl ValidateRequest for PaymentCreate )?; } + let _request_straight_through: Option = request + .routing + .clone() + .map(|val| val.parse_value("RoutingAlgorithm")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidRequestData { + message: "Invalid straight through routing rules format".to_string(), + }) + .attach_printable("Invalid straight through routing rules format")?; + Ok(( Box::new(self), operations::ValidateResult { diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs index 494ab0f2ee..e44dc0c1f2 100644 --- a/crates/router/src/core/payments/operations/payment_update.rs +++ b/crates/router/src/core/payments/operations/payment_update.rs @@ -782,6 +782,16 @@ impl ValidateRequest for PaymentUpdate &request.mandate_id, )?; + let _request_straight_through: Option = request + .routing + .clone() + .map(|val| val.parse_value("RoutingAlgorithm")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidRequestData { + message: "Invalid straight through routing rules format".to_string(), + }) + .attach_printable("Invalid straight through routing rules format")?; + Ok(( Box::new(self), operations::ValidateResult {