OwnPay\Event\EventManager service. Action and Filter hooks allow developers to alter core system pathways without introducing hardcoded overrides inside core files.
Architectural invariants
- Strict Error Isolation: Every action callback is wrapped within a standalone try-catch. A plugin failure will never crash a critical transaction flow.
- HTML Output Trust Contract: Template-level hook points render whatever the hook callbacks emit as trusted HTML. The core
hook()renderer strips dangerous elements as defense-in-depth. - Deterministic Priority Chains: Hooks execute in ascending numerical priority. Lower number = runs earlier.
- Execution Context Identification: The
EventManagermaintains an internal execution context stack (ownerStack). - Scoped Execution Filters: Filter hooks respect active
merchant_idscopes.
System lifecycle hooks
Action hooks
Filter hooks
Payment engine hooks
Action hooks
Filter hooks
Checkout and theme hooks
Action hooks
Filter hooks
Communication hooks
Domain hooks
Auto-updater hooks
Guidelines and constraints
- Register hooks in
register()only - Never modify
$thisstate in a filter - Use BCMath for all financial values
- Do not post to the ledger from hooks
- Escape all echoed HTML
- No
eval()or OS commands - Respect filter return type
- Hooks fire only when plugin is active