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: payment method population in pyament_method_token (#10843)

Tushar Shuklab12c98d2d576
diff --git a/Cargo.lock b/Cargo.lock
index b29bbe84f6..975bf3d602 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2129,7 +2129,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3ec2e503a9ba12391f96935fcb7aa24d4d6aa452#3ec2e503a9ba12391f96935fcb7aa24d4d6aa452"
+source = "git+https://github.com/juspay/connector-service?rev=1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37#1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37"
dependencies = [
"proc-macro2",
"quote",
@@ -3800,7 +3800,7 @@ dependencies = [
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3ec2e503a9ba12391f96935fcb7aa24d4d6aa452#3ec2e503a9ba12391f96935fcb7aa24d4d6aa452"
+source = "git+https://github.com/juspay/connector-service?rev=1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37#1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37"
dependencies = [
"axum 0.8.4",
"error-stack 0.5.0",
@@ -5842,6 +5842,15 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
+[[package]]
+name = "openssl-src"
+version = "300.5.4+3.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72"
+dependencies = [
+ "cc",
+]
+
[[package]]
name = "openssl-sys"
version = "0.9.108"
@@ -5850,6 +5859,7 @@ checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847"
dependencies = [
"cc",
"libc",
+ "openssl-src",
"pkg-config",
"vcpkg",
]
@@ -7463,7 +7473,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3ec2e503a9ba12391f96935fcb7aa24d4d6aa452#3ec2e503a9ba12391f96935fcb7aa24d4d6aa452"
+source = "git+https://github.com/juspay/connector-service?rev=1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37#1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37"
dependencies = [
"grpc-api-types",
]
@@ -10253,7 +10263,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3ec2e503a9ba12391f96935fcb7aa24d4d6aa452#3ec2e503a9ba12391f96935fcb7aa24d4d6aa452"
+source = "git+https://github.com/juspay/connector-service?rev=1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37#1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
@@ -10269,7 +10279,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3ec2e503a9ba12391f96935fcb7aa24d4d6aa452#3ec2e503a9ba12391f96935fcb7aa24d4d6aa452"
+source = "git+https://github.com/juspay/connector-service?rev=1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37#1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37"
dependencies = [
"serde",
"strum 0.26.3",
@@ -10280,7 +10290,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3ec2e503a9ba12391f96935fcb7aa24d4d6aa452#3ec2e503a9ba12391f96935fcb7aa24d4d6aa452"
+source = "git+https://github.com/juspay/connector-service?rev=1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37#1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37"
dependencies = [
"anyhow",
"base64 0.21.7",
@@ -10295,6 +10305,7 @@ dependencies = [
"md5",
"nanoid",
"once_cell",
+ "openssl",
"quick-xml",
"rand 0.8.5",
"regex",
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 737e4b968d..a5629c290b 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 = "3ec2e503a9ba12391f96935fcb7aa24d4d6aa452", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37", 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.toml
index 21135b0848..ed221cf258 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -30,7 +30,7 @@ strum = { version = "0.26", features = ["derive"] }
thiserror = "1.0.69"
time = "0.3.41"
url = { version = "2.5.4", features = ["serde"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "3ec2e503a9ba12391f96935fcb7aa24d4d6aa452", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37", package = "rust-grpc-client" }
unified-connector-service-masking = { git = "https://github.com/juspay/hyperswitch", tag = "2025.11.24.0", package = "masking" }
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 7615b83f57..748c2d9a67 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -88,8 +88,8 @@ reqwest = { version = "0.11.27", features = ["json", "rustls-tls", "gzip", "mult
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", rev = "3ec2e503a9ba12391f96935fcb7aa24d4d6aa452", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "3ec2e503a9ba12391f96935fcb7aa24d4d6aa452", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "1abde2fb6dd203fc7b0cf5b2b184ce1c0d964e37", package = "ucs_cards" }
unified-connector-service-masking = { git = "https://github.com/juspay/hyperswitch", tag = "2025.11.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.rs
index 93be67239a..3dd7ea3ebc 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -140,16 +140,15 @@ impl
let currency = payments_grpc::Currency::foreign_try_from(router_data.request.currency)?;
- let payment_method = router_data
- .request
- .payment_method_type
- .map(|payment_method_type| {
- unified_connector_service::build_unified_connector_service_payment_method(
- router_data.request.payment_method_data.clone(),
- Some(payment_method_type),
- )
- })
- .transpose()?;
+ // Always build payment_method using payment_method_data (which is non-optional).
+ // payment_method_type is passed as optional, but payment_method must always be present
+ // for UCS to process the tokenization request.
+ let payment_method = Some(
+ unified_connector_service::build_unified_connector_service_payment_method(
+ router_data.request.payment_method_data.clone(),
+ router_data.request.payment_method_type,
+ )?,
+ );
let address = payments_grpc::PaymentAddress::foreign_try_from(router_data.address.clone())?;
@@ -173,6 +172,7 @@ impl
metadata: None,
connector_metadata: None,
return_url: router_data.request.router_return_url.clone(),
+ test_mode: router_data.test_mode,
})
}
}
@@ -367,6 +367,9 @@ impl
.map(|payment_channel| payment_channel.into()),
connector_metadata: None,
locale: router_data.request.locale.clone(),
+ continue_redirection_url: None,
+ redirection_response: None,
+ threeds_completion_indicator: None,
tokenization_strategy: router_data
.request
.tokenization
@@ -487,6 +490,7 @@ impl
.clone()
.map(|e| e.expose().expose().into()),
browser_info,
+ locale: None,
session_token: router_data.session_token.clone(),
order_tax_amount: None,
@@ -533,7 +537,9 @@ impl
enable_partial_authorization: None,
payment_channel: None,
billing_descriptor: None,
- locale: None,
+ continue_redirection_url: None,
+ redirection_response: None,
+ threeds_completion_indicator: None,
tokenization_strategy: router_data
.request
.tokenization
@@ -863,6 +869,7 @@ impl
.map(payments_grpc::BrowserInformation::foreign_try_from)
.transpose()?,
connector_metadata: None,
+ capture_method: None,
})
}
}
@@ -1036,6 +1043,7 @@ impl
.map(payments_grpc::BrowserInformation::foreign_try_from)
.transpose()?,
connector_metadata: None,
+ capture_method: None,
})
}
}
@@ -1213,6 +1221,7 @@ impl
.clone()
.map(|e| e.expose().expose().into()),
browser_info,
+ locale: None,
session_token: None,
order_tax_amount: None,
customer_name: None,
@@ -1258,7 +1267,6 @@ impl
connector_order_reference_id: Some(router_data.connector_request_reference_id.clone()),
enable_partial_authorization: None,
payment_channel: None,
- locale: None,
tokenization_strategy: router_data
.request
.tokenization
@@ -1536,6 +1544,7 @@ impl
.clone()
.map(|e| e.expose().expose().into()),
browser_info,
+ locale: None,
session_token: None,
order_tax_amount: router_data
.request
@@ -1612,7 +1621,6 @@ impl
connector_order_reference_id: router_data.request.order_id.clone(),
enable_partial_authorization: None,
payment_channel: None,
- locale: None,
tokenization_strategy: None,
})
}
@@ -3661,6 +3669,18 @@ impl transformers::ForeignTryFrom<payments_grpc::RedirectForm> for RedirectForm
)
.into(),
),
+ Some(payments_grpc::redirect_form::FormType::Braintree(_)) => Err(
+ UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
+ "Braintree form type is not implemented".to_string(),
+ )
+ .into(),
+ ),
+ Some(payments_grpc::redirect_form::FormType::Mifinity(_)) => Err(
+ UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
+ "Mifinity form type is not implemented".to_string(),
+ )
+ .into(),
+ ),
None => Err(
UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
"Missing form type".to_string(),