Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(connector): [Trustpay][Volt] Mask PII data (#3932)

AkshayaFoigera179b9c90c2b
diff --git a/crates/router/src/connector/trustpay/transformers.rs b/crates/router/src/connector/trustpay/transformers.rs
index 79850decb6..5c5227aedc 100644
--- a/crates/router/src/connector/trustpay/transformers.rs
+++ b/crates/router/src/connector/trustpay/transformers.rs
@@ -6,7 +6,7 @@ use common_utils::{
pii::{self, Email},
};
use error_stack::{report, ResultExt};
-use masking::{PeekInterface, Secret};
+use masking::{ExposeInterface, PeekInterface, Secret};
use reqwest::Url;
use serde::{Deserialize, Serialize};
@@ -1073,8 +1073,8 @@ pub struct GooglePayTransactionInfo {
#[derive(Clone, Default, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayMerchantInfo {
- pub merchant_name: String,
- pub merchant_id: String,
+ pub merchant_name: Secret<String>,
+ pub merchant_id: Secret<String>,
}
#[derive(Clone, Default, Debug, Deserialize, Serialize)]
@@ -1090,7 +1090,7 @@ pub struct GooglePayAllowedPaymentMethods {
#[serde(rename_all = "camelCase")]
pub struct GpayTokenParameters {
pub gateway: String,
- pub gateway_merchant_id: String,
+ pub gateway_merchant_id: Secret<String>,
}
#[derive(Clone, Default, Debug, Deserialize, Serialize)]
@@ -1295,8 +1295,8 @@ impl From<GooglePayTransactionInfo> for api_models::payments::GpayTransactionInf
impl From<GooglePayMerchantInfo> for api_models::payments::GpayMerchantInfo {
fn from(value: GooglePayMerchantInfo) -> Self {
Self {
- merchant_id: Some(value.merchant_id),
- merchant_name: value.merchant_name,
+ merchant_id: Some(value.merchant_id.expose()),
+ merchant_name: value.merchant_name.expose(),
}
}
}
@@ -1333,7 +1333,7 @@ impl From<GpayTokenParameters> for api_models::payments::GpayTokenParameters {
fn from(value: GpayTokenParameters) -> Self {
Self {
gateway: value.gateway,
- gateway_merchant_id: Some(value.gateway_merchant_id),
+ gateway_merchant_id: Some(value.gateway_merchant_id.expose()),
stripe_version: None,
stripe_publishable_key: None,
}
diff --git a/crates/router/src/connector/volt/transformers.rs b/crates/router/src/connector/volt/transformers.rs
index b7c9a6826c..317f40216f 100644
--- a/crates/router/src/connector/volt/transformers.rs
+++ b/crates/router/src/connector/volt/transformers.rs
@@ -190,7 +190,7 @@ pub struct VoltAuthUpdateResponse {
pub access_token: Secret<String>,
pub token_type: String,
pub expires_in: i64,
- pub refresh_token: String,
+ pub refresh_token: Secret<String>,
}
impl<F, T> TryFrom<types::ResponseRouterData<F, VoltAuthUpdateResponse, T, types::AccessToken>>