mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
fix: store and retrieve merchant secret from MCA table for webhooks source verification (#1331)
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
This commit is contained in:
@ -52,6 +52,7 @@ impl ConfigInterface for Store {
|
||||
config.insert(&conn).await.map_err(Into::into).into_report()
|
||||
}
|
||||
|
||||
//fetch directly from DB
|
||||
async fn find_config_by_key(
|
||||
&self,
|
||||
key: &str,
|
||||
@ -74,6 +75,8 @@ impl ConfigInterface for Store {
|
||||
.map_err(Into::into)
|
||||
.into_report()
|
||||
}
|
||||
|
||||
//update in DB and remove in redis and cache
|
||||
async fn update_config_cached(
|
||||
&self,
|
||||
key: &str,
|
||||
@ -85,6 +88,7 @@ impl ConfigInterface for Store {
|
||||
.await
|
||||
}
|
||||
|
||||
//check in cache, then redis then finally DB, and on the way back populate redis and cache
|
||||
async fn find_config_by_key_cached(
|
||||
&self,
|
||||
key: &str,
|
||||
|
||||
@ -457,6 +457,7 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
business_sub_label: t.business_sub_label,
|
||||
created_at: common_utils::date_time::now(),
|
||||
modified_at: common_utils::date_time::now(),
|
||||
connector_webhook_details: t.connector_webhook_details,
|
||||
};
|
||||
accounts.push(account.clone());
|
||||
account
|
||||
@ -618,6 +619,7 @@ mod merchant_connector_account_cache_tests {
|
||||
business_sub_label: None,
|
||||
created_at: date_time::now(),
|
||||
modified_at: date_time::now(),
|
||||
connector_webhook_details: None,
|
||||
};
|
||||
|
||||
let key_store = db
|
||||
|
||||
Reference in New Issue
Block a user