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/"
|
worldpay.base_url = "https://try.access.worldpay.com/"
|
||||||
trustpay.base_url = "https://test-tpgw.trustpay.eu/"
|
trustpay.base_url = "https://test-tpgw.trustpay.eu/"
|
||||||
trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/"
|
trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/"
|
||||||
|
zen.base_url = "https://api.zen-test.com/"
|
||||||
[connectors.zen]
|
zen.secondary_base_url = "https://secure.zen.com/"
|
||||||
base_url = "https://api.zen-test.com/"
|
|
||||||
|
|
||||||
[scheduler]
|
[scheduler]
|
||||||
stream = "SCHEDULER_STREAM"
|
stream = "SCHEDULER_STREAM"
|
||||||
|
|||||||
@ -421,6 +421,7 @@ pub struct Connectors {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub struct ConnectorParams {
|
pub struct ConnectorParams {
|
||||||
pub base_url: String,
|
pub base_url: String,
|
||||||
|
pub secondary_base_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Clone, Default)]
|
#[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 {
|
let endpoint = match &req.request.payment_method_data {
|
||||||
api_models::payments::PaymentMethodData::Wallet(
|
api_models::payments::PaymentMethodData::Wallet(
|
||||||
api_models::payments::WalletData::ApplePayRedirect(_),
|
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(
|
fn get_request_body(
|
||||||
|
|||||||
Reference in New Issue
Block a user