mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 05:17:02 +08:00
feat(router): payment_method block (#3056)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: shashank_attarde <shashank.attarde@juspay.in>
This commit is contained in:
@ -10,6 +10,7 @@ use common_utils::{
|
||||
ext_traits::{AsyncExt, ConfigExt, Encode, ValueExt},
|
||||
pii,
|
||||
};
|
||||
use diesel_models::configs;
|
||||
use error_stack::{report, FutureExt, IntoReport, ResultExt};
|
||||
use futures::future::try_join_all;
|
||||
use masking::{PeekInterface, Secret};
|
||||
@ -141,6 +142,17 @@ pub async fn create_merchant_account(
|
||||
.transpose()?
|
||||
.map(Secret::new);
|
||||
|
||||
let fingerprint = Some(utils::generate_id(consts::FINGERPRINT_SECRET_LENGTH, "fs"));
|
||||
if let Some(fingerprint) = fingerprint {
|
||||
db.insert_config(configs::ConfigNew {
|
||||
key: format!("fingerprint_secret_{}", req.merchant_id),
|
||||
config: fingerprint,
|
||||
})
|
||||
.await
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("Mot able to generate Merchant fingerprint")?;
|
||||
};
|
||||
|
||||
let organization_id = if let Some(organization_id) = req.organization_id.as_ref() {
|
||||
db.find_organization_by_org_id(organization_id)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user