Wallet SystemWallet System
Buy Now
View Demo
  • Getting Started

    • Introduction
    • Quick Start
    • Features
    • Installation
    • First-Time Setup
    • Admin Tour
  • Wallet Core

    • Core Wallet
    • Wallet Payment Gateway
    • Recharge / Top-up
    • Wallet Transfer
    • My Wallet Page
    • Shortcodes
  • Earn & Reward

    • Cashback Engine
    • Referral Program
    • Multilevel Referral
    • Daily Login Reward
    • Invite Friends
    • Deposit / Top-up Bonus
  • Spend & Payout

    • Checkout Discount
    • Checkout Restriction
    • Withdrawal
    • PayPal Payout
    • Stripe Payout
    • Refund to Wallet
    • Buy Now Pay Later
  • Identity & Mobile

    • KYC
    • QR Code Payments
  • Wallet Central

    • Overview
    • Endpoint & Routing
    • CTA Discovery
    • Home Dashboard
    • Add Funds
    • Withdraw
    • Withdrawals List
    • Send Money
    • QR Pay
    • Payment Requests
    • Refer & Earn
    • Transactions
    • Settings
    • KYC Flow
    • Architecture
    • Tweaks & Responsive
    • Security
    • Admin Controls
  • Admin Tools

    • Admin Settings (index)
    • Bulk Credit / Debit
    • Analytics Dashboard
  • Settings Tabs

    • General
    • Recharge
    • Checkout
    • Withdrawal
    • Payout (PayPal/Stripe)
    • KYC
    • Cashback
    • Referral
    • Multilevel
    • BNPL
    • QR Pay
    • Notifications
    • Wallet Central
    • Integrations
    • API Keys
  • Notifications

    • Email Notifications
    • SMS Notifications
  • Developer

    • REST API
    • Filters & Hooks
  • Help

    • Troubleshooting
    • FAQ
    • Glossary
Support
Buy Now
View Demo
  • Getting Started

    • Introduction
    • Quick Start
    • Features
    • Installation
    • First-Time Setup
    • Admin Tour
  • Wallet Core

    • Core Wallet
    • Wallet Payment Gateway
    • Recharge / Top-up
    • Wallet Transfer
    • My Wallet Page
    • Shortcodes
  • Earn & Reward

    • Cashback Engine
    • Referral Program
    • Multilevel Referral
    • Daily Login Reward
    • Invite Friends
    • Deposit / Top-up Bonus
  • Spend & Payout

    • Checkout Discount
    • Checkout Restriction
    • Withdrawal
    • PayPal Payout
    • Stripe Payout
    • Refund to Wallet
    • Buy Now Pay Later
  • Identity & Mobile

    • KYC
    • QR Code Payments
  • Wallet Central

    • Overview
    • Endpoint & Routing
    • CTA Discovery
    • Home Dashboard
    • Add Funds
    • Withdraw
    • Withdrawals List
    • Send Money
    • QR Pay
    • Payment Requests
    • Refer & Earn
    • Transactions
    • Settings
    • KYC Flow
    • Architecture
    • Tweaks & Responsive
    • Security
    • Admin Controls
  • Admin Tools

    • Admin Settings (index)
    • Bulk Credit / Debit
    • Analytics Dashboard
  • Settings Tabs

    • General
    • Recharge
    • Checkout
    • Withdrawal
    • Payout (PayPal/Stripe)
    • KYC
    • Cashback
    • Referral
    • Multilevel
    • BNPL
    • QR Pay
    • Notifications
    • Wallet Central
    • Integrations
    • API Keys
  • Notifications

    • Email Notifications
    • SMS Notifications
  • Developer

    • REST API
    • Filters & Hooks
  • Help

    • Troubleshooting
    • FAQ
    • Glossary
