update fix deadcode, security

This commit is contained in:
baodev0
2026-09-28 08:26:29 +07:00
parent 3af59bd9c5
commit 82080b5b84
452 changed files with 4857 additions and 26289 deletions
-77
View File
@@ -49,22 +49,6 @@ class Telegram
}
}
public function SendInformation($product = [], $user = '', $password = '', $port = 22)
{
$msg = "Thông tin truy cập VPS vừa được khởi tạo 🎉 \n";
$msg .= "--------------------------------\n";
$msg .= "| 🌐 IP: " . $product['IpAddress']['ip'] . "\n";
$msg .= "| 📌 User: " . $user . "\n";
$msg .= "| 👉 Port: " . $port . "\n";
$msg .= "| 📺 Password: " . $password . "\n";
$msg .= "| 💾 Hết hạn: " . Carbon::parse($product['next_due_date'])->format('d/m/Y') . "\n";
$msg .= "| 💵 Hệ điều hành: " . $product['Os']['OsGroup']['name'] . $product['Os']['version'] . "\n";
$msg .= "| 📁 Đơn hàng số: #" . $product['order_id'] . "\n";
$msg .= "--------------------------------";
return $this->SendMessage($msg);
}
public function SendErrorMessage($data)
{
$msg = "Admin: Nhận được thông báo lỗi khi khởi tạo dịch vụ \n";
@@ -74,16 +58,6 @@ class Telegram
return $this->SendMessage($msg);
}
public function SendNewUserRegistration($email, $code, $verificationLink)
{
$msg = "🎉 Thành viên mới vừa đăng ký!\n";
$msg .= "📧 Email: {$email}\n";
$msg .= "🧾 Mã xác thực: {$code}\n";
$msg .= "🔗 Link xác thực: {$verificationLink}";
return $this->SendMessage($msg);
}
public function SendTrialRegistration($client, array $trialConfig = [])
{
$msg = "🧪 Khách hàng vừa đăng ký dùng thử Cloud VPS!\n";
@@ -119,17 +93,6 @@ class Telegram
return $this->SendMessage($msg);
}
public function SendCustomerRecharge($customer, $amount)
{
$msg = "💰 Khách hàng vừa nạp tiền vào tài khoản\n";
$msg .= "👤 Tên: {$customer->firstname} {$customer->lastname}\n";
$msg .= "📧 Email: {$customer->email}\n";
$msg .= "💵 Số tiền: " . number_format($amount, 0, ',', '.') . " VNĐ\n";
$msg .= "🕒 Thời gian: " . Carbon::now()->format('d/m/Y H:i:s');
return $this->SendMessage($msg);
}
public function SendJobRunInfo($jobName, $status, $additionalInfo = null)
{
$msg = "⚙️ Thông báo chạy job: {$jobName}\n";
@@ -143,44 +106,6 @@ class Telegram
return $this->SendMessage($msg);
}
public function SendOrderPaidNotification($invoice)
{
$invoiceItem = $invoice->invoiceItem()->with([
'vps',
'hosting',
'os.osGroup',
'addons.addonItems'
])->first();
if (!$invoiceItem) {
return $this->SendErrorMessage('Không tìm thấy invoice item từ invoice ID: ' . $invoice->id);
}
$product = $invoiceItem->product;
$os = $invoiceItem->os;
$osGroup = $os?->osGroup;
$addons = $invoiceItem->addons;
$msg = "💵 Khách đã thanh toán đơn hàng thành công!\n";
$msg .= "--------------------------------\n";
$msg .= "🧾 Đơn hàng: #{$invoice->order_num}\n";
$msg .= "📦 Sản phẩm: #{$product?->id} - {$product?->name}\n";
$msg .= "🧠 Hệ điều hành: {$osGroup?->name} {$os?->version}\n";
$msg .= "💰 Tổng tiền: " . number_format($invoice->total, 0, ',', '.') . " VNĐ\n";
$msg .= "🧍 Khách: {$invoice->customer?->firstname} {$invoice->customer?->lastname} ({$invoice->customer?->email})\n";
$msg .= "🕒 Ngày thanh toán: " . Carbon::parse($invoice->date_paid)->format('d/m/Y H:i:s') . "\n";
if ($addons && $addons->count()) {
$msg .= "➕ Addons:\n";
foreach ($addons as $addon) {
$msg .= "- {$addon->addonItems->name} (x{$addon->qty}) - " . number_format($addon->price, 0, ',', '.') . " VNĐ\n";
}
}
$msg .= "--------------------------------";
return $this->SendMessage($msg);
}
/**
* Notify one step of the VM rebuild pipeline (success or failure).
*/
@@ -245,6 +170,4 @@ class Telegram
return null;
}
}
}