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(ucs): forward business_country for the worldpayxml AFT flow (#14049)
Pa12b2ef923ba42
diff --git a/Cargo.lock b/Cargo.lockindex 23f02db49a..d080f3848e 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1559,7 +1559,7 @@ dependencies = ["bitflags 2.9.0","cexpr","clang-sys",- "itertools 0.10.5",+ "itertools 0.11.0","log 0.4.27","prettyplease","proc-macro2",@@ -2287,7 +2287,7 @@ dependencies = [[[package]]name = "config_patch_derive"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.03.0#807c85a57e4148debc25938ad20137e9e979df2e"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.07.1#f7e575b7d31e5e34ceb82a4929e6fceea8f25e21"dependencies = ["proc-macro2","quote",@@ -4261,7 +4261,7 @@ checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57"[[package]]name = "grpc-api-types"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.03.0#807c85a57e4148debc25938ad20137e9e979df2e"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.07.1#f7e575b7d31e5e34ceb82a4929e6fceea8f25e21"dependencies = ["axum 0.8.4","bytes 1.10.1",@@ -7536,8 +7536,8 @@ version = "0.14.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7"dependencies = [- "heck 0.4.1",- "itertools 0.10.5",+ "heck 0.5.0",+ "itertools 0.11.0","log 0.4.27","multimap","petgraph",@@ -7558,7 +7558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"dependencies = ["anyhow",- "itertools 0.10.5",+ "itertools 0.11.0","proc-macro2","quote","syn 2.0.101",@@ -7571,7 +7571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b"dependencies = ["anyhow",- "itertools 0.10.5",+ "itertools 0.11.0","proc-macro2","quote","syn 2.0.101",@@ -8582,7 +8582,7 @@ dependencies = [[[package]]name = "rust-grpc-client"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.03.0#807c85a57e4148debc25938ad20137e9e979df2e"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.07.1#f7e575b7d31e5e34ceb82a4929e6fceea8f25e21"dependencies = ["grpc-api-types",]@@ -11422,7 +11422,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"[[package]]name = "ucs_cards"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.03.0#807c85a57e4148debc25938ad20137e9e979df2e"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.07.1#f7e575b7d31e5e34ceb82a4929e6fceea8f25e21"dependencies = ["bytes 1.10.1","error-stack 0.4.1",@@ -11438,7 +11438,7 @@ dependencies = [[[package]]name = "ucs_common_enums"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.03.0#807c85a57e4148debc25938ad20137e9e979df2e"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.07.1#f7e575b7d31e5e34ceb82a4929e6fceea8f25e21"dependencies = ["serde","strum 0.26.3",@@ -11449,7 +11449,7 @@ dependencies = [[[package]]name = "ucs_common_utils"version = "0.1.0"-source = "git+https://github.com/juspay/connector-service?tag=2026.09.03.0#807c85a57e4148debc25938ad20137e9e979df2e"+source = "git+https://github.com/juspay/connector-service?tag=2026.09.07.1#f7e575b7d31e5e34ceb82a4929e6fceea8f25e21"dependencies = ["anyhow","base64 0.21.7",diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.tomlindex 3080b980be..9101c377cc 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.03.0", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.09.07.1", 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 701c657e33..b65d502ddc 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.03.0", package = "rust-grpc-client" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.09.07.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.rs b/crates/hyperswitch_interfaces/src/unified_connector_service.rsindex 7054829cd2..27a87d288b 100644--- a/crates/hyperswitch_interfaces/src/unified_connector_service.rs+++ b/crates/hyperswitch_interfaces/src/unified_connector_service.rs@@ -58,6 +58,11 @@ pub fn get_payments_response_from_ucs_webhook_content() => Err(UnifiedConnectorServiceError::WebhookProcessingFailure).attach_printable("UCS webhook contains disputes response but payments response was expected",)?,+ Some(+ unified_connector_service_client::payments::event_content::Content::PayoutsResponse(_),+ ) => Err(UnifiedConnectorServiceError::NotImplemented(+ "UCS payouts webhook response handling".to_string(),+ ))?,None => Err(UnifiedConnectorServiceError::WebhookProcessingFailure).attach_printable("Missing payments response in UCS webhook content")?,}diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.tomlindex 952f5023b3..91b25099bb 100644--- a/crates/router/Cargo.toml+++ b/crates/router/Cargo.toml@@ -243,8 +243,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.03.0", package = "rust-grpc-client" }-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.09.03.0", package = "ucs_cards" }+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.09.07.1", package = "rust-grpc-client" }+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.09.07.1", 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/payments/gateway/authorize_gateway.rs b/crates/router/src/core/payments/gateway/authorize_gateway.rsindex 055139f013..25d363e217 100644--- a/crates/router/src/core/payments/gateway/authorize_gateway.rs+++ b/crates/router/src/core/payments/gateway/authorize_gateway.rs@@ -279,6 +279,9 @@ whererouter_data.minor_amount_captured = payment_authorize_response.captured_amount.map(MinorUnit::new);+ router_data.sender_payment_instrument_id = payment_authorize_response+ .sender_payment_instrument_id+ .clone();router_data.minor_amount_capturable = payment_authorize_response.capturable_amount.map(MinorUnit::new);diff --git a/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs b/crates/router/src/core/payments/gateway/complete_authorize_gateway.rsindex 877bce4691..926be9e1a8 100644--- a/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs+++ b/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs@@ -158,6 +158,9 @@ whererouter_data.minor_amount_captured = payment_authorize_response.captured_amount.map(MinorUnit::new);+ router_data.sender_payment_instrument_id = payment_authorize_response+ .sender_payment_instrument_id+ .clone();if return_raw_connector_response.unwrap_or(false) {router_data.raw_connector_response = payment_authorize_response.raw_connector_responsediff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rsindex 9c1909bb88..e2dbfbef12 100644--- a/crates/router/src/core/unified_connector_service.rs+++ b/crates/router/src/core/unified_connector_service.rs@@ -155,7 +155,8 @@ impl ForeignTryFrom<payments_grpc::PaymentMethod> for domain_pm::PaymentMethodDapayments_grpc::card_redirect::CardRedirectType::CardRedirect => {domain_pm::CardRedirectData::CardRedirect {}}- payments_grpc::card_redirect::CardRedirectType::Unspecified => {+ payments_grpc::card_redirect::CardRedirectType::Unspecified+ | payments_grpc::card_redirect::CardRedirectType::Webpay => {return Err(UnifiedConnectorServiceError::ResponseDeserializationFailed.into())diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rsindex 9007d3d30d..9e1b18b3d6 100644--- a/crates/router/src/core/unified_connector_service/transformers.rs+++ b/crates/router/src/core/unified_connector_service/transformers.rs@@ -81,14 +81,27 @@ impl ForeignFrom<&api_models::payments::ConnectorMetadata>adyen: _,peachpayments: _,santander: _,- worldpayxml: _,+ worldpayxml,} = metadata;+ fn to_snake_case_string<T: serde::Serialize>(value: T) -> Option<String> {+ serde_json::to_value(value)+ .ok()+ .and_then(|value| value.as_str().map(ToString::to_string))+ }Self {checkout: checkout.as_ref().map(|data| payments_grpc::CheckoutAdditionalInformation {purpose_of_payment: data.purpose_of_payment.clone(),}),+ worldpayxml: worldpayxml.as_ref().map(|data| {+ payments_grpc::WorldpayxmlAdditionalInformation {+ funding_transaction_type: data+ .funding_transaction_type+ .and_then(to_snake_case_string),+ payment_purpose: data.payment_purpose.and_then(to_snake_case_string),+ }+ }),}}}@@ -476,12 +489,35 @@ impllet address = payments_grpc::PaymentAddress::foreign_try_from(router_data.address.clone())?;+ let setup_future_usage = router_data+ .request+ .setup_future_usage+ .map(payments_grpc::FutureUsage::foreign_try_from)+ .transpose()?;++ let customer_acceptance = router_data+ .request+ .customer_acceptance+ .clone()+ .map(payments_grpc::CustomerAcceptance::foreign_try_from)+ .transpose()?;++ let setup_mandate_details = router_data+ .request+ .setup_mandate_details+ .as_ref()+ .map(payments_grpc::SetupMandateDetails::foreign_try_from)+ .transpose()?;+Ok(Self {split_payments: router_data.request.split_payments.as_ref().map(payments_grpc::SplitPaymentsDetails::foreign_from),+ setup_future_usage: setup_future_usage.map(|s| s.into()),+ customer_acceptance,+ setup_mandate_details,merchant_payment_method_id: Some(router_data.connector_request_reference_id.clone()),amount: router_data.request@@ -757,6 +793,7 @@ impl.connector_intent_metadata.as_ref().map(payments_grpc::AdditionalConnectorDetails::foreign_from),+ business_country: router_data.request.business_country.map(|c| c.to_string()),})}}@@ -1013,6 +1050,7 @@ impl.connector_intent_metadata.as_ref().map(payments_grpc::AdditionalConnectorDetails::foreign_from),+ business_country: router_data.request.business_country.map(|c| c.to_string()),})}}@@ -2240,6 +2278,7 @@ impl.connector_intent_metadata.as_ref().map(payments_grpc::AdditionalConnectorDetails::foreign_from),+ business_country: router_data.request.business_country.map(|c| c.to_string()),})}}@@ -2455,6 +2494,7 @@ impl.connector_intent_metadata.as_ref().map(payments_grpc::AdditionalConnectorDetails::foreign_from),+ business_country: router_data.request.business_country.map(|c| c.to_string()),})}}@@ -2522,6 +2562,7 @@ implOk(Self {is_account_funding_transaction: None,recipient_details: None,+ business_country: None,split_settlement: None,split_payments: router_data.request@@ -2699,6 +2740,7 @@ impl.map(ConnectorState::foreign_from);Ok(Self {+ test_mode: router_data.test_mode,mit_category: None,merchant_recurring_payment_id: router_data.connector_request_reference_id.clone(),amount: Some(payments_grpc::Money {@@ -3253,6 +3295,7 @@ impl.map(ConnectorState::foreign_from);Ok(Self {+ test_mode: router_data.test_mode,amount: Some(payments_grpc::Money {minor_amount: router_data.request.total_amount,currency: currency.into(),@@ -4160,6 +4203,8 @@ impl transformers::ForeignTryFrom<common_enums::PaymentMethodType>common_enums::PaymentMethodType::BcaBankTransfer => Ok(Self::BcaBankTransfer),common_enums::PaymentMethodType::BniVa => Ok(Self::BniVa),common_enums::PaymentMethodType::BriVa => Ok(Self::BriVa),+ #[cfg(feature = "v2")]+ common_enums::PaymentMethodType::Card => Ok(Self::Credit),common_enums::PaymentMethodType::CardRedirect => Ok(Self::CardRedirect),common_enums::PaymentMethodType::CimbVa => Ok(Self::CimbVa),common_enums::PaymentMethodType::ClassicReward => Ok(Self::ClassicReward),@@ -4243,16 +4288,38 @@ impl transformers::ForeignTryFrom<common_enums::PaymentMethodType>common_enums::PaymentMethodType::OpenBankingPIS => Ok(Self::OpenBankingPis),common_enums::PaymentMethodType::DirectCarrierBilling => Ok(Self::DirectCarrierBilling),common_enums::PaymentMethodType::InstantBankTransfer => Ok(Self::InstantBankTransfer),+ common_enums::PaymentMethodType::InstantBankTransferFinland => {+ Ok(Self::InstantBankTransferFinland)+ }+ common_enums::PaymentMethodType::InstantBankTransferPoland => {+ Ok(Self::InstantBankTransferPoland)+ }common_enums::PaymentMethodType::Paypal => Ok(Self::PayPal),common_enums::PaymentMethodType::RevolutPay => Ok(Self::RevolutPay),common_enums::PaymentMethodType::NetworkToken => Ok(Self::NetworkToken),common_enums::PaymentMethodType::OpenBanking => Ok(Self::OpenBanking),common_enums::PaymentMethodType::Skrill => Ok(Self::Skrill),- _ => Err(- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(- "Payment Method Type not yet supported".to_string(),- ),- )?,+ common_enums::PaymentMethodType::Klarna => Ok(Self::Klarna),+ common_enums::PaymentMethodType::BhnCardNetwork => Ok(Self::BhnCardNetwork),+ common_enums::PaymentMethodType::Bluecode => Ok(Self::Bluecode),+ common_enums::PaymentMethodType::Breadpay => Ok(Self::Breadpay),+ common_enums::PaymentMethodType::EftDebitOrder => Ok(Self::EftDebitOrder),+ common_enums::PaymentMethodType::Flexiti => Ok(Self::Flexiti),+ common_enums::PaymentMethodType::IndonesianBankTransfer => {+ Ok(Self::IndonesianBankTransfer)+ }+ common_enums::PaymentMethodType::Mifinity => Ok(Self::Mifinity),+ common_enums::PaymentMethodType::Payjustnow => Ok(Self::Payjustnow),+ common_enums::PaymentMethodType::Paysera => Ok(Self::Paysera),+ common_enums::PaymentMethodType::Payshap => Ok(Self::Payshap),+ common_enums::PaymentMethodType::PayshapProxy => Ok(Self::PayshapProxy),+ common_enums::PaymentMethodType::PixAutomaticoPush => Ok(Self::PixAutomaticoPush),+ common_enums::PaymentMethodType::PixAutomaticoQr => Ok(Self::PixAutomaticoQr),+ common_enums::PaymentMethodType::PixEmv => Ok(Self::PixEmv),+ common_enums::PaymentMethodType::PixKey => Ok(Self::PixKey),+ common_enums::PaymentMethodType::PixQr => Ok(Self::PixQr),+ common_enums::PaymentMethodType::Qris => Ok(Self::Qris),+ common_enums::PaymentMethodType::SepaGuarenteedDebit => Ok(Self::SepaGuaranteedDebit),}}}