slowy adlı üyeden alıntı: mesajı görüntüle
succes donduğunde yazdır diyorum yazdırıyor hocam
if ($status === "success") { try { $paymentInfoStmt = $vt->prepare("SELECT * FROM payments WHERE unique_id = ?"); $paymentInfoStmt->execute([$invoiceId]); $paymentInfo = $paymentInfoStmt->fetch(PDO::FETCH_OBJ); if ($paymentInfo) { $userDetailsStmt = $vt->prepare("SELECT * FROM users WHERE id = ?"); $userDetailsStmt->execute([$paymentInfo->user_id]); $userInfo = $userDetailsStmt->fetch(PDO::FETCH_OBJ); if ($userInfo) { // Update user balance $newBalance = $userInfo->balance + $paymentInfo->amount; $updateBalanceStmt = $vt->prepare("UPDATE users SET balance = ? WHERE id = ?"); $updateBalanceStmt->execute([$newBalance, $paymentInfo->user_id]); // Update payment status $updatePaymentStatusStmt = $vt->prepare("UPDATE payments SET status = ? WHERE id = ?"); $updatePaymentStatusStmt->execute([1, $paymentInfo->id]); echo "para eklendi"; } else { echo "Kullanıcı bulunamadı."; } } else { echo "Ödeme Hatası."; } } catch (PDOException $e) { echo "Veritabanı hatası: " . $e->getMessage(); } } else { echo "Ödeme Başarısız."; }
Bu şekilde dener misiniz? Nedense r10'da kod düzgün gözükmüyor.