Add (ai gen)
This commit is contained in:
@@ -52,15 +52,15 @@ function get_smartproxy_server()
|
||||
}
|
||||
|
||||
if (! function_exists('calculate_smartproxy_cost')) {
|
||||
function calculate_smartproxy_cost(float $kb, $amplifier = 1)
|
||||
function calculate_smartproxy_cost(float $kb, $type = 'rotating_global')
|
||||
{
|
||||
$cost_per_gb = config('platform.proxy.smartproxy.rotating_global.cost_per_gb');
|
||||
$cost_per_gb = config("platform.proxy.smartproxy.{$type}.cost_per_gb");
|
||||
|
||||
// Convert cost per GB to cost per KB
|
||||
$cost_per_kb = $cost_per_gb / (1024 * 1024);
|
||||
|
||||
// Calculate total cost for the given $kb
|
||||
$cost = ($cost_per_kb * $kb) * $amplifier;
|
||||
$cost = ($cost_per_kb * $kb);
|
||||
|
||||
return round($cost, 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user