Support
  • Getting Started

    • Introduction
    • Quick Start — Wallet Live in 5 Minutes
    • Features
    • Installation
    • First-Time Setup
    • Admin Tour
  • Wallet Core

    • Core Wallet
    • Wallet Payment Gateway
    • Recharge / Top-up
    • Wallet Transfer
    • My Wallet Page
    • Shortcodes
  • Earn & Reward

    • Cashback Engine
    • Referral Program
    • Multilevel Referral
    • Daily Login Reward
    • Invite Friends
    • Deposit / Top-up Bonus
  • Spend & Payout

    • Checkout Discount
    • Checkout Restriction
    • Withdrawal
    • PayPal Payout
    • Stripe Payout
    • Refund to Wallet
    • Buy Now Pay Later (BNPL)
  • Identity & Mobile

    • KYC (Know Your Customer)
    • QR Code Payments
  • Wallet Central

    • Wallet Central Overview
    • Endpoint & Routing
    • CTA Discovery
    • Home Dashboard
    • Add Funds
    • Withdraw
    • Withdrawals List + Detail
    • Send Money
    • QR Pay
    • Payment Requests
    • Refer & Earn
    • Transactions
    • Settings (customer)
    • KYC Flow
    • Architecture
    • Tweaks & Responsive
    • Security
    • Admin Controls
  • Admin Tools

    • Admin Settings
    • Bulk Credit / Debit
    • Analytics Dashboard
  • Settings Tabs

    • General Settings
    • Recharge Settings
    • Checkout Settings
    • Withdrawal Settings
    • Payout Settings (PayPal + Stripe)
    • KYC Settings
    • Cashback Settings
    • Referral Settings
    • Multilevel Settings
    • BNPL Settings
    • QR Pay Settings
    • Notifications Settings
    • Wallet Central Settings
    • Third-Party Integrations
    • API Keys
  • Notifications

    • Email Notifications
    • SMS Notifications
  • Developer

    • REST API
    • Filters & Hooks
  • Help

    • Troubleshooting
    • FAQ
    • Glossary

Architecture

Developer reference

This page documents Wallet Central's internal PHP / asset structure. If you're an admin or store owner, you can skip — the customer-facing UI works without touching anything here.

The PHP + asset structure of wkwc_wallet_central/. Loader → endpoint → router → views → partials.

Folder Layout

wkwc_wallet_central/
├─ class-wkwp-central-loader.php   ← entry point
├─ index.php
├─ assets/
│  ├─ css/
│  └─ js/
├─ includes/
│  ├─ class-wkwp-central-i18n.php
│  ├─ class-wkwp-central-context.php
│  ├─ class-wkwp-central-router.php
│  ├─ class-wkwp-central-renderer.php
│  ├─ class-wkwp-central-assets.php
│  ├─ class-wkwp-central-cta-button.php
│  ├─ class-wkwp-central-endpoint.php
│  ├─ class-wkwp-central-bridge.php
│  ├─ class-wkwp-central-settings-ajax.php
│  ├─ partials/  (16 partial classes)
│  └─ views/     (12 view classes)
└─ templates/
   ├─ chrome.php
   └─ index.php

Boot Sequence

WKWP_Central_Loader::__construct():

  1. Load files — every class file required once
  2. Check enable flag (_wkwp_central_enable) — exit if off
  3. Boot singletons in order:
    • WKWP_Central_Endpoint — registers rewrite + template_redirect
    • WKWP_Central_Assets — registers CSS/JS bundles
    • WKWP_Central_CTA_Button — wires the legacy My Wallet CTA
    • WKWP_Central_Bridge — bridges into other Webkul modules (referral, KYC, etc.)
    • WKWP_Central_Settings_Ajax — wires the customer-side settings AJAX

Class Map

