fix(pay): refund wallet on withdraw reject and show pending history
Close the freeze/refund loop when admin rejects a balance withdrawal, block concurrent open applications, and surface processing state plus server-rendered withdraw history on the wallet card.
This commit is contained in:
1 parent
d57fc6f934
commit
4da003663d
6 files changed
+514
-136
No files matched your search
@@ -734,6 +734,10 @@ class AKSRT_Balance_Service {
|
||||
if ($account === '') {
|
||||
return new WP_Error('aksrt_withdraw_account', __('请填写收款账号信息', 'aksrt'), ['status' => 400]);
|
||||
}
|
||||
// One open balance withdrawal at a time (Zibll parity).
|
||||
if (AKSRT_Withdrawal::get_instance()->has_open_withdrawal($user_id)) {
|
||||
return new WP_Error('aksrt_withdraw_pending', __('您有处理中的提现申请,请等待完成后再申请', 'aksrt'), ['status' => 409]);
|
||||
}
|
||||
$wallet = AKSRT_Balance::balance($user_id);
|
||||
if ($wallet < $amount) {
|
||||
return new WP_Error('aksrt_balance_insufficient', __('余额不足', 'aksrt'), ['status' => 402]);
|
||||
|
||||
Reference in new issue
Block a user