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(router): render Barclaycard 3DS DDC/step-up forms correctly via UCS (#12988)

Tushar Shukla292c11e23e05
diff --git a/config/config.example.toml b/config/config.example.toml
index 3cd152cd4f..52b4935092 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -1342,7 +1342,7 @@ url = "http://localhost:8080" # Open Router URL
[grpc_client.unified_connector_service]
base_url = "http://localhost:8000" # Unified Connector Service Base URL
connection_timeout = 10 # Connection Timeout Duration in Seconds
-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, dlocal" # Comma-separated list of connectors that use UCS only
+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, dlocal, barclaycard" # Comma-separated list of connectors that use UCS only
ucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call
[grpc_client.recovery_decider_client] # Revenue recovery client base url
diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml
index c77ffea7dc..58555ce785 100644
--- a/config/deployments/env_specific.toml
+++ b/config/deployments/env_specific.toml
@@ -412,7 +412,7 @@ payment_method = "payment_method_types" # <payment_method> = comma-separated clo
[grpc_client.unified_connector_service]
base_url = "http://localhost:8000" # Unified Connector Service Base URL
connection_timeout = 10 # Connection Timeout Duration in Seconds
-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal" # Comma-separated list of connectors that use UCS only
+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard" # Comma-separated list of connectors that use UCS only
ucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call
[revenue_recovery]
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 09769f26cb..5aecded3f7 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -1022,7 +1022,7 @@ connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"
connector_list = "worldpayvantiv"
[grpc_client.unified_connector_service]
-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal" # Comma-separated list of connectors that use UCS only
+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard" # Comma-separated list of connectors that use UCS only
ucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call
# Merchant Advice Code Configuration
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index 40c1f8223b..ec6ea29277 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -1030,7 +1030,7 @@ click_to_pay = {connector_list = "adyen, cybersource, trustpay"}
connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"
[grpc_client.unified_connector_service]
-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal" # Comma-separated list of connectors that use UCS only
+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard" # Comma-separated list of connectors that use UCS only
ucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call
# Merchant Advice Code Configuration
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index e76551d4cb..7725e93867 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -1041,7 +1041,7 @@ connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"
connector_list = "worldpayvantiv"
[grpc_client.unified_connector_service]
-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal" # Comma-separated list of connectors that use UCS only
+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard" # Comma-separated list of connectors that use UCS only
ucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call
# Merchant Advice Code Configuration
diff --git a/config/development.toml b/config/development.toml
index 61580f4bf3..4c74d2d705 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -1487,7 +1487,7 @@ enabled = "true"
[grpc_client.unified_connector_service]
base_url = "http://localhost:8000"
connection_timeout = 10
-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal" # Comma-separated list of connectors that use UCS only
+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard" # Comma-separated list of connectors that use UCS only
ucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call
[revenue_recovery]
diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs
index 3745e6564a..32e72bbdef 100644
--- a/crates/router/src/core/payments/flows/authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/authorize_flow.rs
@@ -1373,7 +1373,8 @@ fn transform_redirection_response_for_pre_authenticate_flow(
> {
match (connector, &response_data) {
(
- enums::connector_enums::Connector::Cybersource,
+ enums::connector_enums::Connector::Cybersource
+ | enums::connector_enums::Connector::Barclaycard,
router_response_types::RedirectForm::Form {
endpoint,
method: _,
@@ -1391,11 +1392,24 @@ fn transform_redirection_response_for_pre_authenticate_flow(
field_name: "reference_id",
},
)?;
- Ok(router_response_types::RedirectForm::CybersourceAuthSetup {
- access_token,
- ddc_url,
- reference_id,
- })
+
+ match connector {
+ enums::connector_enums::Connector::Barclaycard => {
+ Ok(router_response_types::RedirectForm::BarclaycardAuthSetup {
+ access_token,
+ ddc_url,
+ reference_id,
+ })
+ }
+ enums::connector_enums::Connector::Cybersource => {
+ Ok(router_response_types::RedirectForm::CybersourceAuthSetup {
+ access_token,
+ ddc_url,
+ reference_id,
+ })
+ }
+ _ => Ok(response_data),
+ }
}
_ => Ok(response_data),
}
@@ -1409,7 +1423,8 @@ fn transform_response_for_pre_authenticate_flow(
> {
match (connector, response_data.clone()) {
(
- enums::connector_enums::Connector::Cybersource,
+ enums::connector_enums::Connector::Cybersource
+ | enums::connector_enums::Connector::Barclaycard,
router_response_types::PaymentsResponseData::TransactionResponse {
resource_id,
redirection_data,
diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
index 2430c3e745..b074298f14 100644
--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
@@ -662,7 +662,7 @@ fn transform_redirection_response_for_authenticate_flow(
> {
match (connector, &response_data) {
(
- connector_enums::Connector::Cybersource,
+ connector_enums::Connector::Cybersource | connector_enums::Connector::Barclaycard,
router_response_types::RedirectForm::Form {
endpoint,
method: _,
@@ -675,12 +675,21 @@ fn transform_redirection_response_for_authenticate_flow(
},
)?;
let step_up_url = form_fields.get("step_up_url").unwrap_or(endpoint).clone();
- Ok(
- router_response_types::RedirectForm::CybersourceConsumerAuth {
- access_token,
- step_up_url,
- },
- )
+ match connector {
+ connector_enums::Connector::Barclaycard => Ok(
+ router_response_types::RedirectForm::BarclaycardConsumerAuth {
+ access_token,
+ step_up_url,
+ },
+ ),
+ connector_enums::Connector::Cybersource => Ok(
+ router_response_types::RedirectForm::CybersourceConsumerAuth {
+ access_token,
+ step_up_url,
+ },
+ ),
+ _ => Ok(response_data),
+ }
}
_ => Ok(response_data),
}
@@ -694,7 +703,7 @@ fn transform_response_for_authenticate_flow(
> {
match (connector, response_data.clone()) {
(
- connector_enums::Connector::Cybersource,
+ connector_enums::Connector::Cybersource | connector_enums::Connector::Barclaycard,
router_response_types::PaymentsResponseData::TransactionResponse {
resource_id,
redirection_data,