ClassRole
WKWP_Central_LoaderSingleton entry point. Loads + boots everything
WKWP_Central_I18nTranslates strings, registers WPML / Polylang contexts
WKWP_Central_ContextPer-request context object — current view, user, balance, KYC status
WKWP_Central_RouterReads query vars, resolves to view slug, builds URLs
WKWP_Central_EndpointRewrite rules, template_redirect interception, render dispatch
WKWP_Central_RendererRenders the chrome + view + partials
WKWP_Central_AssetsEnqueues bundle CSS/JS, lazy-loads html5-qrcode for QR view
WKWP_Central_CTA_ButtonInjects the discovery banner on legacy My Wallet
WKWP_Central_BridgeHooks into wallet engine actions to power KPIs / pending counts
WKWP_Central_Settings_AjaxHandles wp_ajax_wkwp_central_settings_save — debounced toggles

Views (one per route)

includes/views/:

View slugFile
homeclass-wkwp-central-view-home.php
transactionsclass-wkwp-central-view-transactions.php
sendclass-wkwp-central-view-send.php
withdrawclass-wkwp-central-view-withdraw.php
withdrawalsclass-wkwp-central-view-withdrawals.php
withdrawal-detailclass-wkwp-central-view-withdrawal-detail.php
add-to-walletclass-wkwp-central-view-add-funds.php
requestsclass-wkwp-central-view-requests.php
qrclass-wkwp-central-view-qr.php
referralclass-wkwp-central-view-referral.php
settingsclass-wkwp-central-view-settings.php
kycclass-wkwp-central-view-kyc.php

Each view exposes a single static render( WKWP_Central_Context $ctx ) method called by the renderer.

Partials (composable building blocks)

includes/partials/:

PartialUsed by
Partial_Iconsshared icon SVG library
Partial_Greetinghome, transactions
Partial_Herohome (3 variants)
Partial_Action_Gridhome (2×2 tiles)
Partial_Add_Fundshome + add-to-wallet
Partial_Activityhome + transactions
Partial_Referralhome + referral
Partial_Modal_KYCevery gated view
Partial_Modal_Redeemhome (Redeem code dialog)
Partial_Tweaksevery view (density / accent / variant picker)
Partial_Quick_Actionssidebar
Partial_Right_Railhome + transactions
Partial_KPIshome (4-card strip)
Partial_Quick_Topuphome (mini Add Funds)
Partial_Pending_Requestshome right-rail
Partial_Saved_Payeeshome right-rail + send
Partial_Linked_Accountshome right-rail + settings
Partial_Limitshome right-rail + settings
Partial_Refundablehome right-rail
Partial_Help_Stripevery view (FAQ / Support / Admin pills)

Templates

templates/:

FilePurpose
index.phpOuter <!doctype html> + <head> + <body class="wcc-body"> + boot of root mount
chrome.phpSidebar + top bar + view container — rendered inside <body>

Templates are simple — most logic lives in Renderer and partials.

Render Flow

WKWP_Central_Endpoint::maybe_render:

1. Check query var wkwp_central=1 → bail if not present
2. Check auth → redirect anon to wp_login_url
3. Build context: WKWP_Central_Context::for_user( $current_user )
   - balance, kyc status, locks, settings, currency, etc.
4. Resolve view: WKWP_Central_Router::resolve()
5. Send headers (no-cache, content-type)
6. Include templates/index.php
   - includes templates/chrome.php
     - calls Renderer::render( $view, $ctx )
       - Renderer dispatches to View_<view>::render( $ctx )
       - View calls Partials it needs
7. exit

Asset Bundles

WKWP_Central_Assets::register:

HandleTypeLoaded on
wkwp-central-coreCSS + JSevery Wallet Central page
wkwp-central-homeCSS + JShome view only
wkwp-central-add-fundsCSS + JSadd-to-wallet view
wkwp-central-withdrawCSS + JSwithdraw view
wkwp-central-sendCSS + JSsend view
wkwp-central-qrCSS + JSqr view (lazy-loads html5-qrcode)
wkwp-central-referralCSS + JSreferral view
wkwp-central-settingsCSS + JSsettings view
wkwp-central-kycCSS + JSkyc view + every gated view
wkwp-central-tweaksCSS + JSevery view (Tweaks panel)

