Jump to content
  • 0

Custom provisioning module is not processing when we hit suspend or unsuspend


TysonPM

Question

For the way we need our site to operate, when a service gets suspended we need it to update a database entry which our back end server then accesses. The issue comes when I hit the button, it just spins but does not do anything and nothing appears in the logs about it. This is what I am currently using to attempt this

  Quote

function vanguard_SuspendAccount(array $params)
{
    $mysqli = new mysqli("localhost", "USERNAME", "PASSWORD", "DATABASE");
    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
    $mysqli->set_charset("utf8mb4");
    
    try {
        
        $stmt = $mysqli->prepare("UPDATE apps SET status = ? WHERE service_id = ?");
        $stmt->bind_param("ii", "1", $params['serviceid']);
        $stmt->execute();
        $stmt->close();
        
    } catch (Exception $e) {
        // Record the error in WHMCS's module log.
        logModuleCall(
            'vanguard',
            __FUNCTION__,
            $params,
            $e->getMessage(),
            $e->getTraceAsString()
        );

        return $e->getMessage();
    }

    return 'success';
}

Expand  

Any suggestions as to why this isn't working would be great!

 

Thank you!

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
Answer this question...

×   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