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): [Stripe] forward error_on_requires_action to UCS (#14490)
Tushar Shukla8f900adc04b3
diff --git a/Cargo.lock b/Cargo.lockindex 47d32af672..e936dbe9a7 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -2288,7 +2288,7 @@ dependencies = [[[package]]name = "config_patch_derive"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.29.2#456e052730a5834c3eb65bb258cbd37fa0e7ea6b"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.30.2#a5b71cd95d6dd6561a7e60bc28a67e88d9b926eb"dependencies = ["proc-macro2","quote",@@ -4267,7 +4267,7 @@ checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57"[[package]]name = "grpc-api-types"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.29.2#456e052730a5834c3eb65bb258cbd37fa0e7ea6b"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.30.2#a5b71cd95d6dd6561a7e60bc28a67e88d9b926eb"dependencies = ["axum 0.8.4","bytes 1.10.1",@@ -8599,7 +8599,7 @@ dependencies = [[[package]]name = "rust-grpc-client"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.29.2#456e052730a5834c3eb65bb258cbd37fa0e7ea6b"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.30.2#a5b71cd95d6dd6561a7e60bc28a67e88d9b926eb"dependencies = ["grpc-api-types",]@@ -11489,7 +11489,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"[[package]]name = "ucs_cards"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.29.2#456e052730a5834c3eb65bb258cbd37fa0e7ea6b"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.30.2#a5b71cd95d6dd6561a7e60bc28a67e88d9b926eb"dependencies = ["bytes 1.10.1","error-stack 0.4.1",@@ -11505,7 +11505,7 @@ dependencies = [[[package]]name = "ucs_common_enums"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.29.2#456e052730a5834c3eb65bb258cbd37fa0e7ea6b"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.30.2#a5b71cd95d6dd6561a7e60bc28a67e88d9b926eb"dependencies = ["serde","strum 0.26.3",@@ -11516,7 +11516,7 @@ dependencies = [[[package]]name = "ucs_common_utils"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.29.2#456e052730a5834c3eb65bb258cbd37fa0e7ea6b"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.30.2#a5b71cd95d6dd6561a7e60bc28a67e88d9b926eb"dependencies = ["anyhow","base64 0.21.7",diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.tomlindex 2d30e76044..2e9273d037 100644--- a/crates/external_services/Cargo.toml+++ b/crates/external_services/Cargo.toml@@ -94,7 +94,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.09.29.2", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.09.30.2", package = "rust-grpc-client" }open-feature = { version = "0.2.5", optional = true }bytes = { version = "1.10.1", optional = true }superposition_provider = { version = "0.115.5", optional = true }diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.tomlindex 57c3dc7998..bceece5db2 100644--- a/crates/hyperswitch_interfaces/Cargo.toml+++ b/crates/hyperswitch_interfaces/Cargo.toml@@ -35,7 +35,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.09.29.2", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.09.30.2", package = "rust-grpc-client" }tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }# First party cratesdiff --git a/crates/router/Cargo.toml b/crates/router/Cargo.tomlindex 63f9fc65f5..642508167d 100644--- a/crates/router/Cargo.toml+++ b/crates/router/Cargo.toml@@ -244,8 +244,8 @@ rust_decimal = { version = "1.37.1", features = [] }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.09.29.2",package = "rust-grpc-client" }-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.09.29.2", package = "ucs_cards" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.09.30.2",package = "rust-grpc-client" }+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.09.30.2", package = "ucs_cards" }rustc-hash = "1.1.0"rustls = { version = "0.23", default-features = false, features = ["aws-lc-rs",diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rsindex 592677def9..f58fe9e155 100644--- a/crates/router/src/core/unified_connector_service/transformers.rs+++ b/crates/router/src/core/unified_connector_service/transformers.rs@@ -84,7 +84,7 @@ impl ForeignFrom<&api_models::payments::ConnectorMetadata>peachpayments: _,santander: _,worldpayxml,- stripe: _,+ stripe,} = metadata;fn to_snake_case_string<T: serde::Serialize>(value: T) -> Option<String> {serde_json::to_value(value)@@ -105,6 +105,11 @@ impl ForeignFrom<&api_models::payments::ConnectorMetadata>payment_purpose: data.payment_purpose.and_then(to_snake_case_string),}}),+ stripe: stripe+ .as_ref()+ .map(|data| payments_grpc::StripeAdditionalInformation {+ error_on_requires_action: data.error_on_requires_action,+ }),}}}@@ -2774,6 +2779,27 @@ impl}}+/// Connectors whose connector-service SetupMandate builder accepts raw card data.+///+/// `build_unified_connector_service_payment_method` substitutes the connector token for+/// *any* payment method, so a card SetupMandate reaches the connector service as a token+/// and the card itself is lost -- the gRPC `PaymentMethod.payment_method` oneof is card+/// XOR token, so it cannot carry both. Our own connectors do not behave that way: Stripe's+/// SetupMandate builder consumes `payment_method_token` on the wallet arm and ignores it+/// for cards, re-sending the card. Shadow validation sees the difference as UCS sending+/// `payment_method=<pm_id>` where the direct call sends `payment_method_data[card][*]`,+/// `payment_method_data[type]`, `payment_method_options[card][network]`,+/// `[request_three_d_secure]` and `payment_method_types[0]`.+///+/// An allow-list rather than a deny-list on purpose: some connectors genuinely require a+/// token on this flow and reject raw cards (billwerk's `source` must be a `ct_`/`ca_`+/// token; stax resolves a mandate token or errors), so an unverified connector keeps+/// today's behaviour. Extend one connector at a time, after confirming its+/// connector-service SetupMandate builder handles `PaymentMethodData::Card`.+fn setup_mandate_accepts_raw_card(connector: &str) -> bool {+ matches!(connector, "stripe")+}+impltransformers::ForeignTryFrom<&RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,@@ -2785,11 +2811,23 @@ implrouter_data: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,) -> Result<Self, Self::Error> {let currency = payments_grpc::Currency::foreign_try_from(router_data.request.currency)?;+ // Drop the token ONLY for a raw card on an allow-listed connector. Everything else+ // -- wallets, mandate payments, bank debits, anything the helper below has no arm+ // for -- keeps today's behaviour, because the helper answers NotImplemented for+ // variants it cannot build and the token short-circuit is what rescues them today.+ let payment_method_token = match router_data.request.payment_method_data {+ hyperswitch_domain_models::payment_method_data::PaymentMethodData::Card(_)+ if setup_mandate_accepts_raw_card(router_data.connector.as_str()) =>+ {+ None+ }+ _ => router_data.payment_method_token.as_ref(),+ };let payment_method =unified_connector_service::build_unified_connector_service_payment_method(router_data.request.payment_method_data.clone(),router_data.request.payment_method_type,- router_data.payment_method_token.as_ref(),+ payment_method_token,router_data.connector_meta_data.as_ref(),)?;@@ -2836,6 +2874,13 @@ impl.transpose()?;Ok(Self {+ // Stripe's setup_intents needs this for on_behalf_of on a destination charge,+ // and echoes the charge details back as mandate_reference.mandate_metadata.+ split_payments: router_data+ .request+ .split_payments+ .as_ref()+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),test_mode: router_data.test_mode,capture_method: capture_method.map(|capture_method| capture_method.into()),mit_category: None,@@ -8738,6 +8783,9 @@ impllet access_token = router_data.access_token.as_ref().map(|t| t.token.clone());Ok(Self {+ // Arrived with the 2026.09.30.2 client bump; the router does not populate+ // it yet, and None reproduces the behaviour from before the field existed.+ payout_connector_metadata: None,merchant_payout_id: router_data.payout_id.clone(),address,connector_feature_data,@@ -9019,6 +9067,10 @@ impl.transpose()?;Ok(Self {+ // Arrived with the 2026.09.30.2 client bump; the router does not populate+ // it yet, and None reproduces the behaviour from before the field existed.+ payout_method_data: None,+ test_mode: None,merchant_quote_id: router_data.quote_id.clone(),address,amount: Some(money),