feat(MED-131): remove fake url

This commit is contained in:
2025-08-04 17:56:04 +03:00
parent 77d58ef5b1
commit edfc9776d3
2 changed files with 3 additions and 8 deletions

View File

@@ -14,11 +14,6 @@ const siteUrl = process.env.NEXT_PUBLIC_SITE_URL!;
const ANALYSIS_PACKAGES_TYPE_HANDLE = 'analysis-packages'; const ANALYSIS_PACKAGES_TYPE_HANDLE = 'analysis-packages';
const MONTONIO_PAID_STATUS = 'PAID'; const MONTONIO_PAID_STATUS = 'PAID';
/**
* This is needed locally, because Montonio doesn't accept "localhost" redirect/notification URLs
*/
const LOCAL_MONTONIO_REDIRECT_FAKE_ORIGIN = 'webhook.site';
const env = z const env = z
.object({ .object({
emailSender: z emailSender: z
@@ -109,7 +104,7 @@ const handleOrderToken = async (orderToken: string) => {
export async function GET(request: Request) { export async function GET(request: Request) {
const { language } = await createI18nServerInstance(); const { language } = await createI18nServerInstance();
const baseUrl = new URL(env.siteUrl.replace("localhost", LOCAL_MONTONIO_REDIRECT_FAKE_ORIGIN)); const baseUrl = new URL(env.siteUrl);
try { try {
const orderToken = new URL(request.url).searchParams.get('order-token'); const orderToken = new URL(request.url).searchParams.get('order-token');
if (!orderToken) { if (!orderToken) {

View File

@@ -38,8 +38,8 @@ export class MontonioOrderHandlerService {
locale, locale,
// 15 minutes // 15 minutes
expiresAt: new Date(Date.now() + 15 * 60 * 1000).toISOString(), expiresAt: new Date(Date.now() + 15 * 60 * 1000).toISOString(),
notificationUrl: notificationUrl.replace("localhost", "webhook.site"), notificationUrl,
returnUrl: returnUrl.replace("localhost", "webhook.site"), returnUrl,
askAdditionalInfo: false, askAdditionalInfo: false,
merchantReference, merchantReference,
type: "one_time", type: "one_time",