Skip to content

Commit

Permalink
fix(connector): [BOA/CYBS] make risk information message optional (#5107
Browse files Browse the repository at this point in the history
)
  • Loading branch information
AkshayaFoiger authored Jun 26, 2024
1 parent d44deb1 commit ffe90a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions crates/router/src/connector/bankofamerica/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ pub struct Profile {

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ClientRiskInformationRules {
name: Secret<String>,
name: Option<Secret<String>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -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::<Vec<String>>()
.join("")
})
Expand Down
8 changes: 6 additions & 2 deletions crates/router/src/connector/cybersource/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ pub struct ClientRiskInformation {

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ClientRiskInformationRules {
name: Secret<String>,
name: Option<Secret<String>>,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down Expand Up @@ -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::<Vec<String>>()
.join("")
})
Expand Down

0 comments on commit ffe90a4

Please sign in to comment.