feat(MED-131): env fix v2

This commit is contained in:
2025-08-04 19:03:18 +03:00
parent d68ed20ca9
commit 4617c483fa
2 changed files with 8 additions and 2 deletions

View File

@@ -10,3 +10,6 @@ NEXT_PUBLIC_SUPABASE_URL=https://oqsdacktkhmbylmzstjq.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9xc2RhY2t0a2htYnlsbXpzdGpxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDY1MjgxMjMsImV4cCI6MjA2MjEwNDEyM30.LdHCTWxijFmhXdnT9KVuLRAVbtSwY7OO-oLtpd8GmO0
NEXT_PUBLIC_SITE_URL=https://test.medreport.ee
# MONTONIO
NEXT_PUBLIC_MONTONIO_ACCESS_KEY=7da5d7fa-3383-4997-9435-46aa818f4ead

View File

@@ -3,11 +3,11 @@ import axios, { AxiosError } from 'axios';
import { MontonioClientEnvSchema } from '../schema/montonio-client-env.schema';
import { MontonioServerEnvSchema } from '../schema/montonio-server-env.schema';
const { accessKey } = MontonioClientEnvSchema.parse({
const clientEnv = () => MontonioClientEnvSchema.parse({
accessKey: process.env.NEXT_PUBLIC_MONTONIO_ACCESS_KEY,
});
const { apiUrl, secretKey } = MontonioServerEnvSchema.parse({
const serverEnv = () => MontonioServerEnvSchema.parse({
apiUrl: process.env.MONTONIO_API_URL,
secretKey: process.env.MONTONIO_SECRET_KEY,
});
@@ -30,6 +30,9 @@ export class MontonioOrderHandlerService {
locale: string;
merchantReference: string;
}) {
const { accessKey } = clientEnv();
const { apiUrl, secretKey } = serverEnv();
const params = {
accessKey,
description,