feat(service): huỷ dịch vụ, SSL, đổi mật khẩu hosting, lịch sử thanh toán theo hình thức
- Lịch sử thanh toán hoá đơn trả thêm `method` (tự động gia hạn / số dư / admin / chuyển khoản / hoàn tiền), bỏ đuôi `(method)` khỏi ghi chú - `DnsServer::panelUrl()` = https://<domain>/ dùng cho email cấp hosting và nút Plesk của khách - Order item trả thêm `uuid`/`type` của dịch vụ để FE dẫn tới trang quản lý - Yêu cầu huỷ dịch vụ, chứng chỉ SSL, lịch sử gia hạn, đổi mật khẩu hosting cho khách Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a6b641015e
commit
b44a88bb52
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Models\ModuleHostingPleskClient;
|
||||
use App\Models\Service;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
|
||||
class HostingCredentials
|
||||
{
|
||||
public static function attach(iterable $services): void
|
||||
{
|
||||
foreach ($services as $service) {
|
||||
$service->setAttribute('hosting_credentials', self::for($service));
|
||||
}
|
||||
}
|
||||
|
||||
public static function for(Service $service): ?array
|
||||
{
|
||||
$hosting = $service->hostingAccount;
|
||||
$client = $hosting ? ModuleHostingPleskClient::forHosting($hosting) : null;
|
||||
|
||||
if (!$client) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
'host' => $hosting->server?->publicHost(),
|
||||
'ip' => $hosting->server?->ip_address,
|
||||
'panel_url' => $hosting->server?->panelUrl(),
|
||||
'username' => $client->login,
|
||||
'password' => Crypt::decryptString($client->password),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user