@bates-solutions/clover API Reference - v1.3.0
    Preparing search index...

    Function createWebhookProcessor

    • Create a webhook handler that verifies and processes raw webhook requests.

      An invalid signature is never dispatched — throwOnInvalidSignature only controls whether the failure throws (caught here as an error result) or is returned directly.

      Parameters

      Returns (
          rawBody: string,
          signature: string,
      ) => Promise<{ error?: string; event?: WebhookEvent; success: boolean }>

      const handleWebhook = createWebhookProcessor({
      signingSecret: process.env.CLOVER_WEBHOOK_SECRET!,
      handlers: { 'CHARGE': async (event) => { await fulfill(event); } },
      });
      const result = await handleWebhook(rawBody, signature);