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

fix(core): make eci in AuthenticationData optional #4187

Merged
merged 1 commit into from
Mar 26, 2024
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
2 changes: 1 addition & 1 deletion crates/router/src/connector/checkout/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl TryFrom<&CheckoutRouterData<&types::PaymentsAuthorizeRouterData>> for Payme
enums::AuthenticationType::ThreeDs => CheckoutThreeDS {
enabled: true,
force_3ds: true,
eci: authentication_data.map(|auth| auth.eci.clone()),
eci: authentication_data.and_then(|auth| auth.eci.clone()),
cryptogram: authentication_data.map(|auth| auth.cavv.clone()),
xid: authentication_data.map(|auth| auth.threeds_server_transaction_id.clone()),
version: authentication_data.map(|auth| auth.message_version.clone()),
Expand Down
10 changes: 2 additions & 8 deletions crates/router/src/core/payments/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl SurchargeMetadata {

#[derive(Debug, Clone)]
pub struct AuthenticationData {
pub eci: String,
pub eci: Option<String>,
pub cavv: String,
pub threeds_server_transaction_id: String,
pub message_version: String,
Expand Down Expand Up @@ -409,14 +409,8 @@ impl ForeignTryFrom<&storage::Authentication> for AuthenticationData {
.get_required_value("cavv")
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("cavv must not be null when authentication_status is success")?;
let eci = authentication
.eci
.clone()
.get_required_value("eci")
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("eci must not be null when authentication_status is success")?;
Ok(Self {
eci,
eci: authentication.eci.clone(),
cavv,
threeds_server_transaction_id,
message_version: message_version.to_string(),
Expand Down
Loading