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): Enable Trustly and Interact in HS<>UCS (#10838)

Yashasvi Kapilfa0775c93138
diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rs
index 0338b91d2c..9938d92e70 100644
--- a/crates/router/src/core/unified_connector_service.rs
+++ b/crates/router/src/core/unified_connector_service.rs
@@ -771,6 +771,30 @@ pub fn build_unified_connector_service_payment_method(
payment_method: Some(PaymentMethod::Blik(blik)),
})
}
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::Trustly { country } => {
+ let trustly = payments_grpc::Trustly {
+ country: country.and_then(|c| payments_grpc::CountryAlpha2::from_str_name(&c.to_string())).map(|c| c.into()),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Trustly(trustly)),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::Interac {
+ country,
+ email,
+ } => {
+ let interac = payments_grpc::Interac {
+ country: country
+ .and_then(|c| payments_grpc::CountryAlpha2::from_str_name(&c.to_string()))
+ .map(|c| c.into()),
+ email: email.map(|e| e.expose().expose().into()),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Interac(interac)),
+ })
+ }
hyperswitch_domain_models::payment_method_data::BankRedirectData::BancontactCard {
card_number,
card_exp_month,
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 17385c290a..a01e226450 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -4955,7 +4955,10 @@ impl transformers::ForeignTryFrom<&RouterData<Execute, RefundsData, RefundsRespo
metadata: HashMap::new(),
test_mode: router_data.test_mode,
payment_method_type,
- customer_id: None,
+ customer_id: router_data
+ .customer_id
+ .as_ref()
+ .map(|id| id.get_string_repr().to_string()),
})
}
}