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(core): Added Split payment request field in capture and void UCS request (#13133)
Shubhodip palca5c054fc8dc
diff --git a/Cargo.lock b/Cargo.lockindex 04f4d7b56a..553144686f 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.06.30.1#c379a1ff7792dbc6af7856adfaf0036266e1d814"+source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"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.06.30.1#c379a1ff7792dbc6af7856adfaf0036266e1d814"+source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"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.06.30.1#c379a1ff7792dbc6af7856adfaf0036266e1d814"+source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"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.06.30.1#c379a1ff7792dbc6af7856adfaf0036266e1d814"+source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"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.06.30.1#c379a1ff7792dbc6af7856adfaf0036266e1d814"+source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"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.06.30.1#c379a1ff7792dbc6af7856adfaf0036266e1d814"+source = "git+https://github.com/juspay/connector-service?tag=2026.07.02.1#a070ef74a8d36aeca23f8e90d4d8bb0cc4db77ca"dependencies = ["anyhow","base64 0.21.7",diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.tomlindex 04b7ede6a2..494b6674b0 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.06.30.1", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.02.1", 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.tomlindex f25ec90251..852614bb05 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.06.30.1", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.07.02.1", package = "rust-grpc-client" }tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }# First party cratesdiff --git a/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs b/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rsindex 63a246c30e..c03abbd642 100644--- a/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs+++ b/crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs@@ -2,7 +2,7 @@ use std::str::FromStr;use common_enums::AttemptStatus;use common_types::primitive_wrappers::{ExtendedAuthorizationAppliedBool, OvercaptureEnabledBool};-use common_utils::{errors::ErrorSwitch, request::Method};+use common_utils::{errors::ErrorSwitch, request::Method, types::MinorUnit};use error_stack::ResultExt;use hyperswitch_domain_models::{errors::api_error_response::{ApiErrorResponse, NotImplementedMessage},@@ -253,6 +253,145 @@ pub struct ConnectorErrorInner {pub network_error_message: Option<String>,}+impl ForeignTryFrom<payments_grpc::PaymentChargeType> for common_enums::PaymentChargeType {+ type Error = error_stack::Report<UnifiedConnectorServiceError>;++ fn foreign_try_from(+ charge_type: payments_grpc::PaymentChargeType,+ ) -> Result<Self, Self::Error> {+ match charge_type {+ payments_grpc::PaymentChargeType::StripeDirect => {+ Ok(Self::Stripe(common_enums::StripeChargeType::Direct))+ }+ payments_grpc::PaymentChargeType::StripeDestination => {+ Ok(Self::Stripe(common_enums::StripeChargeType::Destination))+ }+ payments_grpc::PaymentChargeType::Unspecified => Err(error_stack::Report::new(+ UnifiedConnectorServiceError::ParsingFailed,+ )+ .attach_printable("Received unspecified PaymentChargeType from gRPC")),+ }+ }+}++impl ForeignTryFrom<payments_grpc::AdyenSplitType> for common_enums::AdyenSplitType {+ type Error = error_stack::Report<UnifiedConnectorServiceError>;++ fn foreign_try_from(split_type: payments_grpc::AdyenSplitType) -> Result<Self, Self::Error> {+ match split_type {+ payments_grpc::AdyenSplitType::Unspecified => Err(error_stack::Report::new(+ UnifiedConnectorServiceError::ParsingFailed,+ )+ .attach_printable("Received unspecified AdyenSplitType from gRPC")),+ payments_grpc::AdyenSplitType::BalanceAccount => Ok(Self::BalanceAccount),+ payments_grpc::AdyenSplitType::AcquiringFees => Ok(Self::AcquiringFees),+ payments_grpc::AdyenSplitType::PaymentFee => Ok(Self::PaymentFee),+ payments_grpc::AdyenSplitType::AdyenFees => Ok(Self::AdyenFees),+ payments_grpc::AdyenSplitType::AdyenCommission => Ok(Self::AdyenCommission),+ payments_grpc::AdyenSplitType::AdyenMarkup => Ok(Self::AdyenMarkup),+ payments_grpc::AdyenSplitType::Interchange => Ok(Self::Interchange),+ payments_grpc::AdyenSplitType::SchemeFee => Ok(Self::SchemeFee),+ payments_grpc::AdyenSplitType::Commission => Ok(Self::Commission),+ payments_grpc::AdyenSplitType::TopUp => Ok(Self::TopUp),+ payments_grpc::AdyenSplitType::Vat => Ok(Self::Vat),+ }+ }+}++impl ForeignTryFrom<payments_grpc::AdyenSplitItem> for common_types::domain::AdyenSplitItem {+ type Error = error_stack::Report<UnifiedConnectorServiceError>;++ fn foreign_try_from(item: payments_grpc::AdyenSplitItem) -> Result<Self, Self::Error> {+ Ok(Self {+ amount: item.amount.map(MinorUnit::new),+ split_type: common_enums::AdyenSplitType::foreign_try_from(+ payments_grpc::AdyenSplitType::try_from(item.split_type).map_err(|_| {+ error_stack::Report::new(UnifiedConnectorServiceError::ParsingFailed)+ .attach_printable(format!(+ "Invalid AdyenSplitType value: {}",+ item.split_type+ ))+ })?,+ )?,+ account: item.account,+ reference: item.reference,+ description: item.description,+ })+ }+}++impl ForeignTryFrom<payments_grpc::AdyenSplitData> for common_types::domain::AdyenSplitData {+ type Error = error_stack::Report<UnifiedConnectorServiceError>;++ fn foreign_try_from(data: payments_grpc::AdyenSplitData) -> Result<Self, Self::Error> {+ Ok(Self {+ store: data.store,+ split_items: data+ .split_items+ .into_iter()+ .map(common_types::domain::AdyenSplitItem::foreign_try_from)+ .collect::<Result<Vec<_>, _>>()?,+ })+ }+}++impl ForeignTryFrom<payments_grpc::StripeSplitResponseData>+ for common_types::payments::StripeChargeResponseData+{+ type Error = error_stack::Report<UnifiedConnectorServiceError>;++ fn foreign_try_from(+ stripe: payments_grpc::StripeSplitResponseData,+ ) -> Result<Self, Self::Error> {+ Ok(Self {+ charge_id: stripe.charge_id,+ charge_type: common_enums::PaymentChargeType::foreign_try_from(+ payments_grpc::PaymentChargeType::try_from(stripe.charge_type).map_err(|_| {+ error_stack::Report::new(UnifiedConnectorServiceError::ParsingFailed)+ .attach_printable(format!(+ "Invalid PaymentChargeType value: {:?}",+ stripe.charge_type+ ))+ })?,+ )?,+ application_fees: stripe.application_fees.map(MinorUnit::new),+ transfer_account_id: stripe.transfer_account_id,+ on_behalf_of: stripe.on_behalf_of,+ })+ }+}++impl ForeignTryFrom<payments_grpc::ConnectorSplitResponseData>+ for common_types::payments::ConnectorChargeResponseData+{+ type Error = error_stack::Report<UnifiedConnectorServiceError>;++ fn foreign_try_from(+ split_data: payments_grpc::ConnectorSplitResponseData,+ ) -> Result<Self, Self::Error> {+ match split_data.split_response_type {+ Some(+ payments_grpc::connector_split_response_data::SplitResponseType::StripeSplitResponse(+ stripe,+ ),+ ) => Ok(Self::StripeSplitPayment(+ common_types::payments::StripeChargeResponseData::foreign_try_from(stripe)?,+ )),+ Some(+ payments_grpc::connector_split_response_data::SplitResponseType::AdyenSplitResponse(+ adyen,+ ),+ ) => Ok(Self::AdyenSplitPayment(+ common_types::domain::AdyenSplitData::foreign_try_from(adyen)?,+ )),+ None => Err(error_stack::Report::new(+ UnifiedConnectorServiceError::ParsingFailed,+ )+ .attach_printable("ConnectorSplitResponseData has no split_response_type")),+ }+ }+}+impl ForeignTryFrom<(payments_grpc::PaymentServiceGetResponse, AttemptStatus)>for Result<(PaymentsResponseData, AttemptStatus), ErrorResponse>{@@ -358,7 +497,7 @@ impl ForeignTryFrom<(payments_grpc::PaymentServiceGetResponse, AttemptStatus)>connector_response_reference_id: response.merchant_transaction_id,incremental_authorization_allowed: response.incremental_authorization_allowed,authentication_data: None,- charges: None,+ charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,},status,))@@ -861,7 +1000,7 @@ impl ForeignTryFrom<payments_grpc::RedirectForm> for RedirectForm {}.attach_printable("Failed to parse currency from UCS Nmi redirect form")?;Ok(Self::Nmi {- amount: common_utils::types::MinorUnit::new(amount_money.minor_amount)+ amount: MinorUnit::new(amount_money.minor_amount).to_major_unit_as_f64(currency).change_context(UnifiedConnectorServiceError::ParsingFailed)?.get_amount_as_f64()diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.tomlindex 8dbebf779f..76137a8030 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.06.30.1", package = "rust-grpc-client" }-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.06.30.1", package = "ucs_cards" }+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" }rustc-hash = "1.1.0"rustls = "0.22"rustls-pemfile = "2"diff --git a/crates/router/src/core/payments/gateway/cancel_gateway.rs b/crates/router/src/core/payments/gateway/cancel_gateway.rsindex 2eb73bbdbe..3c740361f9 100644--- a/crates/router/src/core/payments/gateway/cancel_gateway.rs+++ b/crates/router/src/core/payments/gateway/cancel_gateway.rs@@ -124,10 +124,10 @@ whereif let UnifiedConnectorServiceError::ConnectorError(inner) =report.current_context(){- let (code, message, status_code, reason,+ let (code, message, status_code, reason, connector_transaction_id,network_decline_code, network_advice_code, network_error_message,connector) = (- &inner.code, &inner.message, inner.status_code, &inner.reason,+ &inner.code, &inner.message, inner.status_code, &inner.reason, &inner.connector_transaction_id,&inner.network_decline_code, &inner.network_advice_code,&inner.network_error_message, &inner.connector,);@@ -145,7 +145,7 @@ wherereason: reason.clone(),status_code,attempt_status: None,- connector_transaction_id: None,+ connector_transaction_id: connector_transaction_id.clone(),connector_response_reference_id: None,network_decline_code: network_decline_code.clone(),network_advice_code: network_advice_code.clone(),diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rsindex 746ee6e548..07015f005c 100644--- a/crates/router/src/core/unified_connector_service/transformers.rs+++ b/crates/router/src/core/unified_connector_service/transformers.rs@@ -1311,6 +1311,11 @@ impl transformers::ForeignTryFrom<&RouterData<Capture, PaymentsCaptureData, Paymmerchant_order_id: router_data.request.merchant_order_reference_id.clone(),merchant_request_id: None,order_tax_amount: None,+ split_payments: router_data+ .request+ .split_payments+ .as_ref()+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),})}}@@ -3181,147 +3186,6 @@ impl transformers::ForeignTryFrom<common_enums::Currency> for payments_grpc::Cur}}-impl transformers::ForeignTryFrom<payments_grpc::PaymentChargeType>- for common_enums::PaymentChargeType-{- type Error = error_stack::Report<UnifiedConnectorServiceError>;-- fn foreign_try_from(- charge_type: payments_grpc::PaymentChargeType,- ) -> Result<Self, Self::Error> {- match charge_type {- payments_grpc::PaymentChargeType::StripeDirect => {- Ok(Self::Stripe(common_enums::StripeChargeType::Direct))- }- payments_grpc::PaymentChargeType::StripeDestination => {- Ok(Self::Stripe(common_enums::StripeChargeType::Destination))- }- payments_grpc::PaymentChargeType::Unspecified => Err(error_stack::Report::new(- UnifiedConnectorServiceError::ParsingFailed,- )- .attach_printable("Received unspecified PaymentChargeType from gRPC")),- }- }-}--impl transformers::ForeignTryFrom<payments_grpc::AdyenSplitType> for common_enums::AdyenSplitType {- type Error = error_stack::Report<UnifiedConnectorServiceError>;-- fn foreign_try_from(split_type: payments_grpc::AdyenSplitType) -> Result<Self, Self::Error> {- match split_type {- payments_grpc::AdyenSplitType::Unspecified => Err(error_stack::Report::new(- UnifiedConnectorServiceError::ParsingFailed,- )- .attach_printable("Received unspecified AdyenSplitType from gRPC")),- payments_grpc::AdyenSplitType::BalanceAccount => Ok(Self::BalanceAccount),- payments_grpc::AdyenSplitType::AcquiringFees => Ok(Self::AcquiringFees),- payments_grpc::AdyenSplitType::PaymentFee => Ok(Self::PaymentFee),- payments_grpc::AdyenSplitType::AdyenFees => Ok(Self::AdyenFees),- payments_grpc::AdyenSplitType::AdyenCommission => Ok(Self::AdyenCommission),- payments_grpc::AdyenSplitType::AdyenMarkup => Ok(Self::AdyenMarkup),- payments_grpc::AdyenSplitType::Interchange => Ok(Self::Interchange),- payments_grpc::AdyenSplitType::SchemeFee => Ok(Self::SchemeFee),- payments_grpc::AdyenSplitType::Commission => Ok(Self::Commission),- payments_grpc::AdyenSplitType::TopUp => Ok(Self::TopUp),- payments_grpc::AdyenSplitType::Vat => Ok(Self::Vat),- }- }-}--impl transformers::ForeignTryFrom<payments_grpc::AdyenSplitItem>- for common_types::domain::AdyenSplitItem-{- type Error = error_stack::Report<UnifiedConnectorServiceError>;-- fn foreign_try_from(item: payments_grpc::AdyenSplitItem) -> Result<Self, Self::Error> {- Ok(Self {- amount: item.amount.map(MinorUnit::new),- split_type: common_enums::AdyenSplitType::foreign_try_from(- payments_grpc::AdyenSplitType::try_from(item.split_type).map_err(|_| {- error_stack::Report::new(UnifiedConnectorServiceError::ParsingFailed)- .attach_printable(format!(- "Invalid AdyenSplitType value: {}",- item.split_type- ))- })?,- )?,- account: item.account,- reference: item.reference,- description: item.description,- })- }-}--impl transformers::ForeignTryFrom<payments_grpc::AdyenSplitData>- for common_types::domain::AdyenSplitData-{- type Error = error_stack::Report<UnifiedConnectorServiceError>;-- fn foreign_try_from(data: payments_grpc::AdyenSplitData) -> Result<Self, Self::Error> {- Ok(Self {- store: data.store,- split_items: data- .split_items- .into_iter()- .map(common_types::domain::AdyenSplitItem::foreign_try_from)- .collect::<Result<Vec<_>, _>>()?,- })- }-}--impl transformers::ForeignTryFrom<payments_grpc::StripeSplitResponseData>- for common_types::payments::StripeChargeResponseData-{- type Error = error_stack::Report<UnifiedConnectorServiceError>;-- fn foreign_try_from(- stripe: payments_grpc::StripeSplitResponseData,- ) -> Result<Self, Self::Error> {- Ok(Self {- charge_id: stripe.charge_id,- charge_type: common_enums::PaymentChargeType::foreign_try_from(- payments_grpc::PaymentChargeType::try_from(stripe.charge_type).map_err(|_| {- error_stack::Report::new(UnifiedConnectorServiceError::ParsingFailed)- .attach_printable(format!(- "Invalid PaymentChargeType value: {:?}",- stripe.charge_type- ))- })?,- )?,- application_fees: stripe.application_fees.map(MinorUnit::new),- transfer_account_id: stripe.transfer_account_id,- on_behalf_of: stripe.on_behalf_of,- })- }-}--impl transformers::ForeignTryFrom<payments_grpc::ConnectorSplitResponseData>- for common_types::payments::ConnectorChargeResponseData-{- type Error = error_stack::Report<UnifiedConnectorServiceError>;-- fn foreign_try_from(- split_data: payments_grpc::ConnectorSplitResponseData,- ) -> Result<Self, Self::Error> {- match split_data.split_response_type {- Some(payments_grpc::connector_split_response_data::SplitResponseType::StripeSplitResponse(stripe)) => {- Ok(Self::StripeSplitPayment(- common_types::payments::StripeChargeResponseData::foreign_try_from(stripe)?,- ))- }- Some(payments_grpc::connector_split_response_data::SplitResponseType::AdyenSplitResponse(adyen)) => {- Ok(Self::AdyenSplitPayment(- common_types::domain::AdyenSplitData::foreign_try_from(adyen)?,- ))- }- None => Err(error_stack::Report::new(- UnifiedConnectorServiceError::ParsingFailed,- )- .attach_printable("ConnectorSplitResponseData has no split_response_type")),- }- }-}-impl transformers::ForeignTryFrom<payments_grpc::Currency> for common_enums::Currency {type Error = error_stack::Report<UnifiedConnectorServiceError>;@@ -6482,6 +6346,11 @@ impl transformers::ForeignTryFrom<&RouterData<api::Void, PaymentsCancelData, Paytest_mode: router_data.test_mode,merchant_order_id: router_data.request.merchant_order_reference_id.clone(),merchant_request_id: None,+ split_payments: router_data+ .request+ .split_payments+ .as_ref()+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),})}}@@ -6525,6 +6394,7 @@ implmetadata: None,state,test_mode: router_data.test_mode,+ split_payments: None,})}}