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
fix: Connector Metadata Extraction for Void and Capture in HS<>UCS tunnel (#10234)
Amitsingh Tanwar8675bfa0fbf4
diff --git a/Cargo.lock b/Cargo.lockindex a81ff4fe0d..a5a0c40443 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -3789,7 +3789,7 @@ dependencies = [[[package]]name = "grpc-api-types"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?rev=77eaaa6344de9657c83a65ed0d619f48dff0c4a5#77eaaa6344de9657c83a65ed0d619f48dff0c4a5"+source = "git+https://github.com/juspay/connector-service?rev=ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6#ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6"dependencies = ["axum 0.8.4","error-stack 0.5.0",@@ -7427,7 +7427,7 @@ dependencies = [[[package]]name = "rust-grpc-client"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?rev=77eaaa6344de9657c83a65ed0d619f48dff0c4a5#77eaaa6344de9657c83a65ed0d619f48dff0c4a5"+source = "git+https://github.com/juspay/connector-service?rev=ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6#ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6"dependencies = ["grpc-api-types",]@@ -10217,7 +10217,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"[[package]]name = "ucs_cards"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?rev=77eaaa6344de9657c83a65ed0d619f48dff0c4a5#77eaaa6344de9657c83a65ed0d619f48dff0c4a5"+source = "git+https://github.com/juspay/connector-service?rev=ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6#ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6"dependencies = ["bytes 1.10.1","error-stack 0.4.1",@@ -10233,7 +10233,7 @@ dependencies = [[[package]]name = "ucs_common_enums"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?rev=77eaaa6344de9657c83a65ed0d619f48dff0c4a5#77eaaa6344de9657c83a65ed0d619f48dff0c4a5"+source = "git+https://github.com/juspay/connector-service?rev=ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6#ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6"dependencies = ["serde","strum 0.26.3",@@ -10244,7 +10244,7 @@ dependencies = [[[package]]name = "ucs_common_utils"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?rev=77eaaa6344de9657c83a65ed0d619f48dff0c4a5#77eaaa6344de9657c83a65ed0d619f48dff0c4a5"+source = "git+https://github.com/juspay/connector-service?rev=ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6#ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6"dependencies = ["anyhow","base64 0.21.7",diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.tomlindex b6fbef2e57..ee0e414868 100644--- a/crates/external_services/Cargo.toml+++ b/crates/external_services/Cargo.toml@@ -69,7 +69,7 @@ reqwest = { version = "0.11.27", features = ["rustls-tls"] }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", rev = "77eaaa6344de9657c83a65ed0d619f48dff0c4a5", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6", package = "rust-grpc-client" }open-feature = { version = "0.2.5", optional = true }superposition_provider = { version = "0.88.1", optional = true }diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.tomlindex af43d590a9..98c64880e6 100644--- a/crates/hyperswitch_interfaces/Cargo.toml+++ b/crates/hyperswitch_interfaces/Cargo.toml@@ -29,7 +29,7 @@ serde_json = "1.0.140"strum = { version = "0.26", features = ["derive"] }thiserror = "1.0.69"time = "0.3.41"-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "77eaaa6344de9657c83a65ed0d619f48dff0c4a5", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6", package = "rust-grpc-client" }unified-connector-service-masking = { git = "https://github.com/juspay/hyperswitch", tag = "2025.09.24.0", package = "masking" }tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }# First party cratesdiff --git a/crates/router/Cargo.toml b/crates/router/Cargo.tomlindex 3783f13adc..262362ca25 100644--- a/crates/router/Cargo.toml+++ b/crates/router/Cargo.toml@@ -89,8 +89,8 @@ reqwest = { version = "0.11.27", features = ["json", "rustls-tls", "gzip", "multring = "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", rev = "77eaaa6344de9657c83a65ed0d619f48dff0c4a5", package = "rust-grpc-client" }-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "77eaaa6344de9657c83a65ed0d619f48dff0c4a5", package = "ucs_cards" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6", package = "rust-grpc-client" }+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "ec91d1b92127e29d3be4fa0f3ec5e74a723ea0e6", package = "ucs_cards" }unified-connector-service-masking = { git = "https://github.com/juspay/hyperswitch", tag = "2025.09.24.0", package = "masking" }rustc-hash = "1.1.0"rustls = "0.22"diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rsindex e340a1b3d5..d4fe7b6f7e 100644--- a/crates/router/src/core/unified_connector_service/transformers.rs+++ b/crates/router/src/core/unified_connector_service/transformers.rs@@ -1435,6 +1435,22 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceCaptureResponse>}};+ // Extract connector_metadata from response if present+ let connector_metadata = (!response.connector_metadata.is_empty())+ .then(|| {+ serde_json::to_value(&response.connector_metadata)+ .map_err(|e| {+ tracing::warn!(+ serialization_error=?e,+ metadata=?response.connector_metadata,+ "Failed to serialize connector_metadata from UCS capture response"+ );+ e+ })+ .ok()+ })+ .flatten();+let response = if response.error_code.is_some() {let attempt_status = match response.status() {payments_grpc::PaymentStatus::AttemptStatusUnspecified => None,@@ -1466,7 +1482,7 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceCaptureResponse>connector_mandate_request_reference_id: None,}})),- connector_metadata: None,+ connector_metadata,network_txn_id: None,connector_response_reference_id,incremental_authorization_allowed: response.incremental_authorization_allowed,@@ -2817,6 +2833,22 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceVoidResponse>let status_code = convert_connector_service_status_code(response.status_code)?;+ // Extract connector_metadata from response if present+ let connector_metadata = (!response.connector_metadata.is_empty())+ .then(|| {+ serde_json::to_value(&response.connector_metadata)+ .map_err(|e| {+ tracing::warn!(+ serialization_error=?e,+ metadata=?response.connector_metadata,+ "Failed to serialize connector_metadata from UCS void response"+ );+ e+ })+ .ok()+ })+ .flatten();+let response = if response.error_code.is_some() {let attempt_status = match response.status() {payments_grpc::PaymentStatus::AttemptStatusUnspecified => None,@@ -2875,7 +2907,7 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceVoidResponse>connector_mandate_request_reference_id: None,}})),- connector_metadata: None,+ connector_metadata,network_txn_id: None,connector_response_reference_id,incremental_authorization_allowed: response.incremental_authorization_allowed,