Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(core): fix merchant connector account create for v2 (#5716)

Amisha Prabhat9e285720efba
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<Vec<routing_types::RoutableConnectorChoice>> {
- use masking::ExposeOptionInterface;
- self.profile
- .default_fallback_routing
- .clone()
- .expose_option()
- .parse_value::<Vec<routing_types::RoutableConnectorChoice>>(
- "Vec<RoutableConnectorChoice>",
- )
- .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<routing_types::RoutableConnectorChoice>>(
+ "Vec<RoutableConnectorChoice>",
+ )
+ .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,