Jump to content

Automating account set up


Recommended Posts

I've been developing a new product which uses a MySQL backend.

 

I'm sure there is a possibility of using WHMCS to automatically create the user's account after they've signed up for the product/service, in a similar way to WHM, but completely automatically.

 

On Friday I contacted the WHMCS admin bods, but they said that a dev kit wouldn't be required, rather action hooks would.

 

There doesn't seem to be much documentation really, so I'd like some advice.

 

So, let's say the product id is 14, I'd need to extend the actionhook_ShoppingCartCheckout($vars) function to something like the following:

 

function actionhook_ShoppingCartCheckout($vars) {
if ($vars["Products"] == "14") {
	// code
}
}

 

Can I just call a URL via cURL or include/require (does include/require work when calling a page based on another site)?

 

Alternatively, should I just directly run the SQL commands to create the user?

 

Also, can I return any result to be advised of success in WHMCS, or should I just modify the create-user script to send an email out?

 

And, finally, can I set an account suspended (and subsequently unsuspended) if payment isn't made using another hook? (It doesn't seem obvious to me).

 

 

Thanks :)

 

 

edit: forgot to mention...

 

The product signup form can include a space for username - can this be passed to the script for the purposes of creating/suspending/unsuspending the account? I'm going to worry about duplicate usernames at some point, but if that's not possible, I'll find another way. :(

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