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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(router): add `challenge_request_key` in authentication response and add support for cardinal authentication processor (#9429)
Sai Harsha Vardhanb23c28b06102
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.jsonindex 29fb70620b..c0d580edc8 100644--- a/api-reference/v1/openapi_spec_v1.json+++ b/api-reference/v1/openapi_spec_v1.json@@ -8169,7 +8169,8 @@"ctp_mastercard","unified_authentication_service","juspaythreedsserver",- "ctp_visa"+ "ctp_visa",+ "cardinal"]},"AuthenticationCreateRequest": {@@ -12049,6 +12050,7 @@"boku","braintree","breadpay",+ "cardinal","cashtocode","celero","chargebee",@@ -24297,6 +24299,11 @@"description": "Challenge request which should be sent to acs_url","nullable": true},+ "challenge_request_key": {+ "type": "string",+ "description": "Challenge request key which should be set as form field name for creq",+ "nullable": true+ },"acs_reference_number": {"type": "string","description": "Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)",diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.jsonindex 2bf8e41235..07b6c0a6db 100644--- a/api-reference/v2/openapi_spec_v2.json+++ b/api-reference/v2/openapi_spec_v2.json@@ -5217,7 +5217,8 @@"ctp_mastercard","unified_authentication_service","juspaythreedsserver",- "ctp_visa"+ "ctp_visa",+ "cardinal"]},"AuthenticationDetails": {@@ -8651,6 +8652,7 @@"boku","braintree","breadpay",+ "cardinal","cashtocode","celero","chargebee",@@ -19401,6 +19403,11 @@"description": "Challenge request which should be sent to acs_url","nullable": true},+ "challenge_request_key": {+ "type": "string",+ "description": "Challenge request key which should be set as form field name for creq",+ "nullable": true+ },"acs_reference_number": {"type": "string","description": "Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)",diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex 62390067d3..2158b8be12 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -8448,6 +8448,8 @@ pub struct PaymentsExternalAuthenticationResponse {pub acs_url: Option<String>,/// Challenge request which should be sent to acs_urlpub challenge_request: Option<String>,+ /// Challenge request key which should be set as form field name for creq+ pub challenge_request_key: Option<String>,/// Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)pub acs_reference_number: Option<String>,/// Unique identifier assigned by the ACS to identify a single transactiondiff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rsindex 56735cb15d..128f2a9eac 100644--- a/crates/common_enums/src/connector_enums.rs+++ b/crates/common_enums/src/connector_enums.rs@@ -250,6 +250,7 @@ pub enum Connector {Boku,Braintree,Breadpay,+ Cardinal,Cashtocode,Celero,Chargebee,@@ -544,6 +545,7 @@ impl Connector {| Self::Threedsecureio| Self::Netcetera| Self::CtpMastercard+ | Self::Cardinal| Self::CtpVisa| Self::Noon| Self::Tokenio@@ -867,7 +869,8 @@ impl TryFrom<Connector> for RoutableConnectors {| Connector::Taxjar| Connector::Threedsecureio| Connector::Vgs- | Connector::CtpVisa => Err("Invalid conversion. Not a routable connector"),+ | Connector::CtpVisa+ | Connector::Cardinal => Err("Invalid conversion. Not a routable connector"),}}}diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rsindex 03ceab3f9a..296f60f8d4 100644--- a/crates/common_enums/src/enums.rs+++ b/crates/common_enums/src/enums.rs@@ -8067,6 +8067,7 @@ pub enum AuthenticationConnectors {UnifiedAuthenticationService,Juspaythreedsserver,CtpVisa,+ Cardinal,}impl AuthenticationConnectors {@@ -8077,7 +8078,8 @@ impl AuthenticationConnectors {| Self::CtpMastercard| Self::UnifiedAuthenticationService| Self::Juspaythreedsserver- | Self::CtpVisa => false,+ | Self::CtpVisa+ | Self::Cardinal => false,Self::Gpayments => true,}}diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rsindex efad124bff..5e42b582b0 100644--- a/crates/connector_configs/src/connector.rs+++ b/crates/connector_configs/src/connector.rs@@ -236,6 +236,7 @@ pub struct ConnectorConfig {pub boku: Option<ConnectorTomlConfig>,pub braintree: Option<ConnectorTomlConfig>,pub breadpay: Option<ConnectorTomlConfig>,+ pub cardinal: Option<ConnectorTomlConfig>,pub cashtocode: Option<ConnectorTomlConfig>,pub celero: Option<ConnectorTomlConfig>,pub chargebee: Option<ConnectorTomlConfig>,@@ -399,6 +400,7 @@ impl ConnectorConfig {Ok(connector_data.unified_authentication_service)}AuthenticationConnectors::Juspaythreedsserver => Ok(connector_data.juspaythreedsserver),+ AuthenticationConnectors::Cardinal => Ok(connector_data.cardinal),}}@@ -446,6 +448,7 @@ impl ConnectorConfig {Connector::Braintree => Ok(connector_data.braintree),Connector::Breadpay => Ok(connector_data.breadpay),Connector::Cashtocode => Ok(connector_data.cashtocode),+ Connector::Cardinal => Ok(connector_data.cardinal),Connector::Celero => Ok(connector_data.celero),Connector::Chargebee => Ok(connector_data.chargebee),Connector::Checkbook => Ok(connector_data.checkbook),diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.tomlindex e471cf41ee..e461bc34bf 100644--- a/crates/connector_configs/toml/development.toml+++ b/crates/connector_configs/toml/development.toml@@ -5571,6 +5571,21 @@ placeholder="Enter Merchant Configuration ID"required=falsetype="Text"++[cardinal]+[cardinal.connector_auth.SignatureKey]+api_key = "API Key"+api_secret = "API ID"+key1 = "Organization Unit ID"++[cardinal.metadata.pull_mechanism_for_external_3ds_enabled]+name="pull_mechanism_for_external_3ds_enabled"+label="Pull Mechanism Enabled"+placeholder="Enter Pull Mechanism Enabled"+required=true+type="Toggle"++[taxjar][taxjar.connector_auth.HeaderKey]api_key="Sandbox Token"diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.tomlindex 8e74e8c1c4..8b3d2a9b78 100644--- a/crates/connector_configs/toml/production.toml+++ b/crates/connector_configs/toml/production.toml@@ -4162,6 +4162,19 @@ placeholder = "Enter Merchant Configuration ID"required = falsetype = "Text"+[cardinal]+[cardinal.connector_auth.SignatureKey]+api_key = "API Key"+api_secret = "API ID"+key1 = "Organization Unit ID"++[cardinal.metadata.pull_mechanism_for_external_3ds_enabled]+name="pull_mechanism_for_external_3ds_enabled"+label="Pull Mechanism Enabled"+placeholder="Enter Pull Mechanism Enabled"+required=true+type="Toggle"+[taxjar][taxjar.connector_auth.HeaderKey]api_key = "Live Token"diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.tomlindex 0ec6cbd7f8..bb44e18500 100644--- a/crates/connector_configs/toml/sandbox.toml+++ b/crates/connector_configs/toml/sandbox.toml@@ -5532,6 +5532,18 @@ placeholder = "Enter Merchant Configuration ID"required = falsetype = "Text"+[cardinal]+[cardinal.connector_auth.SignatureKey]+api_key = "API Key"+api_secret = "API ID"+key1 = "Organization Unit ID"++[cardinal.metadata.pull_mechanism_for_external_3ds_enabled]+name="pull_mechanism_for_external_3ds_enabled"+label="Pull Mechanism Enabled"+placeholder="Enter Pull Mechanism Enabled"+required=true+type="Toggle"[taxjar][taxjar.connector_auth.HeaderKey]diff --git a/crates/diesel_models/src/authentication.rs b/crates/diesel_models/src/authentication.rsindex c844df0a69..0a621e6d61 100644--- a/crates/diesel_models/src/authentication.rs+++ b/crates/diesel_models/src/authentication.rs@@ -65,6 +65,7 @@ pub struct Authentication {pub challenge_cancel: Option<String>,pub challenge_code_reason: Option<String>,pub message_extension: Option<pii::SecretSerdeValue>,+ pub challenge_request_key: Option<String>,}impl Authentication {@@ -129,6 +130,7 @@ pub struct AuthenticationNew {pub challenge_cancel: Option<String>,pub challenge_code_reason: Option<String>,pub message_extension: Option<pii::SecretSerdeValue>,+ pub challenge_request_key: Option<String>,}#[derive(Debug)]@@ -179,6 +181,7 @@ pub enum AuthenticationUpdate {challenge_cancel: Option<String>,challenge_code_reason: Option<String>,message_extension: Option<pii::SecretSerdeValue>,+ challenge_request_key: Option<String>,},PostAuthenticationUpdate {trans_status: common_enums::TransactionStatus,@@ -245,6 +248,7 @@ pub struct AuthenticationUpdateInternal {pub challenge_cancel: Option<String>,pub challenge_code_reason: Option<String>,pub message_extension: Option<pii::SecretSerdeValue>,+ pub challenge_request_key: Option<String>,}impl Default for AuthenticationUpdateInternal {@@ -289,6 +293,7 @@ impl Default for AuthenticationUpdateInternal {challenge_cancel: Default::default(),challenge_code_reason: Default::default(),message_extension: Default::default(),+ challenge_request_key: Default::default(),}}}@@ -335,6 +340,7 @@ impl AuthenticationUpdateInternal {challenge_cancel,challenge_code_reason,message_extension,+ challenge_request_key,} = self;Authentication {connector_authentication_id: connector_authentication_id@@ -380,6 +386,7 @@ impl AuthenticationUpdateInternal {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),+ challenge_request_key: challenge_request_key.or(source.challenge_request_key),..source}}@@ -472,6 +479,7 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {challenge_cancel,challenge_code_reason,message_extension,+ challenge_request_key,} => Self {trans_status: Some(trans_status),authentication_type: Some(authentication_type),@@ -488,6 +496,7 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {challenge_cancel,challenge_code_reason,message_extension,+ challenge_request_key,..Default::default()},AuthenticationUpdate::PostAuthenticationUpdate {diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rsindex c02a9748f8..36345ef757 100644--- a/crates/diesel_models/src/schema.rs+++ b/crates/diesel_models/src/schema.rs@@ -142,6 +142,8 @@ diesel::table! {challenge_cancel -> Nullable<Varchar>,challenge_code_reason -> Nullable<Varchar>,message_extension -> Nullable<Jsonb>,+ #[max_length = 255]+ challenge_request_key -> Nullable<Varchar>,}}diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rsindex 4648eed49f..f05b4e460c 100644--- a/crates/diesel_models/src/schema_v2.rs+++ b/crates/diesel_models/src/schema_v2.rs@@ -142,6 +142,8 @@ diesel::table! {challenge_cancel -> Nullable<Varchar>,challenge_code_reason -> Nullable<Varchar>,message_extension -> Nullable<Jsonb>,+ #[max_length = 255]+ challenge_request_key -> Nullable<Varchar>,}}diff --git a/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs b/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rsindex 11f58d278a..369aa67360 100644--- a/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs@@ -287,6 +287,7 @@ implacs_trans_id: Some(response_auth.acs_trans_id.clone()),three_dsserver_trans_id: Some(response_auth.three_ds_server_trans_id),acs_signed_content: None,+ challenge_request_key: None,}))} else {AuthNFlowType::Frictionlessdiff --git a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rsindex 0c12d7415c..e8f1e8ffc6 100644--- a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs@@ -155,6 +155,7 @@ implacs_trans_id: response.authentication_response.acs_trans_id,three_dsserver_trans_id: Some(response.three_ds_server_trans_id),acs_signed_content: response.authentication_response.acs_signed_content,+ challenge_request_key: None,}))}Some(ACSChallengeMandatedIndicator::N) | None => AuthNFlowType::Frictionless,diff --git a/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs b/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rsindex 691448e600..a6acb3d1e2 100644--- a/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs@@ -177,6 +177,7 @@ implacs_trans_id: Some(response.acs_trans_id.clone()),three_dsserver_trans_id: Some(response.three_dsserver_trans_id),acs_signed_content: response.acs_signed_content,+ challenge_request_key: None,}))} else {AuthNFlowType::Frictionlessdiff --git a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rsindex a57271d860..19c50cd07b 100644--- a/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs@@ -655,6 +655,11 @@ pub enum UnifiedAuthenticationServiceAuthType {certificate: Secret<String>,private_key: Secret<String>,},+ SignatureKey {+ api_key: Secret<String>,+ key1: Secret<String>,+ api_secret: Secret<String>,+ },NoKey,}@@ -665,6 +670,15 @@ impl TryFrom<&ConnectorAuthType> for UnifiedAuthenticationServiceAuthType {ConnectorAuthType::HeaderKey { api_key } => Ok(Self::HeaderKey {api_key: api_key.clone(),}),+ ConnectorAuthType::SignatureKey {+ api_key,+ key1,+ api_secret,+ } => Ok(Self::SignatureKey {+ api_key: api_key.clone(),+ key1: key1.clone(),+ api_secret: api_secret.clone(),+ }),ConnectorAuthType::CertificateAuth {certificate,private_key,@@ -812,15 +826,16 @@ pub struct ThreeDsAuthDetails {pub acs_trans_id: String,pub acs_reference_number: String,pub acs_operator_id: Option<String>,- pub ds_reference_number: String,+ pub ds_reference_number: Option<String>,pub ds_trans_id: String,pub sdk_trans_id: Option<String>,pub trans_status: common_enums::TransactionStatus,pub acs_challenge_mandated: Option<ACSChallengeMandatedEnum>,- pub message_type: String,- pub message_version: String,+ pub message_type: Option<String>,+ pub message_version: Option<String>,pub acs_url: Option<url::Url>,pub challenge_request: Option<String>,+ pub challenge_request_key: Option<String>,pub acs_signed_content: Option<String>,pub authentication_value: Option<Secret<String>>,pub eci: Option<String>,@@ -962,16 +977,16 @@ impl<F, T>) -> Result<Self, Self::Error> {let response = match item.response {UnifiedAuthenticationServiceAuthenticateResponse::Success(auth_response) => {- let authn_flow_type = match auth_response- .three_ds_auth_response- .acs_challenge_mandated- {- Some(ACSChallengeMandatedEnum::Y) => {+ let authn_flow_type = match auth_response.three_ds_auth_response.trans_status {+ common_enums::TransactionStatus::ChallengeRequired => {AuthNFlowType::Challenge(Box::new(ChallengeParams {acs_url: auth_response.three_ds_auth_response.acs_url.clone(),challenge_request: auth_response.three_ds_auth_response.challenge_request,+ challenge_request_key: auth_response+ .three_ds_auth_response+ .challenge_request_key,acs_reference_number: Some(auth_response.three_ds_auth_response.acs_reference_number,),@@ -986,7 +1001,7 @@ impl<F, T>.acs_signed_content,}))}- Some(ACSChallengeMandatedEnum::N) | None => AuthNFlowType::Frictionless,+ _ => AuthNFlowType::Frictionless,};Ok(UasAuthenticationResponseData::Authentication {authentication_details: hyperswitch_domain_models::router_request_types::unified_authentication_service::AuthenticationDetails {diff --git a/crates/hyperswitch_domain_models/src/connector_endpoints.rs b/crates/hyperswitch_domain_models/src/connector_endpoints.rsindex a9f5929c5f..1565d9240c 100644--- a/crates/hyperswitch_domain_models/src/connector_endpoints.rs+++ b/crates/hyperswitch_domain_models/src/connector_endpoints.rs@@ -74,6 +74,7 @@ pub struct Connectors {pub itaubank: ConnectorParams,pub jpmorgan: ConnectorParams,pub juspaythreedsserver: ConnectorParams,+ pub cardinal: NoParams,pub katapult: ConnectorParams,pub klarna: ConnectorParams,pub mifinity: ConnectorParams,diff --git a/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs b/crates/hyperswitch_domain_models/src/router_request_types/authentication.rsindex 1c6977ac5c..9e9f4712f2 100644--- a/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs+++ b/crates/hyperswitch_domain_models/src/router_request_types/authentication.rs@@ -13,6 +13,7 @@ use crate::{pub struct ChallengeParams {pub acs_url: Option<url::Url>,pub challenge_request: Option<String>,+ pub challenge_request_key: Option<String>,pub acs_reference_number: Option<String>,pub acs_trans_id: Option<String>,pub three_dsserver_trans_id: Option<String>,@@ -40,6 +41,13 @@ impl AuthNFlowType {None}}+ pub fn get_challenge_request_key(&self) -> Option<String> {+ if let Self::Challenge(challenge_params) = self {+ challenge_params.challenge_request_key.clone()+ } else {+ None+ }+ }pub fn get_acs_reference_number(&self) -> Option<String> {if let Self::Challenge(challenge_params) = self {challenge_params.acs_reference_number.clone()diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rsindex 70b7fd3f75..724eb91521 100644--- a/crates/router/src/consts.rs+++ b/crates/router/src/consts.rs@@ -329,3 +329,6 @@ pub const UCS_AUTH_HEADER_KEY: &str = "header-key";/// Header value indicating that currency-auth-key-based authentication is used.pub const UCS_AUTH_CURRENCY_AUTH_KEY: &str = "currency-auth-key";++/// Form field name for challenge request during creq submission+pub const CREQ_CHALLENGE_REQUEST_KEY: &str = "creq";diff --git a/crates/router/src/core/authentication/utils.rs b/crates/router/src/core/authentication/utils.rsindex e1f9b02c88..129de31dbc 100644--- a/crates/router/src/core/authentication/utils.rs+++ b/crates/router/src/core/authentication/utils.rs@@ -128,6 +128,7 @@ pub async fn update_trackers<F: Clone, Req>(trans_status,acs_url: authn_flow_type.get_acs_url(),challenge_request: authn_flow_type.get_challenge_request(),+ challenge_request_key: authn_flow_type.get_challenge_request_key(),acs_reference_number: authn_flow_type.get_acs_reference_number(),acs_trans_id: authn_flow_type.get_acs_trans_id(),acs_signed_content: authn_flow_type.get_acs_signed_content(),@@ -274,6 +275,7 @@ pub async fn create_new_authentication(three_ds_method_url: None,acs_url: None,challenge_request: None,+ challenge_request_key: None,acs_reference_number: None,acs_trans_id: None,acs_signed_content: None,diff --git a/crates/router/src/core/connector_validation.rs b/crates/router/src/core/connector_validation.rsindex 1c689f4eef..29e13cfd37 100644--- a/crates/router/src/core/connector_validation.rs+++ b/crates/router/src/core/connector_validation.rs@@ -155,6 +155,7 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {breadpay::transformers::BreadpayAuthType::try_from(self.auth_type)?;Ok(())}+ api_enums::Connector::Cardinal => Ok(()),api_enums::Connector::Cashtocode => {cashtocode::transformers::CashtocodeAuthType::try_from(self.auth_type)?;Ok(())diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rsindex 3442a34be7..56db1b8d08 100644--- a/crates/router/src/core/payments.rs+++ b/crates/router/src/core/payments.rs@@ -10228,6 +10228,10 @@ pub async fn payment_external_authentication<F: Clone + Sync>(.as_ref().map(ToString::to_string),challenge_request: authentication_response.challenge_request,+ // If challenge_request_key is None, we send "creq" as a static value which is standard 3DS challenge form field name+ challenge_request_key: authentication_response+ .challenge_request_key+ .or(Some(consts::CREQ_CHALLENGE_REQUEST_KEY.to_string())),acs_reference_number: authentication_response.acs_reference_number,acs_trans_id: authentication_response.acs_trans_id,three_dsserver_trans_id: authentication_response.three_dsserver_trans_id,diff --git a/crates/router/src/core/unified_authentication_service.rs b/crates/router/src/core/unified_authentication_service.rsindex b9e209bc9b..77ee841528 100644--- a/crates/router/src/core/unified_authentication_service.rs+++ b/crates/router/src/core/unified_authentication_service.rs@@ -587,6 +587,7 @@ pub async fn create_new_authentication(three_ds_method_url: None,acs_url: None,challenge_request: None,+ challenge_request_key: None,acs_reference_number: None,acs_trans_id: None,acs_signed_content: None,diff --git a/crates/router/src/core/unified_authentication_service/utils.rs b/crates/router/src/core/unified_authentication_service/utils.rsindex 387e642953..3842370f5c 100644--- a/crates/router/src/core/unified_authentication_service/utils.rs+++ b/crates/router/src/core/unified_authentication_service/utils.rs@@ -223,6 +223,9 @@ pub async fn external_authentication_update_trackers<F: Clone, Req>(challenge_request: authentication_details.authn_flow_type.get_challenge_request(),+ challenge_request_key: authentication_details+ .authn_flow_type+ .get_challenge_request_key(),acs_reference_number: authentication_details.authn_flow_type.get_acs_reference_number(),diff --git a/crates/router/src/db/authentication.rs b/crates/router/src/db/authentication.rsindex 74600d4284..12b173d35a 100644--- a/crates/router/src/db/authentication.rs+++ b/crates/router/src/db/authentication.rs@@ -146,6 +146,7 @@ impl AuthenticationInterface for MockDb {three_ds_method_url: authentication.three_ds_method_url,acs_url: authentication.acs_url,challenge_request: authentication.challenge_request,+ challenge_request_key: authentication.challenge_request_key,acs_reference_number: authentication.acs_reference_number,acs_trans_id: authentication.acs_trans_id,acs_signed_content: authentication.acs_signed_content,diff --git a/crates/router/src/types/api/authentication.rs b/crates/router/src/types/api/authentication.rsindex 5d40eca13a..3322424ed4 100644--- a/crates/router/src/types/api/authentication.rs+++ b/crates/router/src/types/api/authentication.rs@@ -27,6 +27,7 @@ pub struct AuthenticationResponse {pub trans_status: common_enums::TransactionStatus,pub acs_url: Option<url::Url>,pub challenge_request: Option<String>,+ pub challenge_request_key: Option<String>,pub acs_reference_number: Option<String>,pub acs_trans_id: Option<String>,pub three_dsserver_trans_id: Option<String>,@@ -51,6 +52,7 @@ impl TryFrom<storage::Authentication> for AuthenticationResponse {acs_trans_id: authentication.acs_trans_id,three_dsserver_trans_id: authentication.threeds_server_transaction_id,acs_signed_content: authentication.acs_signed_content,+ challenge_request_key: authentication.challenge_request_key,})}}@@ -105,6 +107,9 @@ impl AuthenticationConnectorData {enums::AuthenticationConnectors::Juspaythreedsserver => Ok(ConnectorEnum::Old(Box::new(connector::Juspaythreedsserver::new()),)),+ enums::AuthenticationConnectors::Cardinal => Ok(ConnectorEnum::Old(Box::new(+ connector::UnifiedAuthenticationService::new(),+ ))),}}}diff --git a/crates/router/src/types/api/connector_mapping.rs b/crates/router/src/types/api/connector_mapping.rsindex 400a13407e..adef987b03 100644--- a/crates/router/src/types/api/connector_mapping.rs+++ b/crates/router/src/types/api/connector_mapping.rs@@ -465,6 +465,7 @@ impl ConnectorData {| enums::Connector::Riskified| enums::Connector::Gpayments| enums::Connector::Threedsecureio+ | enums::Connector::Cardinal| enums::Connector::Taxjar => {Err(report!(errors::ConnectorError::InvalidConnectorName).attach_printable(format!("invalid connector name: {connector_name}")))diff --git a/crates/router/src/types/api/feature_matrix.rs b/crates/router/src/types/api/feature_matrix.rsindex 7290acb121..bad9c07fe2 100644--- a/crates/router/src/types/api/feature_matrix.rs+++ b/crates/router/src/types/api/feature_matrix.rs@@ -398,6 +398,11 @@ impl FeatureMatrixConnectorData {enums::Connector::Taxjar => {Ok(ConnectorEnum::Old(Box::new(connector::Taxjar::new())))}+ enums::Connector::Cardinal => {+ Err(report!(errors::ConnectorError::InvalidConnectorName)+ .attach_printable(format!("invalid connector name: {connector_name}")))+ .change_context(errors::ApiErrorResponse::InternalServerError)+ }},Err(_) => Err(report!(errors::ConnectorError::InvalidConnectorName).attach_printable(format!("invalid connector name: {connector_name}")))diff --git a/crates/router/src/types/connector_transformers.rs b/crates/router/src/types/connector_transformers.rsindex f931e1a0a8..ee9ec93c5a 100644--- a/crates/router/src/types/connector_transformers.rs+++ b/crates/router/src/types/connector_transformers.rs@@ -28,6 +28,11 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {api_enums::Connector::Boku => Self::Boku,api_enums::Connector::Braintree => Self::Braintree,api_enums::Connector::Breadpay => Self::Breadpay,+ api_enums::Connector::Cardinal => {+ Err(common_utils::errors::ValidationError::InvalidValue {+ message: "cardinal is not a routable connector".to_string(),+ })?+ }api_enums::Connector::Cashtocode => Self::Cashtocode,api_enums::Connector::Celero => Self::Celero,api_enums::Connector::Chargebee => Self::Chargebee,diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rsindex 6793f54a8d..9703b6a2c9 100644--- a/crates/test_utils/src/connector_auth.rs+++ b/crates/test_utils/src/connector_auth.rs@@ -33,6 +33,7 @@ pub struct ConnectorAuthentication {pub bluesnap: Option<BodyKey>,pub boku: Option<BodyKey>,pub breadpay: Option<BodyKey>,+ pub cardinal: Option<SignatureKey>,pub cashtocode: Option<BodyKey>,pub celero: Option<HeaderKey>,pub chargebee: Option<HeaderKey>,diff --git a/migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/down.sql b/migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/down.sqlnew file mode 100644index 0000000000..a61df55ead--- /dev/null+++ b/migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/down.sql@@ -0,0 +1,2 @@+-- This file should undo anything in `up.sql`+ALTER TABLE authentication DROP COLUMN IF EXISTS challenge_request_key;\ No newline at end of filediff --git a/migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/up.sql b/migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/up.sqlnew file mode 100644index 0000000000..51c3fa0d2a--- /dev/null+++ b/migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/up.sql@@ -0,0 +1,2 @@+-- Your SQL goes here+ALTER TABLE authentication ADD COLUMN IF NOT EXISTS challenge_request_key VARCHAR(255);