mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
fix(connector): [Zen] fix additional base url required for Zen apple pay checkout integration (#1394)
This commit is contained in:
@ -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"
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -175,10 +175,17 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P
|
||||
let 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(
|
||||
|
||||
Reference in New Issue
Block a user