Skip to content

Commit

Permalink
feat(connector): [Netcetera] add sca exemption (#6611)
Browse files Browse the repository at this point in the history
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
Sakilmostak and hyperswitch-bot[bot] authored Nov 26, 2024
1 parent 75fe9c0 commit 3120494
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
26 changes: 26 additions & 0 deletions crates/router/src/connector/netcetera/netcetera_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,32 @@ impl From<crate::types::BrowserInformation> for Browser {
}
}

impl From<Option<common_enums::ScaExemptionType>> for ThreeDSRequestor {
fn from(value: Option<common_enums::ScaExemptionType>) -> Self {
// if sca exemption is provided, we need to set the challenge indicator to NoChallengeRequestedTransactionalRiskAnalysis
let three_ds_requestor_challenge_ind =
if let Some(common_enums::ScaExemptionType::TransactionRiskAnalysis) = value {
Some(SingleOrListElement::Single(
ThreeDSRequestorChallengeIndicator::NoChallengeRequestedTransactionalRiskAnalysis,
))
} else {
None
};

Self {
three_ds_requestor_authentication_ind: ThreeDSRequestorAuthenticationIndicator::Payment,
three_ds_requestor_authentication_info: None,
three_ds_requestor_challenge_ind,
three_ds_requestor_prior_authentication_info: None,
three_ds_requestor_dec_req_ind: None,
three_ds_requestor_dec_max_time: None,
app_ip: None,
three_ds_requestor_spc_support: None,
spc_incomp_ind: None,
}
}
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum ChallengeWindowSizeEnum {
#[serde(rename = "01")]
Expand Down
14 changes: 2 additions & 12 deletions crates/router/src/connector/netcetera/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,8 @@ impl TryFrom<&NetceteraRouterData<&types::authentication::ConnectorAuthenticatio
let now = common_utils::date_time::now();
let request = item.router_data.request.clone();
let pre_authn_data = request.pre_authentication_data.clone();
let three_ds_requestor = netcetera_types::ThreeDSRequestor {
three_ds_requestor_authentication_ind:
netcetera_types::ThreeDSRequestorAuthenticationIndicator::Payment,
three_ds_requestor_authentication_info: None,
three_ds_requestor_challenge_ind: None,
three_ds_requestor_prior_authentication_info: None,
three_ds_requestor_dec_req_ind: None,
three_ds_requestor_dec_max_time: None,
app_ip: None,
three_ds_requestor_spc_support: None,
spc_incomp_ind: None,
};
let three_ds_requestor =
netcetera_types::ThreeDSRequestor::from(item.router_data.psd2_sca_exemption_type);
let card = utils::get_card_details(request.payment_method_data, "netcetera")?;
let cardholder_account = netcetera_types::CardholderAccount {
acct_type: None,
Expand Down

0 comments on commit 3120494

Please sign in to comment.