feat(user-center): add cash wallet balance separate from credits
Introduce AKSRT_Balance (user_meta aksrt_balance + balance_log) for Zibll-like pay_balance wallet. User center assets panel shows wallet and points; balance gateway/card-pass/refunds credit cash when enabled.
This commit is contained in:
1 parent
f043d2c1ab
commit
8e0f9d989d
16 files changed
+637
-74
No files matched your search
@@ -81,6 +81,10 @@ function aksrt_get_user_dashboard_view(int $user_id, array $args = []): array {
|
||||
? AKSRT_Settings::get_currency_name()
|
||||
: __('积分', 'aksrt');
|
||||
|
||||
// Cash wallet (Zibll pay_balance) — separate from points.
|
||||
$balance_enabled = $is_own_profile && class_exists('AKSRT_Balance') && AKSRT_Balance::enabled();
|
||||
$wallet_balance = $balance_enabled ? AKSRT_Balance::balance($user_id) : 0.0;
|
||||
|
||||
$user_home_manager = $include_governance && class_exists('AKSRT_User_Home')
|
||||
? AKSRT_User_Home::get_instance()
|
||||
: null;
|
||||
@@ -103,6 +107,8 @@ function aksrt_get_user_dashboard_view(int $user_id, array $args = []): array {
|
||||
'credit_balance' => $credit_balance,
|
||||
'currency_name' => $currency_name,
|
||||
'credits_enabled' => $credits_enabled,
|
||||
'balance_enabled' => $balance_enabled,
|
||||
'wallet_balance' => $wallet_balance,
|
||||
'is_own_profile' => $is_own_profile,
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user