mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat: encrypt PII fields before saving it in the database (#1043)
Co-authored-by: Nishant Joshi <nishant.joshi@juspay.in>
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
use common_utils::pii;
|
||||
use common_utils::{
|
||||
crypto::{Encryptable, OptionalEncryptableName},
|
||||
pii,
|
||||
};
|
||||
use masking::Secret;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use url;
|
||||
@ -15,8 +18,8 @@ pub struct MerchantAccountCreate {
|
||||
pub merchant_id: String,
|
||||
|
||||
/// Name of the Merchant Account
|
||||
#[schema(example = "NewAge Retailer")]
|
||||
pub merchant_name: Option<String>,
|
||||
#[schema(value_type= Option<String>,example = "NewAge Retailer")]
|
||||
pub merchant_name: Option<Secret<String>>,
|
||||
|
||||
/// Merchant related details
|
||||
pub merchant_details: Option<MerchantDetails>,
|
||||
@ -157,8 +160,8 @@ pub struct MerchantAccountResponse {
|
||||
pub merchant_id: String,
|
||||
|
||||
/// Name of the Merchant Account
|
||||
#[schema(example = "NewAge Retailer")]
|
||||
pub merchant_name: Option<String>,
|
||||
#[schema(value_type = Option<String>,example = "NewAge Retailer")]
|
||||
pub merchant_name: OptionalEncryptableName,
|
||||
|
||||
/// The URL to redirect after the completion of the operation
|
||||
#[schema(max_length = 255, example = "https://www.example.com/success")]
|
||||
@ -178,7 +181,7 @@ pub struct MerchantAccountResponse {
|
||||
|
||||
/// Merchant related details
|
||||
#[schema(value_type = Option<MerchantDetails>)]
|
||||
pub merchant_details: Option<serde_json::Value>,
|
||||
pub merchant_details: Option<Encryptable<pii::SecretSerdeValue>>,
|
||||
|
||||
/// Webhook related details
|
||||
#[schema(value_type = Option<WebhookDetails>)]
|
||||
|
||||
Reference in New Issue
Block a user