Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

386 B
Raw Blame
import { applyPayment, verifySignature } from './payments';

export const paymentWebhook = async (request: Request) => {
  const body = await request.text();
  const secret = process.env.PAYMENT_WEBHOOK_SECRET;
  if (!secret) throw new Error('Webhook not configured');
  await verifySignature(body, request.headers.get('signature'), secret);
  return applyPayment(JSON.parse(body));
};