refactor(dynamic_routing): add logic for creating merchant account in decision engine (#8191)

Co-authored-by: Shankar Singh C <shankar.singh@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Chethan Rao
2025-06-04 13:42:24 +05:30
committed by GitHub
parent ec908d38ac
commit 835a425ded
4 changed files with 118 additions and 32 deletions

View File

@ -578,6 +578,7 @@ pub async fn link_routing_config(
business_profile.get_id(),
routing_algorithm.algorithm_data.clone(),
routing_types::DynamicRoutingType::SuccessRateBasedRouting,
&mut dynamic_routing_ref,
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
@ -608,6 +609,7 @@ pub async fn link_routing_config(
business_profile.get_id(),
routing_algorithm.algorithm_data.clone(),
routing_types::DynamicRoutingType::EliminationRouting,
&mut dynamic_routing_ref,
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
@ -1929,6 +1931,9 @@ pub async fn contract_based_dynamic_routing_setup(
elimination_routing_algorithm: None,
dynamic_routing_volume_split: None,
contract_based_routing: Some(contract_algo),
is_merchant_created_in_decision_engine: dynamic_routing_algo_ref
.as_ref()
.is_some_and(|algo| algo.is_merchant_created_in_decision_engine),
}
};