Extend StillDeep with extensions

Write .NET extensions that hook into sale actions, add Admin sections and pages, ship catalog items, and get installed from the extension registry.

What an extension can do

  • Hook into sale actions. Run before an action (add an item, choose a payment method, finalize) to let it continue, refuse it, cancel it or ask the cashier a question; run after it to react to the result.
  • Add Admin sections and pages. Extra fields on Admin forms, menu entries, reports and scheduled tasks on the server.
  • Ship catalog items. An extension can add its own items to the catalog, kept in line at each startup and hidden from manual editing.
  • Keep its own data up to date. Data migrations run once per version, under a lock, for every server host at once.

The Canadian cash rounding extension is a complete example: it adds a rounding line when cash is chosen in Canadian dollars and handles refunds.

The host trusts nothing

Everything an extension writes or returns is validated by the host. An extension that throws, exceeds its time limit or writes invalid data is stopped, its registrations are removed, the failure is logged and the sale continues with the next one.

Two sides

  • Register side: a class that implements IStillDeepPlugin registers its sale hooks and interaction handlers when it starts.
  • Server side: a class that implements IServerPlugin registers Admin sections, menus, reports, tasks and entity hooks, and updates its data.

The public abstractions (StillDeep.Intelligence.Plugins.Abstractions, StillDeep.Server.Plugins.Abstractions, StillDeep.Extensions.Abstractions) are all an extension references.

Installing and distributing

Extensions are installed from the Admin, on the Extensions page, from a public catalog: dependencies are activated together, the SHA-256 checksum from the catalog is verified, and the server prepares a package for the registers. Each register fetches the active extensions after draining its outbox, and keeps what it has when offline. A package can also be added by hand.

Package signing and per-register licensing are in progress.

Hardware drivers

Drivers for devices and optional third-party integrations are extensions too. Card payments always go from the terminal to the processor, never through an extension that would see card numbers.