update rm deadcode

This commit is contained in:
baodev0
2026-09-27 11:42:40 +07:00
parent 82a71244ca
commit 3af59bd9c5
129 changed files with 5194 additions and 2698 deletions
+1 -13
View File
@@ -46,8 +46,7 @@ class DomainOrderService
$domainName = $this->normalizeDomain($data['domain_name']);
$years = max(1, (int) ($data['years'] ?? 1));
$pricing = $this->findDomainPricing($domainName);
$price = (int) $pricing['firstYear'] * $years;
$price = DomainPricing::findByDomain($domainName)->orderPrice($years);
$months = $years * 12;
return DB::transaction(function () use ($customer, $product, $domainName, $price, $months, $years) {
@@ -363,17 +362,6 @@ class DomainOrderService
// Private helpers
// =========================================================================
/**
* Find pricing for the given domain using longest-match TLD.
* TLDs in settings are stored with a leading dot (e.g. ".com.vn").
*
* @throws \InvalidArgumentException if no matching TLD found
*/
private function findDomainPricing(string $domain): array
{
return DomainPricing::findByDomain($domain)->toDomainArray();
}
/**
* Normalize: lowercase, trim, strip protocol and path.
* "HTTPS://My-Site.COM.VN/path" → "my-site.com.vn"