From 964260365b519b4a19b88763fc454234b3b9612d Mon Sep 17 00:00:00 2001 From: Claudemir Todo Bom Date: Thu, 10 Oct 2024 08:52:31 -0300 Subject: [PATCH] =?UTF-8?q?fix=20Ef=C3=AD=20certificate=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/PaymentGatewayServices/EfiServices.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/services/PaymentGatewayServices/EfiServices.ts b/backend/src/services/PaymentGatewayServices/EfiServices.ts index 52867d6..35baacc 100644 --- a/backend/src/services/PaymentGatewayServices/EfiServices.ts +++ b/backend/src/services/PaymentGatewayServices/EfiServices.ts @@ -54,11 +54,14 @@ import { const webhookUrl = `${process.env.BACKEND_URL}/subscription/ticketz/webhook`; +const privateFolder = __dirname.endsWith("/dist") + ? path.resolve(__dirname, "..", "private") + : path.resolve(__dirname, "..", "..", "..", "private"); + async function getEfiOptions(): Promise { - const cert = path.join( - __dirname, - `../../../private/${await GetSuperSettingService({ key: "_efiCertFile" })}` - ); + const cert = `${privateFolder}/${await GetSuperSettingService({ + key: "_efiCertFile" + })}`; return { sandbox: false,