feat(MED-131): env fix v2
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user