diff --git a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs index fc334d6816..01189f6b92 100644 --- a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs @@ -158,6 +158,13 @@ impl } Some(ACSChallengeMandatedIndicator::N) | None => AuthNFlowType::Frictionless, }; + + let challenge_code = response + .authentication_request + .as_ref() + .and_then(|req| req.three_ds_requestor_challenge_ind.as_ref()) + .and_then(|v| v.first().cloned()); + Ok(AuthenticationResponseData::AuthNResponse { authn_flow_type, authentication_value: response.authentication_value, @@ -165,7 +172,7 @@ impl connector_metadata: None, ds_trans_id: response.authentication_response.ds_trans_id, eci: response.eci, - challenge_code: response.three_ds_requestor_challenge_ind, + challenge_code, challenge_cancel: response.challenge_cancel, challenge_code_reason: response.trans_status_reason, message_extension: response.message_extension.and_then(|v| { @@ -653,13 +660,12 @@ pub struct NetceteraAuthenticationSuccessResponse { pub authentication_value: Option>, pub eci: Option, pub acs_challenge_mandated: Option, + pub authentication_request: Option, pub authentication_response: AuthenticationResponse, #[serde(rename = "base64EncodedChallengeRequest")] pub encoded_challenge_request: Option, pub challenge_cancel: Option, pub trans_status_reason: Option, - #[serde(rename = "threeDSRequestorChallengeInd")] - pub three_ds_requestor_challenge_ind: Option, pub message_extension: Option>, } @@ -669,6 +675,13 @@ pub struct NetceteraAuthenticationFailureResponse { pub error_details: NetceteraErrorDetails, } +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct AuthenticationRequest { + #[serde(rename = "threeDSRequestorChallengeInd")] + pub three_ds_requestor_challenge_ind: Option>, +} + #[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AuthenticationResponse {