mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
feat(users): add some checks for prod-intent send to biz email (#3631)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8853a60bf4
commit
774a0322aa
@ -279,9 +279,15 @@ pub fn parse_string_to_enums(query: String) -> UserResult<GetMultipleMetaDataPay
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_prod_email_required(data: &ProdIntent) -> bool {
|
||||
!(data
|
||||
.poc_email
|
||||
fn not_contains_string(value: &Option<String>, value_to_be_checked: &str) -> bool {
|
||||
value
|
||||
.as_ref()
|
||||
.map_or(true, |mail| mail.contains("juspay")))
|
||||
.map_or(false, |mail| !mail.contains(value_to_be_checked))
|
||||
}
|
||||
|
||||
pub fn is_prod_email_required(data: &ProdIntent, user_email: String) -> bool {
|
||||
not_contains_string(&data.poc_email, "juspay")
|
||||
&& not_contains_string(&data.business_website, "juspay")
|
||||
&& not_contains_string(&data.business_website, "hyperswitch")
|
||||
&& not_contains_string(&Some(user_email), "juspay")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user