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(core): Added TLID Support in UCS mandate request (#13201)

Shubhodip palaa8d7c3ea7bf
diff --git a/Cargo.lock b/Cargo.lock
index 553144686f..7225daf17e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2264,7 +2264,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"
+source = "git+https://github.com/juspay/connector-service?tag=2026.07.07.2#138c16e1c473cdfc0f74a685a00bde7c6e9a5f21"
dependencies = [
"proc-macro2",
"quote",
@@ -3982,7 +3982,7 @@ checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57"
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"
+source = "git+https://github.com/juspay/connector-service?tag=2026.07.07.2#138c16e1c473cdfc0f74a685a00bde7c6e9a5f21"
dependencies = [
"axum 0.8.4",
"bytes 1.10.1",
@@ -8178,7 +8178,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"
+source = "git+https://github.com/juspay/connector-service?tag=2026.07.07.2#138c16e1c473cdfc0f74a685a00bde7c6e9a5f21"
dependencies = [
"grpc-api-types",
]
@@ -11012,7 +11012,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"
+source = "git+https://github.com/juspay/connector-service?tag=2026.07.07.2#138c16e1c473cdfc0f74a685a00bde7c6e9a5f21"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
@@ -11028,7 +11028,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"
+source = "git+https://github.com/juspay/connector-service?tag=2026.07.07.2#138c16e1c473cdfc0f74a685a00bde7c6e9a5f21"
dependencies = [
"serde",
"strum 0.26.3",
@@ -11039,7 +11039,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"
+source = "git+https://github.com/juspay/connector-service?tag=2026.07.07.2#138c16e1c473cdfc0f74a685a00bde7c6e9a5f21"
dependencies = [
"anyhow",
"base64 0.21.7",
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 494b6674b0..23b969138c 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -82,7 +82,7 @@ http = "0.2.12"
url = { version = "2.5.4", features = ["serde"] }
quick-xml = { version = "0.31.0", features = ["serialize"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.02.1", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.07.2", package = "rust-grpc-client" }
open-feature = { version = "0.2.5", optional = true }
superposition_provider = { version = "0.114.0", optional = true}
superposition_types = "0.114.0"
diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml
index 852614bb05..e125a87101 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -33,7 +33,7 @@ time = "0.3.41"
tonic = "0.14"
url = { version = "2.5.4", features = ["serde"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.02.1", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.07.2", package = "rust-grpc-client" }
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
# First party crates
diff --git a/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs b/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs
index c03abbd642..e1f909d828 100644
--- a/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs
+++ b/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs
@@ -490,7 +490,14 @@ impl ForeignTryFrom<(payments_grpc::PaymentServiceGetResponse, AttemptStatus)>
.map(ForeignTryFrom::foreign_try_from)
.transpose()?,
),
- mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
+ mandate_reference: Box::new(
+ response
+ .mandate_reference_details
+ .map(
+ hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from,
+ )
+ .transpose()?,
+ ),
connector_metadata,
network_txn_id: response.network_transaction_id.clone(),
network_txn_link_id: response.network_txn_link_id.clone(),
@@ -507,25 +514,31 @@ impl ForeignTryFrom<(payments_grpc::PaymentServiceGetResponse, AttemptStatus)>
}
}
-impl ForeignTryFrom<payments_grpc::MandateReference>
+impl ForeignTryFrom<payments_grpc::MandateReferenceDetails>
for hyperswitch_domain_models::router_response_types::MandateReference
{
type Error = error_stack::Report<UnifiedConnectorServiceError>;
- fn foreign_try_from(value: payments_grpc::MandateReference) -> Result<Self, Self::Error> {
- match value.mandate_id_type {
- Some(payments_grpc::mandate_reference::MandateIdType::ConnectorMandateId(
- connector_mandate_id,
- )) => Ok(Self {
- connector_mandate_id: connector_mandate_id.connector_mandate_id,
- payment_method_id: connector_mandate_id.payment_method_id,
- mandate_metadata: None,
- connector_mandate_request_reference_id: connector_mandate_id
- .connector_mandate_request_reference_id,
- }),
- _ => Err(UnifiedConnectorServiceError::ResponseDeserializationFailed)
- .attach_printable("Recieved Invalid MandateReference from UCS"),
- }
+ fn foreign_try_from(
+ value: payments_grpc::MandateReferenceDetails,
+ ) -> Result<Self, Self::Error> {
+ let mandate_metadata = value
+ .mandate_metadata
+ .map(|metadata| {
+ let raw = metadata.expose();
+ serde_json::from_str::<serde_json::Value>(&raw)
+ .map(hyperswitch_masking::Secret::new)
+ .change_context(UnifiedConnectorServiceError::ResponseDeserializationFailed)
+ .attach_printable("Failed to deserialize UCS mandate_metadata")
+ })
+ .transpose()?;
+
+ Ok(Self {
+ connector_mandate_id: value.connector_mandate_id,
+ payment_method_id: value.payment_method_id,
+ mandate_metadata,
+ connector_mandate_request_reference_id: value.connector_mandate_request_reference_id,
+ })
}
}
@@ -970,6 +983,12 @@ impl ForeignTryFrom<payments_grpc::RedirectForm> for RedirectForm {
)
.into(),
),
+ Some(payments_grpc::redirect_form::FormType::HostedIframe(_)) => Err(
+ UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
+ "Hosted iframe form type is not implemented".to_string(),
+ )
+ .into(),
+ ),
Some(payments_grpc::redirect_form::FormType::Braintree(braintree)) => {
Ok(Self::Braintree {
client_token: braintree.client_token,
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 76137a8030..b207e0b5e0 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -91,8 +91,8 @@ ring = "0.17.14"
rust_decimal = { version = "1.37.1", features = ["serde-with-float", "serde-with-str"] }
rust-i18n = { git = "https://github.com/kashif-m/rust-i18n", rev = "f2d8096aaaff7a87a847c35a5394c269f75e077a" }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.02.1", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.07.02.1", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.07.2", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.07.07.2", package = "ucs_cards" }
rustc-hash = "1.1.0"
rustls = "0.22"
rustls-pemfile = "2"
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 07015f005c..4615948918 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -843,6 +843,9 @@ impl ForeignFrom<&mandates::ConnectorMandateReferenceId>
payment_method_id: value.get_payment_method_id(),
connector_mandate_request_reference_id: value
.get_connector_mandate_request_reference_id(),
+ mandate_metadata: value.get_mandate_metadata().map(|mandate_metadata| {
+ Secret::new(serde_json::to_string(&mandate_metadata.expose()).unwrap_or_default())
+ }),
}
}
}
@@ -877,6 +880,15 @@ impl ForeignFrom<&RouterData<PSync, PaymentsSyncData, PaymentsResponseData>>
connector_mandate_id,
payment_method_id,
connector_mandate_request_reference_id,
+ mandate_metadata: structured
+ .and_then(|connector_mandate_reference_id| {
+ connector_mandate_reference_id.get_mandate_metadata()
+ })
+ .map(|mandate_metadata| {
+ Secret::new(
+ serde_json::to_string(&mandate_metadata.expose()).unwrap_or_default(),
+ )
+ }),
})
}
}
@@ -1054,6 +1066,7 @@ impl
.transpose()?,
connector_feature_data: None,
capture_method: capture_method.map(|capture_method| capture_method.into()),
+ webhook_url: None,
})
}
}
@@ -1238,6 +1251,7 @@ impl
connector_feature_data: None,
capture_method: capture_method.map(|capture_method| capture_method.into()),
description: router_data.description.clone(),
+ merchant_transaction_id: None,
})
}
}
@@ -2028,6 +2042,14 @@ impl
payment_method_id: connector_mandate_id.get_payment_method_id(),
connector_mandate_request_reference_id: connector_mandate_id
.get_connector_mandate_request_reference_id(),
+ mandate_metadata: connector_mandate_id
+ .get_mandate_metadata()
+ .map(|mandate_metadata| {
+ Secret::new(
+ serde_json::to_string(&mandate_metadata.expose())
+ .unwrap_or_default(),
+ )
+ }),
},
),
),
@@ -2037,7 +2059,14 @@ impl
Some(payments_grpc::MandateReference {
mandate_id_type: Some(
payments_grpc::mandate_reference::MandateIdType::NetworkMandateId(
- network_mandate_id.network_transaction_id.clone(),
+ payments_grpc::NetworkMandateId {
+ network_transaction_id: network_mandate_id
+ .network_transaction_id
+ .clone(),
+ transaction_link_id: network_mandate_id
+ .transaction_link_id
+ .clone(),
+ },
),
),
})
@@ -2058,6 +2087,9 @@ impl
.token_exp_year
.clone()
.map(|exp| exp.expose().into()),
+ transaction_link_id: network_token_with_nti
+ .transaction_link_id
+ .clone(),
},
),
),
@@ -2660,7 +2692,7 @@ impl
PaymentsResponseData::TransactionResponse {
resource_id: connector_transaction_id,
redirection_data: Box::new(redirection_data),
- mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
+ mandate_reference: Box::new(response.mandate_reference_details.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
connector_metadata,
network_txn_id: response.network_transaction_id.clone(),
network_txn_link_id: response.network_txn_link_id.clone(),
@@ -2767,7 +2799,7 @@ impl transformers::ForeignTryFrom<(payments_grpc::PaymentServiceCaptureResponse,
PaymentsResponseData::TransactionResponse {
resource_id: connector_transaction_id,
redirection_data: Box::new(None),
- mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
+ mandate_reference: Box::new(response.mandate_reference_details.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
connector_metadata,
network_txn_id: None,
network_txn_link_id: None,
@@ -2961,7 +2993,7 @@ impl
.map(RedirectForm::foreign_try_from)
.transpose()?,
),
- mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
+ mandate_reference: Box::new(response.mandate_reference_details.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
connector_metadata,
network_txn_id: response.network_transaction_id,
network_txn_link_id: None,
@@ -3077,7 +3109,7 @@ impl
PaymentsResponseData::TransactionResponse {
resource_id: connector_transaction_id,
redirection_data: Box::new(None),
- mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
+ mandate_reference: Box::new(response.mandate_reference_details.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
connector_metadata,
network_txn_id: response.network_transaction_id.clone(),
network_txn_link_id: None,
@@ -5763,6 +5795,14 @@ impl transformers::ForeignTryFrom<&MandateData> for payments_grpc::SetupMandateD
dt.assume_utc().unix_timestamp()
},
),
+ initial_billing_amount: None,
+ external_subscription_id: None,
+ billing_cycle: None,
+ description: None,
+ next_billing_date: None,
+ // Hyperswitch setup-mandate requests do not carry mandate status.
+ mandate_status: payments_grpc::MandateStatus::Unspecified
+ .into(),
},
),
),
@@ -5799,6 +5839,14 @@ impl transformers::ForeignTryFrom<&MandateData> for payments_grpc::SetupMandateD
dt.assume_utc().unix_timestamp()
},
),
+ initial_billing_amount: None,
+ external_subscription_id: None,
+ billing_cycle: None,
+ description: None,
+ next_billing_date: None,
+ // Hyperswitch setup-mandate requests do not carry mandate status.
+ mandate_status:
+ payments_grpc::MandateStatus::Unspecified.into(),
},
),
)
@@ -6513,7 +6561,7 @@ impl transformers::ForeignTryFrom<(payments_grpc::PaymentServiceVoidResponse, At
PaymentsResponseData::TransactionResponse {
resource_id: connector_transaction_id,
redirection_data: Box::new(None),
- mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
+ mandate_reference: Box::new(response.mandate_reference_details.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
connector_metadata,
network_txn_id: None,
network_txn_link_id: None,