From 6d5011aef26de3389e4941a1807f7ecddd4f6b63 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 28 Feb 2026 22:54:59 +0000 Subject: [PATCH] v57 --- api/wallet_transaction.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/wallet_transaction.php b/api/wallet_transaction.php index afed15a..8690ba7 100644 --- a/api/wallet_transaction.php +++ b/api/wallet_transaction.php @@ -1,9 +1,9 @@ false, 'error' => 'Unauthorized']); exit; } @@ -13,7 +13,6 @@ $action = $_POST['action'] ?? ''; $amount = (float)($_POST['amount'] ?? 0); if ($amount <= 0) { - header('Content-Type: application/json'); echo json_encode(['success' => false, 'error' => 'Please enter a valid amount greater than zero.']); exit; } @@ -55,7 +54,8 @@ try { } } catch (Exception $e) { - db()->rollBack(); - header('Content-Type: application/json'); + if (db()->inTransaction()) { + db()->rollBack(); + } echo json_encode(['success' => false, 'error' => $e->getMessage()]); } \ No newline at end of file