From ffe90a41125a0eb1e8a858b336120e355fd3b69e Mon Sep 17 00:00:00 2001 From: AkshayaFoiger <131388445+AkshayaFoiger@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:53:07 +0530 Subject: [PATCH] fix(connector): [BOA/CYBS] make risk information message optional (#5107) --- crates/router/src/connector/bankofamerica/transformers.rs | 8 ++++++-- crates/router/src/connector/cybersource/transformers.rs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/router/src/connector/bankofamerica/transformers.rs b/crates/router/src/connector/bankofamerica/transformers.rs index 5c8aec1686..1230843afa 100644 --- a/crates/router/src/connector/bankofamerica/transformers.rs +++ b/crates/router/src/connector/bankofamerica/transformers.rs @@ -884,7 +884,7 @@ pub struct Profile { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct ClientRiskInformationRules { - name: Secret, + name: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -2961,7 +2961,11 @@ impl client_risk_information.rules.map(|rules| { rules .iter() - .map(|risk_info| format!(" , {}", risk_info.name.clone().expose())) + .map(|risk_info| { + risk_info.name.clone().map_or("".to_string(), |name| { + format!(" , {}", name.clone().expose()) + }) + }) .collect::>() .join("") }) diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index b51bb5f4eb..44e82a036a 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -1839,7 +1839,7 @@ pub struct ClientRiskInformation { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct ClientRiskInformationRules { - name: Secret, + name: Option>, } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -3402,7 +3402,11 @@ impl client_risk_information.rules.map(|rules| { rules .iter() - .map(|risk_info| format!(" , {}", risk_info.name.clone().expose())) + .map(|risk_info| { + risk_info.name.clone().map_or("".to_string(), |name| { + format!(" , {}", name.clone().expose()) + }) + }) .collect::>() .join("") })