Jump to content

Manual suspend works but cron does not


Recommended Posts

Hi all,

Can anyone advise on the core below?

The cron does not take the desired affect, but if I suspend/unsuspend on the products i t works.

 

function epc_SuspendAccount(array $params)
{
    try
    {
	$aa=suspend_imsi($params['serviceid']);
	if ($aa== 'success')
	{
		return 'success';
	}
	else
	{
            	$todoarray["title"]       = "Service Suspension";
            	$todoarray["description"] = "Service ID# " . $params["serviceid"] . " requires suspension:".$aa;
            	$todoarray["status"]      = "Pending";
            	$todoarray["date"]        = $todoarray["duedate"] = date( "Y-m-d" );
            	insert_query( "tbltodolist", $todoarray );
            	return "Service ID# " . $params["serviceid"] . " requires suspension:".$aa;
	}
     } 
    catch (Exception $e)
    {
        // Record the error in WHMCS's module log.
        logModuleCall(
            'epc',
            __FUNCTION__,
            $params,
            $e->getMessage(),
            $e->getTraceAsString()
        );

        return $e->getMessage();
    }

    return 'success';
}

 



function epc_UnsuspendAccount(array $params)
{
    $imsi_number=get_imsi_by_serviceid($params['serviceid']);
    try
    {
	$aa=unsuspend_imsi($imsi_number);
       if($aa== true)
       {
            return 'success';
        }
        else
        {
            $todoarray["title"]       = "Service Unsuspension";
            $todoarray["description"] = "Service ID# " . $params["serviceid"] . " - IMSI ".$imsi_number." requires unsuspension";
            $todoarray["status"]      = "Pending";
            $todoarray["date"]        = $todoarray["duedate"] = date( "Y-m-d" );

            insert_query( "tbltodolist", $todoarray );

            return "Service ID # " . $params["serviceid"] . " - IMSI ".$imsi_number." requires unsuspension";
       }

    } 
    catch (Exception $e)
    {
        // Record the error in WHMCS's module log.
        logModuleCall(
            'epc',
            __FUNCTION__,
            $params,
            $e->getMessage(),
            $e->getTraceAsString()
        );

        return $e->getMessage();
    }

    return 'success';
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated