From 9e285720efba2f05485c62b837f778e74f897ce1 Mon Sep 17 00:00:00 2001 From: Amisha Prabhat <55580080+Aprabhat19@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:01:59 +0530 Subject: [PATCH] fix(core): fix merchant connector account create for v2 (#5716) --- crates/router/src/core/admin.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index ea36f3e24f..084ac8eacc 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -4179,16 +4179,19 @@ impl BusinessProfileWrapper { pub fn get_default_fallback_list_of_connector_under_profile( &self, ) -> RouterResult> { - use masking::ExposeOptionInterface; - self.profile - .default_fallback_routing - .clone() - .expose_option() - .parse_value::>( - "Vec", - ) - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Merchant default config has invalid structure") + let fallback_connectors = + if let Some(default_fallback_routing) = self.profile.default_fallback_routing.clone() { + default_fallback_routing + .expose() + .parse_value::>( + "Vec", + ) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Business Profile default config has invalid structure")? + } else { + Vec::new() + }; + Ok(fallback_connectors) } pub fn get_default_routing_configs_from_profile( &self,