How WemX Works
The core building blocks of WemX and how a sale flows from catalog to provisioned service.
WemX sells digital products, takes payment for them, and then provisions and maintains the service automatically for as long as the customer keeps paying. Before you configure anything, it helps to know the handful of objects everything else is built on.
The building blocks
| Concept | What it is | Where to manage it |
|---|---|---|
| Category | A group of packages shown together on the storefront, such as "Game Servers" or "VPS". | Admin → Categories |
| Package | A product you sell. It belongs to a category and is linked to one server connection. | Admin → Packages |
| Price | A billing option on a package, for example €5 monthly or €50 annually. A package can have several prices. | Package → Prices |
| Configurable option | An extra choice the customer makes at checkout, such as RAM, location or version. Options can add to the price. | Package → Config Options |
| Server extension | The integration that does the actual provisioning, for example Pterodactyl, Proxmox, cPanel or the built-in Universal module. | Admin → Servers → Installed Servers |
| Server connection | One configured instance of a server extension, with its own credentials. You can have many connections for the same extension. | Admin → Servers → Server Connections |
| Gateway | A payment provider integration, for example Stripe, PayPal or Balance. | Admin → Gateways → Installed Gateways |
| Gateway config | One configured, customer-facing instance of a gateway, with its own name and API keys. | Admin → Gateways → Gateway Configs |
| Order | A customer's purchased service. It has a status, a billing cycle and a due date. | Admin → Orders |
| Payment | A single charge, which doubles as the invoice. Every checkout, renewal and top-up creates one. | Admin → Payments |
| Subscription | A recurring agreement at a payment provider that renews an order automatically. | Admin → Subscriptions |
| Extension | A plug-in that adds a server integration, a payment gateway or a whole feature module. | Admin → Installed Extensions / Marketplace |
Category ─┬─ Package ─┬─ Price (monthly, yearly, one-time…)
│ ├─ Configurable options
│ └─ Server connection ── Server extension (Pterodactyl, Proxmox…)
│
Customer ── Cart ── Payment (invoice) ── Gateway config ── Gateway extension (Stripe…)
│
└─ on success ─▶ Order ─▶ provisioned on the server connectionThe life of an order
The customer builds a cart. They browse categories, open a package, choose a price and any configurable options, and add it to the cart. Guests can shop without an account.
Checkout creates a payment. The customer enters billing details and picks a gateway. WemX checks stock and per-customer limits, calculates sales tax, and creates a payment (invoice) for the cart total. A guest's account is created at this point.
The gateway collects the money. The customer is sent to the provider, for example Stripe Checkout. When the provider confirms through its webhook or a return callback, WemX marks the payment as paid.
Orders are created and provisioned. For each item in the cart WemX creates an order with the status pending and queues a background job. The job sets the order to processing, calls the server extension's create method (for example to create a Pterodactyl server), and then sets the order to active.
The order renews or expires. Recurring orders have a due date. The customer renews manually, pays from their account balance automatically, or attaches a subscription. If the due date passes, the scheduler suspends the order after a grace period and terminates it later.
Order statuses
| Status | Meaning |
|---|---|
pending | Paid and created, waiting for the background job to provision it. |
processing | The server extension is creating the service right now. |
active | The service is running and in good standing. |
suspended | The service was suspended because it is past due or an admin suspended it. Data is kept. |
terminated | The service was deleted on the server. This is final. |
failed | Provisioning threw an error. Open the order's Incident logs tab, fix the cause, then click Try again. |
What runs in the background
WemX depends on two background processes. Without them, orders are never provisioned and expired services are never suspended.
- Queue worker (
php artisan queue:work) runs provisioning jobs (create, suspend, unsuspend and terminate) and sends emails. The admin dashboard shows a Queue worker is not running alert if it stops. - Scheduler (a cron entry that runs
php artisan schedule:runevery minute) runs the billing automation: suspensions, terminations, balance renewals, currency rate updates, mass mail delivery and server health checks. See Billing automation.
If orders stay in pending forever, the queue worker is almost always the cause. Start it, or check the systemd service from the installation guide.
Two areas, one application
- Client area (
/): the storefront and customer dashboard. Customers browse, check out, manage services, pay invoices, top up their balance and open tickets. - Admin area (
/admin): the back office. Only staff can open it, meaning the primary admin account or any user who has a staff role. For security, staff must re-enter their password at the start of each admin session.