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: adyen repeat payment dependencies for HS<>UCS (#10851)

gopikrishna000dafea2ac34dd
diff --git a/Cargo.lock b/Cargo.lock
index acdd5ab819..50e6c39d27 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2126,6 +2126,16 @@ dependencies = [
"toml 0.8.22",
]
+[[package]]
+name = "config_patch_derive"
+version = "0.1.0"
+source = "git+https://github.com/juspay/connector-service?rev=772548a7d4139906ec1abc4b45a4549f91d8c777#772548a7d4139906ec1abc4b45a4549f91d8c777"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.101",
+]
+
[[package]]
name = "connector_configs"
version = "0.1.0"
@@ -3790,7 +3800,7 @@ dependencies = [
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3dcfd30ef1405c81ba711c370397cabba277e854#3dcfd30ef1405c81ba711c370397cabba277e854"
+source = "git+https://github.com/juspay/connector-service?rev=772548a7d4139906ec1abc4b45a4549f91d8c777#772548a7d4139906ec1abc4b45a4549f91d8c777"
dependencies = [
"axum 0.8.4",
"error-stack 0.5.0",
@@ -7450,7 +7460,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3dcfd30ef1405c81ba711c370397cabba277e854#3dcfd30ef1405c81ba711c370397cabba277e854"
+source = "git+https://github.com/juspay/connector-service?rev=772548a7d4139906ec1abc4b45a4549f91d8c777#772548a7d4139906ec1abc4b45a4549f91d8c777"
dependencies = [
"grpc-api-types",
]
@@ -10240,7 +10250,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3dcfd30ef1405c81ba711c370397cabba277e854#3dcfd30ef1405c81ba711c370397cabba277e854"
+source = "git+https://github.com/juspay/connector-service?rev=772548a7d4139906ec1abc4b45a4549f91d8c777#772548a7d4139906ec1abc4b45a4549f91d8c777"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
@@ -10256,7 +10266,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3dcfd30ef1405c81ba711c370397cabba277e854#3dcfd30ef1405c81ba711c370397cabba277e854"
+source = "git+https://github.com/juspay/connector-service?rev=772548a7d4139906ec1abc4b45a4549f91d8c777#772548a7d4139906ec1abc4b45a4549f91d8c777"
dependencies = [
"serde",
"strum 0.26.3",
@@ -10267,13 +10277,14 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?rev=3dcfd30ef1405c81ba711c370397cabba277e854#3dcfd30ef1405c81ba711c370397cabba277e854"
+source = "git+https://github.com/juspay/connector-service?rev=772548a7d4139906ec1abc4b45a4549f91d8c777#772548a7d4139906ec1abc4b45a4549f91d8c777"
dependencies = [
"anyhow",
"base64 0.21.7",
"blake3",
"bytes 1.10.1",
"chrono",
+ "config_patch_derive",
"error-stack 0.4.1",
"hex",
"http 1.3.1",
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 9ab395fad1..ec4b15e720 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 = "3dcfd30ef1405c81ba711c370397cabba277e854", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "772548a7d4139906ec1abc4b45a4549f91d8c777", 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 b803c323e3..fbb6a84aae 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -29,7 +29,7 @@ serde_json = "1.0.140"
strum = { version = "0.26", features = ["derive"] }
thiserror = "1.0.69"
time = "0.3.41"
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "3dcfd30ef1405c81ba711c370397cabba277e854", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "772548a7d4139906ec1abc4b45a4549f91d8c777", 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"] }
# First party crates
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 6cb1269e88..61d2de5f6d 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 = "3dcfd30ef1405c81ba711c370397cabba277e854", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "3dcfd30ef1405c81ba711c370397cabba277e854", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", rev = "772548a7d4139906ec1abc4b45a4549f91d8c777", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", rev = "772548a7d4139906ec1abc4b45a4549f91d8c777", 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 1cfbf4fced..17385c290a 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -386,6 +386,7 @@ impl
.transpose()?
.map(|payment_channel| payment_channel.into()),
connector_metadata: HashMap::new(),
+ locale: router_data.request.locale.clone(),
})
}
}
@@ -549,6 +550,7 @@ impl
enable_partial_authorization: None,
payment_channel: None,
billing_descriptor: None,
+ locale: None,
})
}
}
@@ -1259,6 +1261,7 @@ impl
connector_order_reference_id: Some(router_data.connector_request_reference_id.clone()),
enable_partial_authorization: None,
payment_channel: None,
+ locale: None,
})
}
}
@@ -1433,6 +1436,7 @@ impl
.map(payments_grpc::PaymentChannel::foreign_try_from)
.transpose()?
.map(|payment_channel| payment_channel.into()),
+ locale: router_data.request.locale.clone(),
})
}
}
@@ -1590,6 +1594,7 @@ impl
connector_order_reference_id: router_data.request.order_id.clone(),
enable_partial_authorization: None,
payment_channel: None,
+ locale: None,
})
}
}
@@ -1725,6 +1730,12 @@ impl
payment_channel: router_data.request.payment_channel.as_ref().map(payments_grpc::PaymentChannel::foreign_try_from)
.transpose()?
.map(|payment_channel| payment_channel.into()),
+ locale: None,
+ connector_testing_data: router_data
+ .request
+ .connector_testing_data
+ .as_ref()
+ .map(|data| unified_connector_service_masking::Secret::new(data.peek().to_string())),
})
}
}
@@ -1909,6 +1920,23 @@ impl
.map(|shipping_cost| shipping_cost.get_amount_as_i64()),
authentication_data,
connector_metadata: HashMap::new(),
+ locale: router_data.request.locale.clone(),
+ connector_testing_data: router_data.request.connector_testing_data.as_ref().map(
+ |data| unified_connector_service_masking::Secret::new(data.peek().to_string()),
+ ),
+ merchant_account_id: router_data.request.merchant_account_id.as_ref().map(
+ |merchant_account_id| {
+ unified_connector_service_masking::Secret::new(
+ merchant_account_id.clone().expose(),
+ )
+ },
+ ),
+ merchant_configered_currency: router_data
+ .request
+ .merchant_config_currency
+ .map(payments_grpc::Currency::foreign_try_from)
+ .transpose()?
+ .map(|currency| currency.into()),
})
}
}
@@ -2032,9 +2060,9 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServicePreAuthenticateRe
attempt_status,
connector_transaction_id: resource_id.get_optional_response_id(),
connector_response_reference_id,
- network_decline_code: None,
- network_advice_code: None,
- network_error_message: None,
+ network_decline_code: response.network_decline_code.clone(),
+ network_advice_code: response.network_advice_code.clone(),
+ network_error_message: response.network_error_message.clone(),
connector_metadata: None,
})
} else {
@@ -2195,9 +2223,9 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceAuthorizeResponse
attempt_status,
connector_transaction_id: resource_id.get_optional_response_id(),
connector_response_reference_id,
- network_decline_code: None,
- network_advice_code: None,
- network_error_message: None,
+ network_decline_code: response.network_decline_code.clone(),
+ network_advice_code: response.network_advice_code.clone(),
+ network_error_message: response.network_error_message.clone(),
connector_metadata: None,
})
} else {
@@ -2553,9 +2581,9 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceRepeatEverythingR
attempt_status,
connector_transaction_id: resource_id.get_optional_response_id(),
connector_response_reference_id,
- network_decline_code: None,
- network_advice_code: None,
- network_error_message: None,
+ network_decline_code: response.network_decline_code.clone(),
+ network_advice_code: response.network_advice_code.clone(),
+ network_error_message: response.network_error_message.clone(),
connector_metadata: None,
})
} else {
@@ -3413,6 +3441,14 @@ impl transformers::ForeignTryFrom<AuthenticationData> for payments_grpc::Authent
acs_transaction_id: authentication_data.acs_trans_id,
transaction_id: None,
ucaf_collection_indicator: None,
+ exemption_indicator: authentication_data
+ .exemption_indicator
+ .map(payments_grpc::ExemptionIndicator::foreign_from)
+ .map(i32::from),
+ network_params: authentication_data
+ .cb_network_params
+ .map(payments_grpc::NetworkParams::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -3444,6 +3480,8 @@ impl transformers::ForeignTryFrom<router_request_types::UcsAuthenticationData>
acs_transaction_id: authentication_data.acs_trans_id,
transaction_id: authentication_data.transaction_id,
ucaf_collection_indicator: authentication_data.ucaf_collection_indicator,
+ exemption_indicator: None,
+ network_params: None,
})
}
}
@@ -3588,9 +3626,9 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServicePostAuthenticateR
attempt_status,
connector_transaction_id: resource_id.get_optional_response_id(),
connector_response_reference_id,
- network_decline_code: None,
- network_advice_code: None,
- network_error_message: None,
+ network_decline_code: response.network_decline_code.clone(),
+ network_advice_code: response.network_advice_code.clone(),
+ network_error_message: response.network_error_message.clone(),
connector_metadata: None,
})
} else {
@@ -3630,6 +3668,8 @@ impl transformers::ForeignTryFrom<payments_grpc::AuthenticationData>
acs_transaction_id,
transaction_id,
ucaf_collection_indicator,
+ exemption_indicator: _,
+ network_params: _,
} = response;
let trans_status = trans_status
.map(payments_grpc::TransactionStatus::try_from)
@@ -3703,6 +3743,71 @@ impl ForeignFrom<common_enums::TransactionStatus> for payments_grpc::Transaction
}
}
+impl ForeignFrom<common_enums::ExemptionIndicator> for payments_grpc::ExemptionIndicator {
+ fn foreign_from(value: common_enums::ExemptionIndicator) -> Self {
+ match value {
+ common_enums::ExemptionIndicator::LowValue => Self::LowValue,
+ common_enums::ExemptionIndicator::SecureCorporatePayment => {
+ Self::SecureCorporatePayment
+ }
+ common_enums::ExemptionIndicator::TrustedListing => Self::TrustedListing,
+ common_enums::ExemptionIndicator::TransactionRiskAssessment => {
+ Self::TransactionRiskAssessment
+ }
+ common_enums::ExemptionIndicator::ThreeDsOutage => Self::ThreeDsOutage,
+ common_enums::ExemptionIndicator::ScaDelegation => Self::ScaDelegation,
+ common_enums::ExemptionIndicator::OutOfScaScope => Self::OutOfScaScope,
+ common_enums::ExemptionIndicator::Other => Self::Other,
+ common_enums::ExemptionIndicator::LowRiskProgram => Self::LowRiskProgram,
+ common_enums::ExemptionIndicator::RecurringOperation => Self::RecurringOperation,
+ }
+ }
+}
+
+impl ForeignFrom<common_enums::CavvAlgorithm> for payments_grpc::CavvAlgorithm {
+ fn foreign_from(value: common_enums::CavvAlgorithm) -> Self {
+ match value {
+ common_enums::CavvAlgorithm::Zero => Self::Zero,
+ common_enums::CavvAlgorithm::One => Self::One,
+ common_enums::CavvAlgorithm::Two => Self::Two,
+ common_enums::CavvAlgorithm::Three => Self::Three,
+ common_enums::CavvAlgorithm::Four => Self::Four,
+ common_enums::CavvAlgorithm::A => Self::A,
+ }
+ }
+}
+
+impl transformers::ForeignTryFrom<api_models::payments::CartesBancairesParams>
+ for payments_grpc::CartesBancairesParams
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(
+ value: api_models::payments::CartesBancairesParams,
+ ) -> Result<Self, Self::Error> {
+ Ok(Self {
+ cavv_algorithm: payments_grpc::CavvAlgorithm::foreign_from(value.cavv_algorithm).into(),
+ cb_exemption: value.cb_exemption,
+ cb_score: value.cb_score,
+ })
+ }
+}
+
+impl transformers::ForeignTryFrom<api_models::payments::NetworkParams>
+ for payments_grpc::NetworkParams
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(value: api_models::payments::NetworkParams) -> Result<Self, Self::Error> {
+ Ok(Self {
+ cartes_bancaires: value
+ .cartes_bancaires
+ .map(payments_grpc::CartesBancairesParams::foreign_try_from)
+ .transpose()?,
+ })
+ }
+}
+
impl ForeignFrom<common_enums::PaymentMethodType> for payments_grpc::PaymentMethodType {
fn foreign_from(value: common_enums::PaymentMethodType) -> Self {
match value {
@@ -4463,9 +4568,9 @@ impl transformers::ForeignTryFrom<payments_grpc::PaymentServiceAuthenticateRespo
attempt_status,
connector_transaction_id: resource_id.get_optional_response_id(),
connector_response_reference_id,
- network_decline_code: None,
- network_advice_code: None,
- network_error_message: None,
+ network_decline_code: response.network_decline_code.clone(),
+ network_advice_code: response.network_advice_code.clone(),
+ network_error_message: response.network_error_message.clone(),
connector_metadata: None,
})
} else {