Platform-Controlled Payments and Wallet Infrastructure for XFA Marketplace

rohatcengizhanbucak

Member
Licensed customer

Yeni Proje.webp

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.webp
    screencapture-localhost-admin-php-2026-03-09-19_22_34.webp
    64.7 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_21_59.webp
    screencapture-localhost-admin-php-2026-03-09-19_21_59.webp
    42.8 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_21_41.webp
    screencapture-localhost-admin-php-2026-03-09-19_21_41.webp
    22.4 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_21_22.webp
    screencapture-localhost-admin-php-2026-03-09-19_21_22.webp
    31.8 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_20_52.webp
    screencapture-localhost-admin-php-2026-03-09-19_20_52.webp
    27 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_20_38.webp
    screencapture-localhost-admin-php-2026-03-09-19_20_38.webp
    26.2 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_20_14.webp
    screencapture-localhost-admin-php-2026-03-09-19_20_14.webp
    52 KB · Views: 2
  • screencapture-localhost-admin-php-2026-03-09-19_19_50.webp
    screencapture-localhost-admin-php-2026-03-09-19_19_50.webp
    55.4 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_26_10.webp
    screencapture-localhost-index-php-2026-03-09-21_26_10.webp
    32.4 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_25_48.webp
    screencapture-localhost-index-php-2026-03-09-21_25_48.webp
    18.7 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_25_19.webp
    screencapture-localhost-index-php-2026-03-09-21_25_19.webp
    31.1 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_24_19.webp
    screencapture-localhost-index-php-2026-03-09-21_24_19.webp
    43.2 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_24_09.webp
    screencapture-localhost-index-php-2026-03-09-21_24_09.webp
    24.7 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_23_38.webp
    screencapture-localhost-index-php-2026-03-09-21_23_38.webp
    33.2 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_23_25.webp
    screencapture-localhost-index-php-2026-03-09-21_23_25.webp
    33.2 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_21_34.webp
    screencapture-localhost-index-php-2026-03-09-21_21_34.webp
    24 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_21_33.webp
    screencapture-localhost-index-php-2026-03-09-21_21_33.webp
    20.6 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_21_19.webp
    screencapture-localhost-index-php-2026-03-09-21_21_19.webp
    24.2 KB · Views: 2
  • screencapture-localhost-index-php-2026-03-09-21_21_05.webp
    screencapture-localhost-index-php-2026-03-09-21_21_05.webp
    21.3 KB · Views: 2
As we all know, XFA Marketplace is one of the most seamlessly integrated commerce solutions for XenForo. Its architecture just makes sense within the XF ecosystem, which is exactly why we decided to build on top of it. Our main hurdle wasn't the marketplace itself, but rather the harsh reality of payment gateways in regions like ours. Here in Turkey—and in plenty of other countries with similar infrastructure limits—standard solutions like PayPal simply aren't an option. Relying on them to maintain a healthy marketplace flow just isn't feasible. That specific bottleneck is what pushed us to engineer this wallet ecosystem.

Instead of leaving sellers to figure out their own third-party payment collections, we routed the entire flow through our Wallet system. We built this with security at the forefront, specifically leaning on an escrow model to act as a shield against fraud, abuse, and the usual delivery disputes.

Within the XFA Marketplace environment, the wallet acts as the primary payment profile, splitting into two distinct transaction routes: direct and escrow.

For direct payments, the funds are pulled directly from the buyer's wallet and immediately credited to the seller. We use this almost exclusively for digital goods and instant-delivery items.

For physical products and custom services, the pipeline is different. When a buyer checks out, the funds aren't dropped straight into the seller's account. They move into a secure escrow layer. Once the seller marks the order as 'delivered' in the panel, the ball is in the buyer's court to confirm they received exactly what was promised. Only after both sides greenlight the transaction do the funds move into the seller’s 'blocked' balance. We keep a mandatory 7-day holding period on those funds before the block is lifted and the seller can finally request a withdrawal.

Refunds are pretty straightforward. If an item falls under the standard XFA purchase and refund policy, we just route the refunded amount directly back into the buyer's wallet balance.

The real value here is that it completely unlocks marketplace functionality for regions historically locked out by traditional payment providers. In a market where PayPal is non-existent, buyers and sellers can finally trade without the constant friction of finding a working payment gateway. They just fund their wallets and go.

Beyond standard marketplace items, we've also wired this up to support digitally stocked, code-based inventory—think Steam Wallet keys, Valorant VP codes, and other prepaid goods. This massively expands the marketplace's utility, especially for gaming communities relying heavily on instant digital top-ups.

To be completely transparent: we have zero plans to box this up and sell it as a commercial add-on. We built this purely to fix our own operational headaches. But because we've poured so much time into bulletproofing the architecture, we wanted to put it on your radar properly. If you're open to it, we'd love to discuss this directly with you to see if there's a way to formally recognize or integrate parts of this logic. We genuinely believe this could help a lot of other communities out there who are fighting the exact same payment limitations.
 
This is exactly what I want.
I hope it receives support and the desired result is achieved.
I will wait to use this commerce ecosystem on my forum :)
 
Back
Top Bottom