mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(routing): Added routing validation for payments req (#4762)
This commit is contained in:
@ -1336,6 +1336,16 @@ impl<F: Send + Clone> ValidateRequest<F, api::PaymentsRequest> for PaymentConfir
|
||||
.clone()
|
||||
.ok_or(report!(errors::ApiErrorResponse::PaymentNotFound))?;
|
||||
|
||||
let _request_straight_through: Option<api::routing::StraightThroughAlgorithm> = 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 {
|
||||
|
||||
@ -735,6 +735,16 @@ impl<F: Send + Clone> ValidateRequest<F, api::PaymentsRequest> for PaymentCreate
|
||||
)?;
|
||||
}
|
||||
|
||||
let _request_straight_through: Option<api::routing::StraightThroughAlgorithm> = 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 {
|
||||
|
||||
@ -782,6 +782,16 @@ impl<F: Send + Clone> ValidateRequest<F, api::PaymentsRequest> for PaymentUpdate
|
||||
&request.mandate_id,
|
||||
)?;
|
||||
|
||||
let _request_straight_through: Option<api::routing::StraightThroughAlgorithm> = 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 {
|
||||
|
||||
Reference in New Issue
Block a user