refactor(connector): [Payme][Payeezy] Mask PII data (#3926)

This commit is contained in:
AkshayaFoiger
2024-03-11 12:56:57 +05:30
committed by GitHub
parent bd7accb2c2
commit ffcb2bcf2b
2 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
use cards::CardNumber;
use common_utils::ext_traits::Encode;
use error_stack::ResultExt;
use masking::Secret;
use masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
@ -108,7 +108,7 @@ pub struct StoredCredentials {
pub sequence: Sequence,
pub initiator: Initiator,
pub is_scheduled: bool,
pub cardbrand_original_transaction_id: Option<String>,
pub cardbrand_original_transaction_id: Option<Secret<String>>,
}
#[derive(Debug, Serialize, Deserialize)]
@ -203,7 +203,7 @@ fn get_transaction_type_and_stored_creds(
},
is_scheduled: true,
// In case of first mandate payment connector_mandate_id would be None, otherwise holds some value
cardbrand_original_transaction_id: connector_mandate_id,
cardbrand_original_transaction_id: connector_mandate_id.map(Secret::new),
}),
)
} else {
@ -329,7 +329,7 @@ pub struct PayeezyPaymentsResponse {
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsStoredCredentials {
cardbrand_original_transaction_id: String,
cardbrand_original_transaction_id: Secret<String>,
}
#[derive(Debug, Serialize)]
@ -416,7 +416,7 @@ impl<F, T>
.stored_credentials
.map(|credentials| credentials.cardbrand_original_transaction_id)
.map(|id| types::MandateReference {
connector_mandate_id: Some(id),
connector_mandate_id: Some(id.expose()),
payment_method_id: None,
});
let status = enums::AttemptStatus::foreign_from((

View File

@ -84,7 +84,7 @@ pub struct Pay3dsRequest {
buyer_email: pii::Email,
buyer_key: String,
payme_sale_id: String,
meta_data_jwt: String,
meta_data_jwt: Secret<String>,
}
#[derive(Debug, Serialize)]
@ -122,7 +122,7 @@ pub struct CaptureBuyerRequest {
#[derive(Debug, Deserialize, Serialize)]
pub struct CaptureBuyerResponse {
buyer_key: String,
buyer_key: Secret<String>,
}
#[derive(Debug, Serialize)]
@ -719,7 +719,7 @@ impl TryFrom<&types::PaymentsCompleteAuthorizeRouterData> for Pay3dsRequest {
buyer_key,
buyer_name,
payme_sale_id,
meta_data_jwt: jwt_data.meta_data,
meta_data_jwt: Secret::new(jwt_data.meta_data),
})
}
Some(api::PaymentMethodData::CardRedirect(_))
@ -902,10 +902,10 @@ impl<F, T>
) -> Result<Self, Self::Error> {
Ok(Self {
payment_method_token: Some(types::PaymentMethodToken::Token(
item.response.buyer_key.clone(),
item.response.buyer_key.clone().expose(),
)),
response: Ok(types::PaymentsResponseData::TokenizationResponse {
token: item.response.buyer_key,
token: item.response.buyer_key.expose(),
}),
..item.data
})