update rm deadcode
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user