fix: auto-run and harden billing provisioning idempotency

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/a39ca073-858c-4e1e-978f-09caabb0f029

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-09 14:16:41 +00:00 committed by GitHub
parent d636f65647
commit 2a6c8440aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 130 additions and 23 deletions

View file

@ -558,10 +558,8 @@ function wh_fulfill_payment(mysqli $db, string $pfx, array $payment, string $bil
$last_order_id = $order_id;
$existing_home_id = intval($row['home_id'] ?? 0);
wh_log('info', 'order_renewed', ['order_id' => $order_id, 'new_end' => $new_end, 'home_id' => $existing_home_id]);
if ($existing_home_id <= 0) {
$dir = ($billing_dir !== '') ? $billing_dir : dirname(__DIR__);
wh_try_provision($dir, $order_id, $user_id);
}
$dir = ($billing_dir !== '') ? $billing_dir : dirname(__DIR__);
wh_try_provision($dir, $order_id, $user_id);
}
} else {
// New order: create billing_orders row