function TerminateAccount($params) { $result = select_query('ion_module', 'ion_sid', array('whmcs_sid' => $params['serviceid'])); $ion_sid = 0; if (mysql_num_rows($result) > 0) { $ion_sid = mysql_fetch_array($result, MYSQL_NUM)[0]; } if ($ion_sid == 0) { return; } return APIClient::requestCancellation(ION_API, array('serverID' => $ion_sid, 'message' => 'This server has been cancelled through our billing system and we are no longer being paid by our client for this server. Please cancel it.')); }