Process a webhook event by calling the appropriate handler
The parsed webhook event
Webhook configuration with handlers
Promise that resolves when handler completes
await processWebhookEvent(event, { signatureKey: process.env.SQUARE_WEBHOOK_KEY!, handlers: { 'payment.created': async (event) => { console.log('Payment created:', event.data.id); }, },}); Copy
await processWebhookEvent(event, { signatureKey: process.env.SQUARE_WEBHOOK_KEY!, handlers: { 'payment.created': async (event) => { console.log('Payment created:', event.data.id); }, },});
Process a webhook event by calling the appropriate handler