feat(payouts): extend routing capabilities to payout operation (#3531)

Co-authored-by: Kashif <mohammed.kashif@juspay.in>
This commit is contained in:
Kashif
2024-02-26 13:00:10 +05:30
committed by GitHub
parent c79226b9b2
commit 75c633fc7c
39 changed files with 1341 additions and 556 deletions

View File

@ -947,11 +947,22 @@ pub async fn create_payment_connector(
status: connector_status,
};
let mut default_routing_config =
routing_helpers::get_merchant_default_config(&*state.store, merchant_id).await?;
let transaction_type = match req.connector_type {
#[cfg(feature = "payouts")]
api_enums::ConnectorType::PayoutProcessor => api_enums::TransactionType::Payout,
_ => api_enums::TransactionType::Payment,
};
let mut default_routing_config_for_profile =
routing_helpers::get_merchant_default_config(&*state.clone().store, &profile_id).await?;
let mut default_routing_config =
routing_helpers::get_merchant_default_config(&*state.store, merchant_id, &transaction_type)
.await?;
let mut default_routing_config_for_profile = routing_helpers::get_merchant_default_config(
&*state.clone().store,
&profile_id,
&transaction_type,
)
.await?;
let mca = state
.store
@ -981,6 +992,7 @@ pub async fn create_payment_connector(
&*state.store,
merchant_id,
default_routing_config.clone(),
&transaction_type,
)
.await?;
}
@ -990,6 +1002,7 @@ pub async fn create_payment_connector(
&*state.store,
&profile_id.clone(),
default_routing_config_for_profile.clone(),
&transaction_type,
)
.await?;
}