Jump to content

Sending WHMCS CustomerId to control panel


codemaster2008

Recommended Posts

Hello there;

 

I downloaded the "Module Development Kit" and I'm surprise with the documentation: One single page :shock:

 

Well, maybe because it's really simple to create a module, however, i can't find an answer to my question and hope somebody out there can help me:

 

Can i send the WHMCS unique "customerid" to my Control Panel on the mymodule_CreateAccount($params) function?

 

It has a "clientsdetails" array but comments/documentation says: # Array of clients details - firstname, lastname, email, country, etc...

 

So, it doesn't say if the Customer ID is included on the array.

It should be possible because "i believe" WHMCS will only execute the "_CreateAccount" function after the client has been created.

 

The reason i'd like to have WHMCS client's ID on my custom control panel is to allow it to call functions like "Add Billable Item" on WHMCS's API.

 

Thanks in advance

Link to comment
Share on other sites

Tip:

When using it add the following:

 

print '<pre>';

print_r($clientdetails);

print '</pre>';

 

Then try to use the module (create button) and it will print an array on the page of all information held in that array. I would assume your looking for ($clientdetails["uid"]) (UserID)

 

OR failing that add this:

 

$getuid = mysql_query("SELECT * FROM tblclients WHERE email = '".$clientdetails["email"]."'");

$u = mysql_fetch_array($getuid);

$clientdetails["userid"]=$u["id"];

 

(May need modification as untested).

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