Handle

Overview

The handle method processes raw webhook payloads from payment processors. It verifies webhook signatures, parses the event data, and returns a normalized response with the event type and associated payment details.

Business Use Case: When Stripe sends a webhook notification that a payment succeeded, you need to verify it's authentic and update your order status. This method handles verification and parsing.

Purpose

Challenge
Solution

Signature verification

Automatically verifies webhook authenticity

Multiple formats

Normalizes Stripe, Adyen into consistent format

Security

Validates secrets before processing

Request Fields

Field
Type
Required
Description

merchantEventId

string

Yes

Your unique event reference

payload

string/object

Yes

Raw webhook body

headers

object

Yes

HTTP headers including signature

webhookSecret

string

Yes

Webhook signing secret

Response Fields

Field
Type
Description

eventType

string

Type: payment.captured, refund.succeeded, etc.

eventResponse

object

Payment/refund/dispute details

sourceVerified

boolean

Whether signature was verified

eventStatus

string

COMPLETE, INCOMPLETE

Example

SDK Setup

Express.js Webhook Handler

Response

Event Types

Event Type
Description

payment.authorized

Payment authorized, funds held

payment.captured

Payment completed

payment.failed

Payment declined

refund.succeeded

Refund processed

dispute.created

New chargeback received

Next Steps

Last updated

Was this helpful?