Building a Modular Commerce Ecosystem on XenForo
For a long time, we've wanted to build a commerce infrastructure on the forum that isn't just "functional," but truly sustainable, scalable, and reliable. XFA Marketplace became our focal point. But here’s the kicker: we didn't just write a standalone plugin. Instead of hacking the core structure or altering direct files, we built supplementary layers that act almost like "DLCs." The main engine stays intact, and we simply bolt on custom capabilities.This approach gave us a massive edge in both maintenance and update safety. Rather than forking the core marketplace logic and creating a headache for future updates, we leaned heavily into XenForo's native add-on and class extension architecture. This kept the XFA Marketplace ecosystem clean while allowing us to securely link our custom wallet, bank transfer, and E-PIN flows.
The Financial Backbone: Local Wallet
et’s talk about the Local Wallet. We didn't want a dumbed-down "balance display." We built a core that integrates natively with XenForo, utilizing an immutable ledger approach. Financial histories aren't silently mutated. Every user gets an auto-generated wallet, and funds are tracked across distinct pockets: available, escrow, pending_in, pending_out, and blocked. Everything runs through a secure service layer. It’s a rock-solid foundation not just for top-ups, but for withdrawals, holds, escrows, commissions, and accounting.
The biggest advantage of the Wallet is its Service API. Other workflows can consume it directly. We treated the architecture like a true "payment core" rather than a closed-loop feature. We even threw in a treasury layer, which means the system tracks the platform's overall cash flow, liabilities, and realized revenues entirely separate from individual user balances.
Decoupling Payments: Bank Transfer
Then there’s the Bank Transfer module. We actively avoided embedding bank transfers directly into the wallet. A manual transfer shouldn't just magically print money into a balance. Instead, it hooks into XenForo’s native PurchaseRequest and Purchasable pipelines.
A user initiates the payment, gets redirected to a manual transfer screen, and inputs their receipt, sender details, and amount. Once an admin approves it, the original purchase flow completes. If that purchase was a wallet top-up, the wallet’s service layer handles the balance bump.
Practically, this means there's no brittle dependency between the bank module and the wallet. The bridge is XenForo's native payment pipeline. The bank module handles the operational headaches (receipt collection, workflows, approvals, SLA tracking), while the wallet just processes the final financial outcome. It’s a clean separation of concerns.
The Crown Jewel: E-PIN Stock Engine
The E-PIN system (Local/RMEpinStock) is probably the most unique part of the project. It sits right on top of XFA Marketplace as an extension layer. Again, zero core file overrides. We used XF class extensions to tap into XFA\RMMarketplace classes for purchasing, order creation, and resource display. The marketplace handles the basic product flow, but E-PIN specific logic—variations, stock levels, reservations, and code reveals—is managed entirely on our layer.
This goes way beyond standard digital goods. A resource isn't just a "sold thread"; it’s cataloged with provider, region, nominal value, and variation data via xf_lw_epin_catalog_map. The actual codes? Hashed, masked, and encrypted in the xf_lw_epin_stock_item table. No plaintext mess. It's built from the ground up for strict stock security.
Checkout & Delivery UX
The checkout flow is highly controlled. If a user pays with their wallet, the stock is instantly reserved via a TTL (Time-To-Live) mechanism. It’s not "sold" until the payment clears, but it won't be accidentally snatched up by someone else either. Once cleared, the stock shifts to allocated, the order is verified, and the revenue hits the treasury. If a refund happens, unrevealed codes bounce back into stock, while revealed ones are marked as "burned" for security.
We also heavily focused on the delivery experience. Codes aren't just blindly dumped on the screen. The user reveals them securely within their order details. We log the initial reveal and any subsequent views as separate audit trails. We don't just say "item delivered"—we know exactly which code was viewed, when, and by whom.
The Big Picture
The real magic is how these pieces talk to each other. XFA Marketplace acts as the storefront and order engine. The Wallet is the financial core. BankTransfer handles secure manual deposits. RMEpinStock is the digital inventory engine. They’re tightly integrated but never entangled.
Long story short, we didn't just slap a few components together; we engineered a genuinely modular commerce ecosystem inside the forum. Our DLC approach means we can build highly specific scenarios without breaking the core add-on. If the goal was to build a pro-tier marketplace with wallet support, secure bank transfers, and variation-based E-PIN delivery... this architecture exactly hits the mark.
Attachments
-
screencapture-localhost-admin-php-2026-03-09-19_22_34.webp64.7 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_21_59.webp42.8 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_21_41.webp22.4 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_21_22.webp31.8 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_20_52.webp27 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_20_38.webp26.2 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_20_14.webp52 KB · Views: 2 -
screencapture-localhost-admin-php-2026-03-09-19_19_50.webp55.4 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_26_10.webp32.4 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_25_48.webp18.7 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_25_19.webp31.1 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_24_19.webp43.2 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_24_09.webp24.7 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_23_38.webp33.2 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_23_25.webp33.2 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_21_34.webp24 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_21_33.webp20.6 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_21_19.webp24.2 KB · Views: 2 -
screencapture-localhost-index-php-2026-03-09-21_21_05.webp21.3 KB · Views: 2
