POS extensions in .NET: sale hooks and Admin pages

Write .NET extensions for the StillDeep POS engine: hook into sale actions, add Admin sections and pages, ship catalog items, install from the 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 sync at each startup and protected from manual editing.
  • Extend a website a register serves. On a website register, add a script to every page (served by the host with its integrity hash), a small POST endpoint, and inspect each request after its response.
  • 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 extension.

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 the only packages 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.

The catalog and every package are signed (RSA-3072 and ML-DSA-65) and checked before loading.

Presence and integrity

An active extension is required on every register, used or not. The list of required extensions, with their fingerprints, lives in the register's SQLite, and everything is checked before a single DLL loads.

  • Missing. Online, the register installs it again. Offline, it takes it back from the package it keeps; with no package, it refuses to start and says why. Only the very first start can run without one.
  • Altered. A fingerprint that no longer matches, a DLL added alongside, or a missing or invalid signature is treated as a security incident. No code of the extension loads, the folder goes to quarantine to keep the evidence, and an alert appears in the Admin with the register, the extension and the expected and found fingerprints. Online, the trusted version is installed again, then the register starts. Offline, it refuses to start and asks the user to notify a manager; the alert goes out at its next online start.
  • The list alone proves nothing. Anyone who can write to the folder can also write to the register's database. The reference remains the publisher's signature and, online, the server's fingerprint. Online, the server replaces any version that does not match.

Server hosts follow the same rules. Without a usable extension, Server.Service and Reports wait without listening; the Admin opens and reinstalls it from the registry.

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.