diff --git a/automation/auto-approve-transfer.php b/automation/auto-approve-transfer.php index cd7e44d..dc20aad 100644 --- a/automation/auto-approve-transfer.php +++ b/automation/auto-approve-transfer.php @@ -52,7 +52,7 @@ try { } } - $returnValue = getDomainPrice($dbh, $name, $tld_id, $date_add, 'transfer'); + $returnValue = getDomainPrice($dbh, $name, $tld_id, $date_add, 'transfer', $reid); $price = $returnValue['price']; if (($registrar_balance + $creditLimit) < $price) { diff --git a/automation/change-domain-status.php b/automation/change-domain-status.php index a99905e..299f625 100644 --- a/automation/change-domain-status.php +++ b/automation/change-domain-status.php @@ -45,7 +45,7 @@ try { if ($set_autorenewPeriod) { list($registrar_balance, $creditLimit) = $dbh->query("SELECT accountBalance, creditLimit FROM registrar WHERE id = '$clid' LIMIT 1")->fetch(PDO::FETCH_NUM); - $returnValue = getDomainPrice($dbh, $name, $tldid, 12, 'renew'); + $returnValue = getDomainPrice($dbh, $name, $tldid, 12, 'renew', $clid); $price = $returnValue['price']; if (($registrar_balance + $creditLimit) > $price) { diff --git a/epp/src/epp-check.php b/epp/src/epp-check.php index 4e67d79..2c1bc05 100644 --- a/epp/src/epp-check.php +++ b/epp/src/epp-check.php @@ -117,7 +117,7 @@ function processHostCheck($conn, $db, $xml, $trans) { sendEppResponse($conn, $xml); } -function processDomainCheck($conn, $db, $xml, $trans) { +function processDomainCheck($conn, $db, $xml, $trans, $clid) { $domains = $xml->command->check->children('urn:ietf:params:xml:ns:domain-1.0')->check->name; $clTRID = (string) $xml->command->clTRID; @@ -374,7 +374,7 @@ function processDomainCheck($conn, $db, $xml, $trans) { $tld_id = $result['id']; // Calculate or retrieve fee for this command - $returnValue = getDomainPrice($db, $domainName, $tld_id, $date_add, $commandName); + $returnValue = getDomainPrice($db, $domainName, $tld_id, $date_add, $commandName, $clid); $price = $returnValue['price']; $sth = $db->prepare("SELECT price FROM domain_restore_price WHERE tldid = ? LIMIT 1"); diff --git a/epp/src/epp-create.php b/epp/src/epp-create.php index 3aa92ae..295fc7e 100644 --- a/epp/src/epp-create.php +++ b/epp/src/epp-create.php @@ -869,7 +869,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m $registrar_balance = $result['accountBalance']; $creditLimit = $result['creditLimit']; - $returnValue = getDomainPrice($db, $domainName, $tld_id, $date_add, 'create'); + $returnValue = getDomainPrice($db, $domainName, $tld_id, $date_add, 'create', $clid); $price = $returnValue['price']; if (!$price) { diff --git a/epp/src/epp-delete.php b/epp/src/epp-delete.php index 51e6412..9766e5d 100644 --- a/epp/src/epp-delete.php +++ b/epp/src/epp-delete.php @@ -301,7 +301,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) { $addPeriod_id = $stmt->fetchColumn(); if ($addPeriod_id) { - $returnValue = getDomainPrice($db, $domainName, $tldid, $addPeriod, 'create'); + $returnValue = getDomainPrice($db, $domainName, $tldid, $addPeriod, 'create', $clid); $price = $returnValue['price']; if (!isset($price)) { @@ -359,7 +359,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) { $autoRenewPeriod_id = $stmt->fetchColumn(); if ($autoRenewPeriod_id) { - $returnValue = getDomainPrice($db, $domainName, $tldid, $autoRenewPeriod, 'renew'); + $returnValue = getDomainPrice($db, $domainName, $tldid, $autoRenewPeriod, 'renew', $clid); $price = $returnValue['price']; if (!isset($price)) { @@ -382,7 +382,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) { $renewPeriod_id = $stmt->fetchColumn(); if ($renewPeriod_id) { - $returnValue = getDomainPrice($db, $domainName, $tldid, $renewPeriod, 'renew'); + $returnValue = getDomainPrice($db, $domainName, $tldid, $renewPeriod, 'renew', $clid); $price = $returnValue['price']; if (!isset($price)) { @@ -407,7 +407,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) { if ($transferPeriod_id) { // Return money if a transfer was also a renew if ($transferPeriod > 0) { - $returnValue = getDomainPrice($db, $domainName, $tldid, $transferPeriod, 'renew'); + $returnValue = getDomainPrice($db, $domainName, $tldid, $transferPeriod, 'renew', $clid); $price = $returnValue['price']; if (!isset($price)) { diff --git a/epp/src/epp-renew.php b/epp/src/epp-renew.php index e8a36ac..81f1a72 100644 --- a/epp/src/epp-renew.php +++ b/epp/src/epp-renew.php @@ -113,7 +113,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) { $registrar_balance = $row['accountBalance']; $creditLimit = $row['creditLimit']; - $returnValue = getDomainPrice($db, $domainData['name'], $domainData['tldid'], $date_add, 'renew'); + $returnValue = getDomainPrice($db, $domainData['name'], $domainData['tldid'], $date_add, 'renew', $clid); $price = $returnValue['price']; if (($registrar_balance + $creditLimit) < $price) { diff --git a/epp/src/epp-transfer.php b/epp/src/epp-transfer.php index 19a1f52..27d30fb 100644 --- a/epp/src/epp-transfer.php +++ b/epp/src/epp-transfer.php @@ -470,7 +470,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans) $stmt->execute([$domainName]); $date_add = $stmt->fetchColumn(); - $returnValue = getDomainPrice($db, $domainName, $tldid, $date_add, 'transfer'); + $returnValue = getDomainPrice($db, $domainName, $tldid, $date_add, 'transfer', $clid); $price = $returnValue['price']; if (($registrar_balance + $creditLimit) < $price) { @@ -992,7 +992,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans) $registrar_balance = $result["accountBalance"]; $creditLimit = $result["creditLimit"]; - $returnValue = getDomainPrice($db, $domainName, $tldid, $date_add, 'transfer'); + $returnValue = getDomainPrice($db, $domainName, $tldid, $date_add, 'transfer', $clid); $price = $returnValue['price']; if (($registrar_balance + $creditLimit) < $price) { diff --git a/epp/start_epp.php b/epp/start_epp.php index ff4a30d..85bd13e 100644 --- a/epp/start_epp.php +++ b/epp/start_epp.php @@ -377,7 +377,7 @@ $server->handle(function (Connection $conn) use ($table, $pool, $c, $log, $permi sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID); $conn->close(); } - processDomainCheck($conn, $pdo, $xml, $trans); + processDomainCheck($conn, $pdo, $xml, $trans, $data['clid']); break; }