Fixed issue with application pricing

This commit is contained in:
Pinga 2025-03-14 18:26:47 +02:00
parent 8dc01d65d0
commit a0a16f4bfb
4 changed files with 190 additions and 102 deletions

View file

@ -1134,6 +1134,16 @@ class ApplicationsController extends Controller
$returnValue = getDomainPrice($db, $domainName, $tld_id, $date_add, 'create', $clid, $currency);
$price = $returnValue['price'];
if (!$price) {
$this->container->get('flash')->addMessage('error', 'Error creating domain: The price, period and currency for such TLD are not declared');
return $response->withHeader('Location', '/application/create')->withStatus(302);
}
if (($registrar_balance + $creditLimit) < $price) {
$this->container->get('flash')->addMessage('error', 'Error creating domain: Low credit: minimum threshold reached');
return $response->withHeader('Location', '/application/create')->withStatus(302);
}
try {
$db->beginTransaction();