Function: createPesaWebhookHandler()
function createPesaWebhookHandler(pesa, basePath?): (request) => Promise<Response>;Defined in: packages/pesa/src/handler.ts:26
Creates a webhook handler — the one route that must be publicly exposed.
Mount this behind no auth so providers can POST callbacks:
Bun.serve({ fetch: pesa.mountWebhook });For order creation and status queries, use pesa.createOrder() and
pesa.getPaymentStatus() in your own routes behind your own auth.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
pesa | PesaHandlerTarget | undefined | - |
basePath | string | '/pesa' | — defaults to '/pesa' |
Returns
(request) => Promise<Response>