fix(connector): [Zen] fix additional base url required for Zen apple pay checkout integration (#1394)

This commit is contained in:
Arjun Karthik
2023-06-09 01:07:30 +05:30
committed by GitHub
parent 0ca69e6065
commit 795500797d
3 changed files with 13 additions and 6 deletions

View File

@ -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"

View File

@ -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)]

View File

@ -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(