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

feat(authentication): support 3DS 2.3.1 SPC trans_status `S` (#14585)

Sahkal Poddarfb6d9c7a57bb
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index ad7abffa71..a2e4bd427c 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -49139,7 +49139,8 @@
"R",
"C",
"D",
- "I"
+ "I",
+ "S"
]
},
"TransactionType": {
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.json
index f12aaf9b5a..959911c807 100644
--- a/api-reference/v2/openapi_spec_v2.json
+++ b/api-reference/v2/openapi_spec_v2.json
@@ -35108,7 +35108,8 @@
"R",
"C",
"D",
- "I"
+ "I",
+ "S"
]
},
"TransactionType": {
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index 8dc7ed43d2..2b452e9c33 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -9741,13 +9741,18 @@ pub enum TransactionStatus {
/// Informational Only; 3DS Requestor challenge preference acknowledged.
#[serde(rename = "I")]
InformationOnly,
+ /// Challenge using Secure Payment Confirmation (SPC); Available for supporting EMV 3DS 2.3.1 and later versions.
+ #[serde(rename = "S")]
+ SecurePaymentConfirmationRequired,
}
impl TransactionStatus {
pub fn is_pending(self) -> bool {
matches!(
self,
- Self::ChallengeRequired | Self::ChallengeRequiredDecoupledAuthentication
+ Self::ChallengeRequired
+ | Self::ChallengeRequiredDecoupledAuthentication
+ | Self::SecurePaymentConfirmationRequired
)
}
@@ -9760,7 +9765,8 @@ impl From<TransactionStatus> for DecoupledAuthenticationType {
fn from(trans_status: TransactionStatus) -> Self {
match trans_status {
TransactionStatus::ChallengeRequired
- | TransactionStatus::ChallengeRequiredDecoupledAuthentication => Self::Challenge,
+ | TransactionStatus::ChallengeRequiredDecoupledAuthentication
+ | TransactionStatus::SecurePaymentConfirmationRequired => Self::Challenge,
_ => Self::Frictionless,
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs b/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
index e65b9ed555..297652f927 100644
--- a/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
@@ -2905,6 +2905,7 @@ fn map_transaction_status_to_code(status: &common_enums::TransactionStatus) -> S
"D".to_string()
}
common_enums::TransactionStatus::InformationOnly => "I".to_string(),
+ common_enums::TransactionStatus::SecurePaymentConfirmationRequired => "S".to_string(),
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
index 8a998d93d5..7bac061fd1 100644
--- a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
@@ -1091,7 +1091,9 @@ impl<F, T>
let response = match item.response {
UnifiedAuthenticationServiceAuthenticateResponse::Success(auth_response) => {
let authn_flow_type = match auth_response.three_ds_auth_response.trans_status {
- common_enums::TransactionStatus::ChallengeRequired => {
+ // SPC is not supported, so `S` falls back to the regular ACS challenge
+ common_enums::TransactionStatus::ChallengeRequired
+ | common_enums::TransactionStatus::SecurePaymentConfirmationRequired => {
AuthNFlowType::Challenge(Box::new(ChallengeParams {
acs_url: auth_response.three_ds_auth_response.acs_url.clone(),
challenge_request: auth_response
diff --git a/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs b/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
index 0ce04a6fc9..023446b04e 100644
--- a/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
@@ -228,6 +228,7 @@ impl TryFrom<&hyperswitch_domain_models::router_request_types::AuthenticationDat
| Some(common_enums::TransactionStatus::Failure)
| Some(common_enums::TransactionStatus::ChallengeRequired)
| Some(common_enums::TransactionStatus::ChallengeRequiredDecoupledAuthentication)
+ | Some(common_enums::TransactionStatus::SecurePaymentConfirmationRequired)
| None => Self::Unavailable,
};
Ok(authentication_status)
diff --git a/crates/router/src/core/authentication/transformers.rs b/crates/router/src/core/authentication/transformers.rs
index 57525e988d..4a2c18affc 100644
--- a/crates/router/src/core/authentication/transformers.rs
+++ b/crates/router/src/core/authentication/transformers.rs
@@ -234,6 +234,7 @@ impl ForeignFrom<common_enums::TransactionStatus> for common_enums::Authenticati
| common_enums::TransactionStatus::NotVerified => Self::Failed,
common_enums::TransactionStatus::ChallengeRequired
| common_enums::TransactionStatus::ChallengeRequiredDecoupledAuthentication
+ | common_enums::TransactionStatus::SecurePaymentConfirmationRequired
| common_enums::TransactionStatus::InformationOnly => Self::Pending,
}
}
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 7397d8873e..f4fe630d0e 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -13624,7 +13624,8 @@ pub async fn payment_external_authentication<F: Clone + Sync>(
external_threeds_authentication_type: response.transaction_status.as_ref().and_then(
|transaction_status| match transaction_status {
common_enums::TransactionStatus::ChallengeRequired
- | common_enums::TransactionStatus::ChallengeRequiredDecoupledAuthentication => {
+ | common_enums::TransactionStatus::ChallengeRequiredDecoupledAuthentication
+ | common_enums::TransactionStatus::SecurePaymentConfirmationRequired => {
Some(common_enums::DecoupledAuthenticationType::Challenge)
}
common_enums::TransactionStatus::Success => {
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index d465fa3b60..535e76357f 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -6477,6 +6477,8 @@ impl ForeignFrom<common_enums::TransactionStatus> for payments_grpc::Transaction
Self::ChallengeRequiredDecoupledAuthentication
}
common_enums::TransactionStatus::InformationOnly => Self::InformationOnly,
+ // UCS proto has no SPC variant yet
+ common_enums::TransactionStatus::SecurePaymentConfirmationRequired => Self::Unspecified,
}
}
}