Skip to main content
The hook system is the primary way plugins interact with OwnPay core. It uses WordPress-style actions (fire-and-forget) and filters (data pipeline) implemented by OwnPay\Event\EventManager.

API summary

Actions

Filters

Callbacks execute in ascending priority order (lower number = runs earlier). Default priority is 10.

When to use actions vs filters

Hook catalog

Payment hooks

Gateway hooks

The {slug} in gateway.webhook.{slug} is replaced with the gateway plugin’s slug (for example gateway.webhook.gateway-stripe).

Checkout hooks

System hooks

Admin hooks

Plugin lifecycle hooks

Hook registration pattern

Register all hooks inside your plugin’s register() method. Hooks are automatically attributed to your plugin slug and cleaned up on deactivation:

Architectural invariants

These constraints cannot be bypassed by any plugin:
  1. Security middleware is non-removable - you cannot remove the authentication, CSRF, or TenantScope middleware from the pipeline
  2. TenantScope is non-bypassable - every request is scoped to a brand; a plugin cannot access data from other brands
  3. Error isolation - every callback runs in its own try/catch. A failing plugin never crashes the core
  4. BCMath for money - all monetary values in hooks must use bcadd, bcsub, bcmul, bcdiv, bccomp
  5. No ledger writes from hooks - plugins cannot post directly to the double-entry ledger
Last modified on August 25, 2026