Lazy view-specific bundles keep first-paint fast — typical home page ships ~80 KB CSS + 60 KB JS.

Bridge Class

WKWP_Central_Bridge listens to wallet-engine actions and pushes them into Wallet Central caches:

Listens toAction
wkwp_wallet_balance_changedbust per-user balance cache
wkwp_kyc_status_changedbust per-user KYC gate cache
wkwc_wallet_withdrawal_approvedbust right-rail counts
wkwp_referral_reward_creditedbust referral stats cache
wkwp_central_request_createdbust pending count

Means Wallet Central never has its own duplicate event system — it shares the engine's events.

Context Object

WKWP_Central_Context is the per-request data bag passed to every view + partial:

PropertySource
user_idget_current_user_id()
display_nameget_user_meta
balancewallet meta + cache
currencyactive WC currency
kyc_status_wkwp_kyc_status
kyc_featuresresolved gate list
transfer_locked_wkwp_transfer_locked
wallet_settingsmerged admin options
pending_requests_countbridge cache
outstanding_bnplbridge cache
unread_kycbridge cache

Built once on template_redirect. Cheap to pass around (object reference, not array copy).

Central vs Engine

LayerResponsibility
Wallet engine (wkwc_wallet/, root files)Ledger writes, gateway, withdrawal handler, payouts, hooks
Wallet Central (wkwc_wallet_central/)UI surface only — never writes ledger directly

Means Wallet Central never duplicates engine logic. Every state change flows through the engine.

Adding a Custom Partial

// 1. Create partial class (file: includes/partials/class-wkwp-central-partial-points.php)
final class WKWP_Central_Partial_Points {
    public static function render( WKWP_Central_Context $ctx ) {
        ?>
        <div class="wcc-card wcc-points">
          <h3><?php esc_html_e( 'Loyalty points', 'mytheme' ); ?></h3>
          <p class="wcc-points-value"><?php echo esc_html( get_user_meta( $ctx->user_id, '_my_points', true ) ); ?></p>
        </div>
        <?php
    }
}

// 2. Register the file (filter the loader file list)
add_filter( 'wkwp_central_files', function( $files, $base ) {
    $files[] = $base . 'partials/class-wkwp-central-partial-points.php';
    return $files;
}, 10, 2 );

// 3. Render it inside an existing view
add_action( 'wkwp_central_render_view', function( $view, $ctx ) {
    if ( 'home' !== $view ) return;
    WKWP_Central_Partial_Points::render( $ctx );
}, 10, 2 );

Hooks (architecture-level)

HookTypeWhen
wkwp_central_filesfiltermutate the loader's file include list
wkwp_central_bootactionafter all singletons booted
wkwp_central_render_viewactioninside the renderer per view
wkwp_central_context_builtactionafter Context constructed
wkwp_central_send_headersactioninject extra HTTP headers

Performance

MetricTarget
First paint (home)< 200ms (cached context)
TTI (home)< 400ms
Total CSS~80 KB gzip per view
Total JS~60 KB gzip per view
API calls per view0 (server-rendered)

Lazy-load policy:

  • View-specific bundles only on their view
  • html5-qrcode library only on qr view
  • Tweaks panel JS deferred (no blocking)

Test Plan

  1. /wallet-central/ → confirm 1 CSS + 2 JS bundles loaded (core + home + tweaks)
  2. /wallet-central/qr/ → confirm html5-qrcode lazy-loaded
  3. /wallet-central/foo/ → router falls back to home
  4. Disable plugin → confirm /wallet-central/ 404s
  5. Toggle _wkwp_central_enable=0 → confirm rewrite rules removed (404s)

Related

  • Endpoint & Routing
  • Home Dashboard
  • Tweaks & Responsive
  • Security
Prev
KYC Flow
Next
Tweaks & Responsive