Skip to content

Commit 03df037

Browse files
authored
Merge branch 'main' into vantiv/mac/code
2 parents fc1df3a + 30b4522 commit 03df037

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,21 @@ impl
158158
}
159159
Some(ACSChallengeMandatedIndicator::N) | None => AuthNFlowType::Frictionless,
160160
};
161+
162+
let challenge_code = response
163+
.authentication_request
164+
.as_ref()
165+
.and_then(|req| req.three_ds_requestor_challenge_ind.as_ref())
166+
.and_then(|v| v.first().cloned());
167+
161168
Ok(AuthenticationResponseData::AuthNResponse {
162169
authn_flow_type,
163170
authentication_value: response.authentication_value,
164171
trans_status: response.trans_status,
165172
connector_metadata: None,
166173
ds_trans_id: response.authentication_response.ds_trans_id,
167174
eci: response.eci,
168-
challenge_code: response.three_ds_requestor_challenge_ind,
175+
challenge_code,
169176
challenge_cancel: response.challenge_cancel,
170177
challenge_code_reason: response.trans_status_reason,
171178
message_extension: response.message_extension.and_then(|v| {
@@ -653,13 +660,12 @@ pub struct NetceteraAuthenticationSuccessResponse {
653660
pub authentication_value: Option<Secret<String>>,
654661
pub eci: Option<String>,
655662
pub acs_challenge_mandated: Option<ACSChallengeMandatedIndicator>,
663+
pub authentication_request: Option<AuthenticationRequest>,
656664
pub authentication_response: AuthenticationResponse,
657665
#[serde(rename = "base64EncodedChallengeRequest")]
658666
pub encoded_challenge_request: Option<String>,
659667
pub challenge_cancel: Option<String>,
660668
pub trans_status_reason: Option<String>,
661-
#[serde(rename = "threeDSRequestorChallengeInd")]
662-
pub three_ds_requestor_challenge_ind: Option<String>,
663669
pub message_extension: Option<Vec<MessageExtensionAttribute>>,
664670
}
665671

@@ -669,6 +675,13 @@ pub struct NetceteraAuthenticationFailureResponse {
669675
pub error_details: NetceteraErrorDetails,
670676
}
671677

678+
#[derive(Debug, Deserialize, Serialize)]
679+
#[serde(rename_all = "camelCase")]
680+
pub struct AuthenticationRequest {
681+
#[serde(rename = "threeDSRequestorChallengeInd")]
682+
pub three_ds_requestor_challenge_ind: Option<Vec<String>>,
683+
}
684+
672685
#[derive(Debug, Deserialize, Serialize)]
673686
#[serde(rename_all = "camelCase")]
674687
pub struct AuthenticationResponse {

0 commit comments

Comments
 (0)