diff --git a/src/app/api/webhooks/saleor/route.ts b/src/app/api/webhooks/saleor/route.ts index ff13fec..965ee40 100644 --- a/src/app/api/webhooks/saleor/route.ts +++ b/src/app/api/webhooks/saleor/route.ts @@ -412,14 +412,17 @@ export async function POST(request: NextRequest) { return NextResponse.json({ error: "Missing saleor-event header" }, { status: 400 }); } - if (!SUPPORTED_EVENTS.includes(event)) { - console.log(`Event ${event} not supported, skipping`); + // Normalize event to uppercase for comparison + const normalizedEvent = event.toUpperCase(); + + if (!SUPPORTED_EVENTS.includes(normalizedEvent)) { + console.log(`Event ${event} (normalized: ${normalizedEvent}) not supported, skipping`); return NextResponse.json({ success: true, message: "Event not supported" }); } const payload = body; - await handleSaleorWebhook(event, payload); + await handleSaleorWebhook(normalizedEvent, payload); return NextResponse.json({ success: true }); } catch (error) {