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): [Noon] Mask PII data (#3879)

AkshayaFoiger96efc2abf94e
diff --git a/crates/router/src/connector/noon/transformers.rs b/crates/router/src/connector/noon/transformers.rs
index fff99109b2..fdcb2ad5af 100644
--- a/crates/router/src/connector/noon/transformers.rs
+++ b/crates/router/src/connector/noon/transformers.rs
@@ -1,6 +1,6 @@
use common_utils::{ext_traits::Encode, pii};
use error_stack::{IntoReport, ResultExt};
-use masking::{PeekInterface, Secret};
+use masking::{ExposeInterface, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
@@ -124,7 +124,7 @@ pub struct NoonConfiguration {
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct NoonSubscription {
- subscription_identifier: String,
+ subscription_identifier: Secret<String>,
}
#[derive(Debug, Serialize)]
@@ -230,9 +230,9 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NoonPaymentsRequest {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> {
let (payment_data, currency, category) = match item.request.connector_mandate_id() {
- Some(subscription_identifier) => (
+ Some(mandate_id) => (
NoonPaymentData::Subscription(NoonSubscription {
- subscription_identifier,
+ subscription_identifier: Secret::new(mandate_id),
}),
None,
None,
@@ -512,7 +512,7 @@ impl ForeignFrom<(NoonPaymentStatus, Self)> for enums::AttemptStatus {
#[derive(Debug, Serialize, Deserialize)]
pub struct NoonSubscriptionObject {
- identifier: String,
+ identifier: Secret<String>,
}
#[derive(Default, Debug, Serialize, Deserialize)]
@@ -566,7 +566,7 @@ impl<F, T>
.result
.subscription
.map(|subscription_data| types::MandateReference {
- connector_mandate_id: Some(subscription_data.identifier),
+ connector_mandate_id: Some(subscription_data.identifier.expose()),
payment_method_id: None,
});
Ok(Self {
@@ -678,7 +678,7 @@ impl TryFrom<&types::MandateRevokeRouterData> for NoonRevokeMandateRequest {
Ok(Self {
api_operation: NoonApiOperations::CancelSubscription,
subscription: NoonSubscriptionObject {
- identifier: item.request.get_connector_mandate_id()?,
+ identifier: Secret::new(item.request.get_connector_mandate_id()?),
},
})
}