Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

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

Hrithikesh4f0c788cf269
diff --git a/crates/router/src/connector/checkout/transformers.rs b/crates/router/src/connector/checkout/transformers.rs
index 8004b3b5a1..64fddca13b 100644
--- a/crates/router/src/connector/checkout/transformers.rs
+++ b/crates/router/src/connector/checkout/transformers.rs
@@ -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()),
diff --git a/crates/router/src/core/payments/types.rs b/crates/router/src/core/payments/types.rs
index 6e33b2f60e..ac54e1b7aa 100644
--- a/crates/router/src/core/payments/types.rs
+++ b/crates/router/src/core/payments/types.rs
@@ -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,
@@ -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(),