refactor(merchant_account_v2): recreate id and remove deprecated fields from merchant account (#5493)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Narayan Bhat
2024-08-06 15:05:40 +05:30
committed by GitHub
parent 61a0cb3e1e
commit 49892b261e
26 changed files with 988 additions and 671 deletions

View File

@ -1,4 +1,4 @@
use common_utils::ext_traits::ValueExt;
use common_utils::ext_traits::{OptionExt, ValueExt};
use error_stack::ResultExt;
use router_env::tracing::{self, instrument};
@ -26,17 +26,13 @@ pub async fn construct_fulfillment_router_data<'a>(
connector: String,
fulfillment_request: FrmFulfillmentRequest,
) -> RouterResult<FrmFulfillmentRouterData> {
let profile_id = core_utils::get_profile_id_from_business_details(
payment_intent.business_country,
payment_intent.business_label.as_ref(),
merchant_account,
payment_intent.profile_id.as_ref(),
&*state.store,
false,
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("profile_id is not set in payment_intent")?;
let profile_id = payment_intent
.profile_id
.as_ref()
.get_required_value("profile_id")
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("profile_id is not set in payment_intent")?
.clone();
let merchant_connector_account = helpers::get_merchant_connector_account(
state,