diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index 4bb28439b7..14f8b2a7f9 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -2,7 +2,7 @@ use api_models::payments; use base64::Engine; use common_utils::{ext_traits::ValueExt, pii}; use error_stack::{IntoReport, ResultExt}; -use masking::{PeekInterface, Secret}; +use masking::{ExposeInterface, PeekInterface, Secret}; use serde::{Deserialize, Serialize}; use serde_json::Value; @@ -259,9 +259,9 @@ pub struct ProcessingInformation { pub struct CybersourceConsumerAuthInformation { ucaf_collection_indicator: Option, cavv: Option, - ucaf_authentication_data: Option, + ucaf_authentication_data: Option>, xid: Option, - directory_server_transaction_id: Option, + directory_server_transaction_id: Option>, specification_version: Option, } #[derive(Debug, Serialize)] @@ -385,7 +385,7 @@ pub enum PaymentInformation { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CybersoucrePaymentInstrument { - id: String, + id: Secret, } #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] @@ -1071,7 +1071,7 @@ impl ) -> Result { let processing_information = ProcessingInformation::try_from((item, None, None))?; let payment_instrument = CybersoucrePaymentInstrument { - id: connector_mandate_id, + id: connector_mandate_id.into(), }; let email = item.router_data.request.get_email()?; let bill_to = build_bill_to(item.router_data.get_billing()?, email)?; @@ -1491,7 +1491,7 @@ pub struct ClientRiskInformation { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct ClientRiskInformationRules { - name: String, + name: Secret, } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -1592,7 +1592,7 @@ fn get_payment_response( .token_information .clone() .map(|token_info| types::MandateReference { - connector_mandate_id: Some(token_info.payment_instrument.id), + connector_mandate_id: Some(token_info.payment_instrument.id.expose()), payment_method_id: None, }); Ok(types::PaymentsResponseData::TransactionResponse { @@ -1941,10 +1941,10 @@ pub enum CybersourceAuthEnrollmentStatus { pub struct CybersourceConsumerAuthValidateResponse { ucaf_collection_indicator: Option, cavv: Option, - ucaf_authentication_data: Option, + ucaf_authentication_data: Option>, xid: Option, specification_version: Option, - directory_server_transaction_id: Option, + directory_server_transaction_id: Option>, indicator: Option, } @@ -1956,7 +1956,7 @@ pub struct CybersourceThreeDSMetadata { #[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CybersourceConsumerAuthInformationEnrollmentResponse { - access_token: Option, + access_token: Option>, step_up_url: Option, //Added to segregate the three_ds_data in a separate struct #[serde(flatten)] @@ -2044,9 +2044,9 @@ impl .consumer_authentication_information .step_up_url, ) { - (Some(access_token), Some(step_up_url)) => { + (Some(token), Some(step_up_url)) => { Some(services::RedirectForm::CybersourceConsumerAuth { - access_token, + access_token: token.expose(), step_up_url, }) } @@ -2241,7 +2241,7 @@ impl CybersourceSetupMandatesResponse::ClientReferenceInformation(info_response) => { let mandate_reference = info_response.token_information.clone().map(|token_info| { types::MandateReference { - connector_mandate_id: Some(token_info.payment_instrument.id), + connector_mandate_id: Some(token_info.payment_instrument.id.expose()), payment_method_id: None, } }); @@ -2655,7 +2655,7 @@ impl client_risk_information.rules.map(|rules| { rules .iter() - .map(|risk_info| format!(" , {}", risk_info.name)) + .map(|risk_info| format!(" , {}", risk_info.name.clone().expose())) .collect::>() .join("") })