Skip to content

feat(core): Added additional authentication fields for 3ds external authentication #8758

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

Merged
merged 4 commits into from
Aug 5, 2025
Merged
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
44 changes: 43 additions & 1 deletion crates/diesel_models/src/authentication.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use common_utils::encryption::Encryption;
use common_utils::{encryption::Encryption, pii};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{self, Deserialize, Serialize};
use serde_json;
Expand Down Expand Up @@ -61,6 +61,10 @@ pub struct Authentication {
pub browser_info: Option<serde_json::Value>,
pub email: Option<Encryption>,
pub profile_acquirer_id: Option<common_utils::id_type::ProfileAcquirerId>,
pub challenge_code: Option<String>,
pub challenge_cancel: Option<String>,
pub challenge_code_reason: Option<String>,
pub message_extension: Option<pii::SecretSerdeValue>,
}

impl Authentication {
Expand Down Expand Up @@ -121,6 +125,10 @@ pub struct AuthenticationNew {
pub browser_info: Option<serde_json::Value>,
pub email: Option<Encryption>,
pub profile_acquirer_id: Option<common_utils::id_type::ProfileAcquirerId>,
pub challenge_code: Option<String>,
pub challenge_cancel: Option<String>,
pub challenge_code_reason: Option<String>,
pub message_extension: Option<pii::SecretSerdeValue>,
}

#[derive(Debug)]
Expand Down Expand Up @@ -167,11 +175,17 @@ pub enum AuthenticationUpdate {
authentication_status: common_enums::AuthenticationStatus,
ds_trans_id: Option<String>,
eci: Option<String>,
challenge_code: Option<String>,
challenge_cancel: Option<String>,
challenge_code_reason: Option<String>,
message_extension: Option<pii::SecretSerdeValue>,
},
PostAuthenticationUpdate {
trans_status: common_enums::TransactionStatus,
eci: Option<String>,
authentication_status: common_enums::AuthenticationStatus,
challenge_cancel: Option<String>,
challenge_code_reason: Option<String>,
},
ErrorUpdate {
error_message: Option<String>,
Expand Down Expand Up @@ -227,6 +241,10 @@ pub struct AuthenticationUpdateInternal {
pub browser_info: Option<serde_json::Value>,
pub email: Option<Encryption>,
pub profile_acquirer_id: Option<common_utils::id_type::ProfileAcquirerId>,
pub challenge_code: Option<String>,
pub challenge_cancel: Option<String>,
pub challenge_code_reason: Option<String>,
pub message_extension: Option<pii::SecretSerdeValue>,
}

impl Default for AuthenticationUpdateInternal {
Expand Down Expand Up @@ -267,6 +285,10 @@ impl Default for AuthenticationUpdateInternal {
browser_info: Default::default(),
email: Default::default(),
profile_acquirer_id: Default::default(),
challenge_code: Default::default(),
challenge_cancel: Default::default(),
challenge_code_reason: Default::default(),
message_extension: Default::default(),
}
}
}
Expand Down Expand Up @@ -309,6 +331,10 @@ impl AuthenticationUpdateInternal {
browser_info,
email,
profile_acquirer_id,
challenge_code,
challenge_cancel,
challenge_code_reason,
message_extension,
} = self;
Authentication {
connector_authentication_id: connector_authentication_id
Expand Down Expand Up @@ -350,6 +376,10 @@ impl AuthenticationUpdateInternal {
browser_info: browser_info.or(source.browser_info),
email: email.or(source.email),
profile_acquirer_id: profile_acquirer_id.or(source.profile_acquirer_id),
challenge_code: challenge_code.or(source.challenge_code),
challenge_cancel: challenge_cancel.or(source.challenge_cancel),
challenge_code_reason: challenge_code_reason.or(source.challenge_code_reason),
message_extension: message_extension.or(source.message_extension),
..source
}
}
Expand Down Expand Up @@ -438,6 +468,10 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {
authentication_status,
ds_trans_id,
eci,
challenge_code,
challenge_cancel,
challenge_code_reason,
message_extension,
} => Self {
trans_status: Some(trans_status),
authentication_type: Some(authentication_type),
Expand All @@ -450,16 +484,24 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {
authentication_status: Some(authentication_status),
ds_trans_id,
eci,
challenge_code,
challenge_cancel,
challenge_code_reason,
message_extension,
..Default::default()
},
AuthenticationUpdate::PostAuthenticationUpdate {
trans_status,
eci,
authentication_status,
challenge_cancel,
challenge_code_reason,
} => Self {
trans_status: Some(trans_status),
eci,
authentication_status: Some(authentication_status),
challenge_cancel,
challenge_code_reason,
..Default::default()
},
AuthenticationUpdate::PreAuthenticationVersionCallUpdate {
Expand Down
4 changes: 4 additions & 0 deletions crates/diesel_models/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ diesel::table! {
email -> Nullable<Bytea>,
#[max_length = 128]
profile_acquirer_id -> Nullable<Varchar>,
challenge_code -> Nullable<Varchar>,
challenge_cancel -> Nullable<Varchar>,
challenge_code_reason -> Nullable<Varchar>,
message_extension -> Nullable<Jsonb>,
}
}

Expand Down
4 changes: 4 additions & 0 deletions crates/diesel_models/src/schema_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ diesel::table! {
email -> Nullable<Bytea>,
#[max_length = 128]
profile_acquirer_id -> Nullable<Varchar>,
challenge_code -> Nullable<Varchar>,
challenge_cancel -> Nullable<Varchar>,
challenge_code_reason -> Nullable<Varchar>,
message_extension -> Nullable<Jsonb>,
}
}

Expand Down
Loading
Loading