feat(MED-131): remove fake url
This commit is contained in:
@@ -14,11 +14,6 @@ const siteUrl = process.env.NEXT_PUBLIC_SITE_URL!;
|
||||
const ANALYSIS_PACKAGES_TYPE_HANDLE = 'analysis-packages';
|
||||
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
|
||||
.object({
|
||||
emailSender: z
|
||||
@@ -109,7 +104,7 @@ const handleOrderToken = async (orderToken: string) => {
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { language } = await createI18nServerInstance();
|
||||
const baseUrl = new URL(env.siteUrl.replace("localhost", LOCAL_MONTONIO_REDIRECT_FAKE_ORIGIN));
|
||||
const baseUrl = new URL(env.siteUrl);
|
||||
try {
|
||||
const orderToken = new URL(request.url).searchParams.get('order-token');
|
||||
if (!orderToken) {
|
||||
|
||||
@@ -38,8 +38,8 @@ export class MontonioOrderHandlerService {
|
||||
locale,
|
||||
// 15 minutes
|
||||
expiresAt: new Date(Date.now() + 15 * 60 * 1000).toISOString(),
|
||||
notificationUrl: notificationUrl.replace("localhost", "webhook.site"),
|
||||
returnUrl: returnUrl.replace("localhost", "webhook.site"),
|
||||
notificationUrl,
|
||||
returnUrl,
|
||||
askAdditionalInfo: false,
|
||||
merchantReference,
|
||||
type: "one_time",
|
||||
|
||||
Reference in New Issue
Block a user