Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connector): [Netcetera] add sca exemption #6611

Open
wants to merge 2 commits into
base: hs_sca_exemption
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading