fix(router): Added authentication success check for fetching authentication value (#9769)

This commit is contained in:
Sahkal Poddar
2025-10-16 16:54:11 +05:30
committed by GitHub
parent c2c489407c
commit 79e1443c00
2 changed files with 10 additions and 2 deletions

View File

@ -8230,6 +8230,10 @@ impl AuthenticationStatus {
pub fn is_failed(self) -> bool {
self == Self::Failed
}
pub fn is_success(self) -> bool {
self == Self::Success
}
}
#[derive(

View File

@ -1592,10 +1592,14 @@ impl<F: Clone + Send + Sync> Domain<F, api::PaymentsRequest, PaymentData<F>> for
authentication
};
let tokenized_data = crate::core::payment_methods::vault::get_tokenized_data(state, authentication_id.get_string_repr(), false, key_store.key.get_inner()).await?;
let tokenized_data = if updated_authentication.authentication_status.is_success() {
Some(crate::core::payment_methods::vault::get_tokenized_data(state, authentication_id.get_string_repr(), false, key_store.key.get_inner()).await?)
} else {
None
};
let authentication_store = hyperswitch_domain_models::router_request_types::authentication::AuthenticationStore {
cavv: Some(masking::Secret::new(tokenized_data.value1)),
cavv: tokenized_data.map(|tokenized_data| masking::Secret::new(tokenized_data.value1)),
authentication: updated_authentication
};