Files
ladill-servers/app/Services/ResellerClub/ResellerClubConsoleService.php
isaaccladandCursor b6c8ac343f Extract Ladill Servers as standalone app at servers.ladill.com.
VPS and dedicated server ordering, managed panels, SSO, billing, and launcher integration — forked from hosting infrastructure with server-focused routes and dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 19:18:30 +00:00

51 lines
1.4 KiB
PHP

<?php
namespace App\Services\ResellerClub;
class ResellerClubConsoleService
{
private const DEFAULT_CONTROL_PANEL_URL = 'https://manage.resellerclub.com/customer';
public const SERVICE_DNS = 'dns';
public const SERVICE_WEB_HOSTING = 'webhosting';
public const SERVICE_MAIL_HOSTING = 'mailhosting';
public const SERVICE_WEBSITE_BUILDER = 'websitebuilder';
public function launchUrl(): string
{
return rtrim($this->configuredControlPanelUrl(), '/').'/servlet/ManageServiceServletForAPI';
}
/**
* @return array<string, string>
*/
public function buildManagedServicePayload(string $loginToken, string $orderId, string $serviceName): array
{
return [
'loginid' => $loginToken,
'orderid' => $orderId,
'service-name' => $serviceName,
];
}
public function autoLoginUrl(string $loginToken, string $role = 'customer'): string
{
return sprintf(
'%s/servlet/AutoLoginServlet?userLoginId=%s&role=%s',
rtrim($this->configuredControlPanelUrl(), '/'),
urlencode($loginToken),
urlencode($role)
);
}
private function configuredControlPanelUrl(): string
{
$value = trim((string) config('mailinfra.resellerclub_control_panel_url'));
return $value !== '' ? $value : self::DEFAULT_CONTROL_PANEL_URL;
}
}