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

fix(payment_methods): mask the email address being logged in the `payment_method_list` response logs (#4749)

Shankar Singh C23c73951bbdd
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs
index d26a2deac1..d63d2b085b 100644
--- a/crates/api_models/src/payment_methods.rs
+++ b/crates/api_models/src/payment_methods.rs
@@ -531,7 +531,8 @@ pub struct RequiredFieldInfo {
#[schema(value_type = FieldType)]
pub field_type: api_enums::FieldType,
- pub value: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub value: Option<masking::Secret<String>>,
}
#[derive(Debug, Clone, serde::Serialize, ToSchema)]
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs
index 28121ecc80..5a12334c38 100644
--- a/crates/router/src/core/payment_methods/cards.rs
+++ b/crates/router/src/core/payment_methods/cards.rs
@@ -2268,7 +2268,7 @@ pub async fn list_payment_methods(
.as_ref()
.and_then(|r| get_val(key.to_owned(), r));
if let Some(s) = temp {
- val.value = Some(s)
+ val.value = Some(s.into())
};
}
}