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
fix(ucs): populate calida shop name from MCA metadata in ConnectorSpecificConfig (#13694)
Pa1ff165e69ca54
diff --git a/crates/router/src/core/unified_connector_service/connector_config.rs b/crates/router/src/core/unified_connector_service/connector_config.rsindex 8341157d0d..3daf025fd6 100644--- a/crates/router/src/core/unified_connector_service/connector_config.rs+++ b/crates/router/src/core/unified_connector_service/connector_config.rs@@ -111,6 +111,11 @@ pub struct PaysafeMetadata {pub account_id: PaysafePaymentMethodDetails,}+#[derive(Debug, serde::Deserialize)]+pub struct CalidaMetadata {+ shop_name: Secret<String>,+}+/// Paysafe payment method details for account_id configuration./// Contains per-currency account IDs for card, ACH, Apple Pay, Interac,/// Skrill and paysafecard.@@ -599,7 +604,10 @@ pub enum ConnectorSpecificConfig {/// Nexixpay connector configurationNexixpay { api_key: Secret<String> },/// Calida connector configuration- Calida { api_key: Secret<String> },+ Calida {+ api_key: Secret<String>,+ shop_name: Option<Secret<String>>,+ },/// Celero connector configurationCelero { api_key: Secret<String> },/// Stax connector configuration@@ -895,9 +903,19 @@ impl ForeignTryFrom<(Connector, &ConnectorAuthType, Option<&serde_json::Value>)>_ => Err(err("Fiservcommercehub requires MultiAuthKey auth type")),},Connector::Calida => match auth {- ConnectorAuthType::HeaderKey { api_key } => Ok(Self::Calida {- api_key: api_key.clone(),- }),+ ConnectorAuthType::HeaderKey { api_key } => {+ let calida_meta = metadata+ .map(|m| {+ serde_json::from_value::<CalidaMetadata>(m.clone())+ .map_err(|_| err("Invalid Calida metadata format"))+ })+ .transpose()?;++ Ok(Self::Calida {+ api_key: api_key.clone(),+ shop_name: calida_meta.as_ref().map(|m| m.shop_name.clone()),+ })+ }_ => Err(err("Calida requires HeaderKey auth type")),},Connector::Celero => match auth {