mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-07 19:30:07 -05:00
17 lines
573 B
TypeScript
17 lines
573 B
TypeScript
import { responses } from "@/app/lib/api/response";
|
|
import { headers } from "next/headers";
|
|
|
|
import { default as webhookHandler } from "@formbricks/ee/billing/api/stripe-webhook";
|
|
|
|
export async function POST(request: Request) {
|
|
const body = await request.text();
|
|
const signature = headers().get("stripe-signature") as string;
|
|
|
|
const { status, message } = await webhookHandler(body, signature);
|
|
|
|
if (status != 200) {
|
|
return responses.badRequestResponse(message?.toString() || "Something went wrong");
|
|
}
|
|
return responses.successResponse({ message }, true);
|
|
}
|