Update: 2026-06-16 02:14:34

This commit is contained in:
Hamza-Ayed
2026-06-16 02:14:35 +03:00
parent fc58529b09
commit 2c657fa0b4
13 changed files with 100 additions and 31 deletions

View File

@@ -29,10 +29,10 @@ try {
}
// 2. Generate unique tokens
$paymentID1 = "budget2pt_" . time() . rand(1000, 9999);
$paymentID2 = "pt2budget_" . time() . rand(1000, 9999);
$token1 = md5(uniqid("b1", true));
$token2 = md5(uniqid("b2", true));
$paymentID1 = "budget2pt_" . time() . bin2hex(random_bytes(4));
$paymentID2 = "pt2budget_" . time() . bin2hex(random_bytes(4));
$token1 = bin2hex(random_bytes(32));
$token2 = bin2hex(random_bytes(32));
// 3. Deduct from budget (payments)
$deductAmount = -$amount;
@@ -62,6 +62,7 @@ try {
} catch (Exception $e) {
$con->rollBack();
echo json_encode(['status' => 'error', 'message' => 'Database transaction failed: ' . $e->getMessage()]);
error_log('[convertBudgetToPoints] Error: ' . $e->getMessage());
echo json_encode(['status' => 'error', 'message' => 'An internal error occurred.']);
}
?>

View File

@@ -124,6 +124,7 @@ try {
} catch (Exception $e) {
$con->rollBack();
echo json_encode(['status' => 'error', 'message' => 'Database transaction failed: ' . $e->getMessage()]);
error_log('[transfer] Error: ' . $e->getMessage());
echo json_encode(['status' => 'error', 'message' => 'An internal error occurred.']);
}
?>