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(connector): [Zen] fix additional base url required for Zen apple pay checkout integration (#1394)
Arjun Karthik795500797d10
diff --git a/config/development.toml b/config/development.tomlindex 1921e0791e..f72f7154bf 100644--- a/config/development.toml+++ b/config/development.toml@@ -140,9 +140,8 @@ worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"trustpay.base_url = "https://test-tpgw.trustpay.eu/"trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/"--[connectors.zen]-base_url = "https://api.zen-test.com/"+zen.base_url = "https://api.zen-test.com/"+zen.secondary_base_url = "https://secure.zen.com/"[scheduler]stream = "SCHEDULER_STREAM"diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rsindex 4d4f6d66d7..a14587cff1 100644--- a/crates/router/src/configs/settings.rs+++ b/crates/router/src/configs/settings.rs@@ -421,6 +421,7 @@ pub struct Connectors {#[serde(default)]pub struct ConnectorParams {pub base_url: String,+ pub secondary_base_url: Option<String>,}#[derive(Debug, Deserialize, Clone, Default)]diff --git a/crates/router/src/connector/zen.rs b/crates/router/src/connector/zen.rsindex d219dbaeda..1d6e40613e 100644--- a/crates/router/src/connector/zen.rs+++ b/crates/router/src/connector/zen.rs@@ -175,10 +175,17 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::Plet endpoint = match &req.request.payment_method_data {api_models::payments::PaymentMethodData::Wallet(api_models::payments::WalletData::ApplePayRedirect(_),- ) => "api/checkouts",- _ => "v1/transactions",+ ) => {+ let base_url = connectors+ .zen+ .secondary_base_url+ .as_ref()+ .ok_or(errors::ConnectorError::FailedToObtainIntegrationUrl)?;+ format!("{base_url}api/checkouts")+ }+ _ => format!("{}v1/transactions", self.base_url(connectors)),};- Ok(format!("{}{}", self.base_url(connectors), endpoint))+ Ok(endpoint)}fn get_request_body(