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

feat(ucs): Bump UCS client dependency to bring latest changes (#11773)

Shubhodip pale8b26d849d40
diff --git a/Cargo.lock b/Cargo.lock
index 0f7de3dea8..349bd66016 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2232,7 +2232,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=e479d36ac5ead316a6ed6b468260987ac6ec5401#e479d36ac5ead316a6ed6b468260987ac6ec5401"
+source = "git+https://github.com/juspay/connector-service?rev=c9ee01c1876d7e5803407b401f33d5b067f6c024#c9ee01c1876d7e5803407b401f33d5b067f6c024"
dependencies = [
"proc-macro2",
"quote",
@@ -3947,7 +3947,7 @@ checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57"
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=e479d36ac5ead316a6ed6b468260987ac6ec5401#e479d36ac5ead316a6ed6b468260987ac6ec5401"
+source = "git+https://github.com/juspay/connector-service?rev=c9ee01c1876d7e5803407b401f33d5b067f6c024#c9ee01c1876d7e5803407b401f33d5b067f6c024"
dependencies = [
"axum 0.8.4",
"error-stack 0.5.0",
@@ -8115,7 +8115,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=e479d36ac5ead316a6ed6b468260987ac6ec5401#e479d36ac5ead316a6ed6b468260987ac6ec5401"
+source = "git+https://github.com/juspay/connector-service?rev=c9ee01c1876d7e5803407b401f33d5b067f6c024#c9ee01c1876d7e5803407b401f33d5b067f6c024"
dependencies = [
"grpc-api-types",
]
@@ -10943,7 +10943,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=e479d36ac5ead316a6ed6b468260987ac6ec5401#e479d36ac5ead316a6ed6b468260987ac6ec5401"
+source = "git+https://github.com/juspay/connector-service?rev=c9ee01c1876d7e5803407b401f33d5b067f6c024#c9ee01c1876d7e5803407b401f33d5b067f6c024"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
@@ -10959,7 +10959,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=e479d36ac5ead316a6ed6b468260987ac6ec5401#e479d36ac5ead316a6ed6b468260987ac6ec5401"
+source = "git+https://github.com/juspay/connector-service?rev=c9ee01c1876d7e5803407b401f33d5b067f6c024#c9ee01c1876d7e5803407b401f33d5b067f6c024"
dependencies = [
"serde",
"strum 0.26.3",
@@ -10970,7 +10970,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=e479d36ac5ead316a6ed6b468260987ac6ec5401#e479d36ac5ead316a6ed6b468260987ac6ec5401"
+source = "git+https://github.com/juspay/connector-service?rev=c9ee01c1876d7e5803407b401f33d5b067f6c024#c9ee01c1876d7e5803407b401f33d5b067f6c024"
dependencies = [
"anyhow",
"base64 0.21.7",
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index fcc3c0ac23..1e8823daf5 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -73,7 +73,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 = "e479d36ac5ead316a6ed6b468260987ac6ec5401", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "c9ee01c1876d7e5803407b401f33d5b067f6c024", package = "rust-grpc-client" }
open-feature = { version = "0.2.5", optional = true }
superposition_provider = { version = "0.102.0", optional = true}
superposition_types = "0.102.0"
diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml
index b2bde31e01..7b65c816d6 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 = "e479d36ac5ead316a6ed6b468260987ac6ec5401", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "c9ee01c1876d7e5803407b401f33d5b067f6c024", package = "rust-grpc-client" }
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
# First party crates
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 2db546a573..216f20a172 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -91,8 +91,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 = "e479d36ac5ead316a6ed6b468260987ac6ec5401", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "e479d36ac5ead316a6ed6b468260987ac6ec5401", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "c9ee01c1876d7e5803407b401f33d5b067f6c024", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "c9ee01c1876d7e5803407b401f33d5b067f6c024", package = "ucs_cards" }
rustc-hash = "1.1.0"
rustls = "0.22"
rustls-pemfile = "2"
diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rs
index 3c9aee92cb..ba2b8149b1 100644
--- a/crates/router/src/core/unified_connector_service.rs
+++ b/crates/router/src/core/unified_connector_service.rs
@@ -758,43 +758,55 @@ pub fn build_unified_connector_service_payment_method(
) -> CustomResult<payments_grpc::PaymentMethod, UnifiedConnectorServiceError> {
match payment_method_data {
hyperswitch_domain_models::payment_method_data::PaymentMethodData::Card(card) => {
- let card_exp_month = card
- .get_card_expiry_month_2_digit()
- .attach_printable("Failed to extract 2-digit expiry month from card")
- .change_context(UnifiedConnectorServiceError::InvalidDataFormat {
- field_name: "card_exp_month",
- })?
- .peek()
- .to_string();
-
- let card_network = card
- .card_network
- .clone()
- .map(payments_grpc::CardNetwork::foreign_from);
-
- let card_details = CardDetails {
- card_number: Some(
- CardNumber::from_str(&card.card_number.get_card_no()).change_context(
- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
- "Failed to parse card number".to_string(),
+ match payment_method_token {
+ Some(PaymentMethodToken::Token(token)) => {
+ let token_payment_method = payments_grpc::TokenPaymentMethodType {
+ token: Some(token.clone()),
+ };
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Token(token_payment_method)),
+ })
+ }
+ _ => {
+ let card_exp_month = card
+ .get_card_expiry_month_2_digit()
+ .attach_printable("Failed to extract 2-digit expiry month from card")
+ .change_context(UnifiedConnectorServiceError::InvalidDataFormat {
+ field_name: "card_exp_month",
+ })?
+ .peek()
+ .to_string();
+
+ let card_network = card
+ .card_network
+ .clone()
+ .map(payments_grpc::CardNetwork::foreign_from);
+
+ let card_details = CardDetails {
+ card_number: Some(
+ CardNumber::from_str(&card.card_number.get_card_no()).change_context(
+ UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
+ "Failed to parse card number".to_string(),
+ ),
+ )?,
),
- )?,
- ),
- card_exp_month: Some(card_exp_month.into()),
- card_exp_year: Some(card.card_exp_year.expose().into()),
- card_cvc: Some(card.card_cvc.expose().into()),
- card_holder_name: card.card_holder_name.map(|name| name.expose().into()),
- card_issuer: card.card_issuer.clone(),
- card_network: card_network.map(|card_network| card_network.into()),
- card_type: card.card_type.clone(),
- bank_code: card.bank_code.clone(),
- nick_name: card.nick_name.map(|n| n.expose()),
- card_issuing_country_alpha2: card.card_issuing_country.clone(),
- };
+ card_exp_month: Some(card_exp_month.into()),
+ card_exp_year: Some(card.card_exp_year.expose().into()),
+ card_cvc: Some(card.card_cvc.expose().into()),
+ card_holder_name: card.card_holder_name.map(|name| name.expose().into()),
+ card_issuer: card.card_issuer.clone(),
+ card_network: card_network.map(|card_network| card_network.into()),
+ card_type: card.card_type.clone(),
+ bank_code: card.bank_code.clone(),
+ nick_name: card.nick_name.map(|n| n.expose()),
+ card_issuing_country_alpha2: card.card_issuing_country.clone(),
+ };
- Ok(payments_grpc::PaymentMethod {
- payment_method: Some(PaymentMethod::Card(card_details)),
- })
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Card(card_details)),
+ })
+ }
+ }
}
hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardRedirect(
card_redirect_data,
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 73c0e661ab..fec05aab55 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -311,11 +311,7 @@ impl
metadata,
test_mode: router_data.test_mode,
state,
- payment_method_token: router_data
- .payment_method_token
- .as_ref()
- .and_then(|payment_method_token| payment_method_token.get_payment_method_token())
- .map(|payment_method_token| Secret::new(payment_method_token.expose())),
+ connector_order_id: None,
description: router_data.description.clone(),
setup_mandate_details: router_data
.request
@@ -516,11 +512,6 @@ impl
metadata,
test_mode: router_data.test_mode,
state,
- payment_method_token: router_data
- .payment_method_token
- .as_ref()
- .and_then(|payment_method_token| payment_method_token.get_payment_method_token())
- .map(|payment_method_token| Secret::new(payment_method_token.expose())),
description: router_data.description.clone(),
setup_mandate_details: router_data
.request
@@ -556,6 +547,7 @@ impl
.map(payments_grpc::Tokenization::foreign_from)
.map(Into::into),
l2_l3_data: None,
+ connector_order_id: None,
})
}
}
@@ -1299,7 +1291,7 @@ impl
threeds_completion_indicator: None,
redirection_response: None,
continue_redirection_url: None,
- payment_method_token: None,
+ connector_order_id: None,
l2_l3_data: None,
})
}
@@ -1478,7 +1470,7 @@ impl
threeds_completion_indicator: None,
redirection_response: None,
continue_redirection_url: None,
- payment_method_token: None,
+ connector_order_id: None,
l2_l3_data: None,
})
}
@@ -1637,7 +1629,7 @@ impl
threeds_completion_indicator: None,
redirection_response: None,
continue_redirection_url: None,
- payment_method_token: None,
+ connector_order_id: None,
l2_l3_data: None,
})
}
@@ -1696,11 +1688,6 @@ impl
.map(ConnectorState::foreign_from);
Ok(Self {
- payment_method_token: router_data
- .payment_method_token
- .as_ref()
- .and_then(|payment_method_token| payment_method_token.get_payment_method_token())
- .map(|payment_method_token| Secret::new(payment_method_token.expose())),
merchant_recurring_payment_id: router_data.connector_request_reference_id.clone(),
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
@@ -2062,6 +2049,7 @@ impl transformers::ForeignTryFrom<&RouterData<Session, PaymentsSessionData, Paym
phone_country_code: None,
}),
metadata: None,
+ return_url: None,
};
Ok(Self {
@@ -3034,7 +3022,7 @@ impl transformers::ForeignTryFrom<common_enums::PaymentMethodType>
common_enums::PaymentMethodType::Sofort => Ok(Self::Sofort),
common_enums::PaymentMethodType::Swish => Ok(Self::Swish),
common_enums::PaymentMethodType::TouchNGo => Ok(Self::TouchNGo),
- common_enums::PaymentMethodType::Trustly => Ok(Self::Trustly),
+ common_enums::PaymentMethodType::Trustly => Ok(Self::TrustlyBankRedirect),
common_enums::PaymentMethodType::Twint => Ok(Self::Twint),
common_enums::PaymentMethodType::UpiCollect => Ok(Self::UpiCollect),
common_enums::PaymentMethodType::UpiIntent => Ok(Self::UpiIntent),
@@ -4442,7 +4430,7 @@ impl ForeignFrom<common_enums::PaymentMethodType> for payments_grpc::PaymentMeth
common_enums::PaymentMethodType::Sofort => Self::Sofort,
common_enums::PaymentMethodType::Swish => Self::Swish,
common_enums::PaymentMethodType::TouchNGo => Self::TouchNGo,
- common_enums::PaymentMethodType::Trustly => Self::Trustly,
+ common_enums::PaymentMethodType::Trustly => Self::TrustlyBankRedirect,
common_enums::PaymentMethodType::Twint => Self::Twint,
common_enums::PaymentMethodType::UpiCollect => Self::UpiCollect,
common_enums::PaymentMethodType::UpiIntent => Self::UpiIntent,