feat(payment_link): add multiple custom css support in business level (#5137)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2024-07-01 16:29:06 +05:30
committed by GitHub
parent 1b8946321b
commit ecc6c00d4a
10 changed files with 165 additions and 96 deletions

View File

@ -9,3 +9,27 @@ macro_rules! get_formatted_date_time {
.change_context($crate::core::errors::ConnectorError::InvalidDateFormat)
}};
}
#[macro_export]
macro_rules! get_payment_link_config_value_based_on_priority {
($config:expr, $business_config:expr, $field:ident, $default:expr) => {
$config
.as_ref()
.and_then(|pc_config| pc_config.theme_config.$field.clone())
.or_else(|| {
$business_config
.as_ref()
.and_then(|business_config| business_config.$field.clone())
})
.unwrap_or($default)
};
}
#[macro_export]
macro_rules! get_payment_link_config_value {
($config:expr, $business_config:expr, $(($field:ident, $default:expr)),*) => {
(
$(get_payment_link_config_value_based_on_priority!($config, $business_config, $field, $default)),*
)
};
}