mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
fix(router): Added authentication success check for fetching authentication value (#9769)
This commit is contained in:
@ -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(
|
||||
|
||||
@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user