Jump to content

Trekkan

Member
  • Posts

    20
  • Joined

  • Last visited

Everything posted by Trekkan

  1. Right, but I guess the issue here is, I don't know what all needs to be done for the addons. What tables are hit, with what data, why and when? Which is really no different than me just modifying the database directly and not knowing what I'm doing with the data.
  2. Let's say the customer has signed up for a subscription that is a 1 month recurring for 10.00. So in the middle of the month (any month, could be the first one, or the 10'th one), they decide they want to go with our 3 month plan which has a small discount. If they were to change their subscription, 1) Would it cancel their current sub and add the new one? 1a) Would it credit them the difference they still had and apply it to the new amount due? 2) Would it wait until the current sub was up, then start the new sub? 1 & 2) What happens if someone was on a 3 month and downgraded to the 1 month?
  3. Here is an example of what we'd like to do, but are unsure of how to do it (if it's even possible). Customer signs up, purchases product A for a one time charge. The customer is automatically signed up for subscription package B, which is a recurring charge every X. The customer isn't billed until X days out for the subscription package. After X days, then the customer is finally sent an invoice on the subscription charge. So, to add numbers to it: Customer buys product A for 30.00, one time charge Customer is automatically signed up for a recurring charge for $5.00 a month Customer is not billed the $5.00 until 30 days have passed. They shouldn't see an invoice, etc until then. Is this possible? I have no issue with changing the due date, manually through the database and I'm ok with that. However I don't want the customer to be invoiced until that due date (or X days before the due date). The way I was looking to do is was to create a product and attach an addon to it automatically. You apparently can't force an addon on someone (it's a checkbox and defaulted to off) which doesn't work for our case. However, I was just going to hook into AfterShoppingCartCheckout, check the product ID, make sure it's the correct product, then manually add the Addon. The problem with this is, there's no API that I can see for adding an addon. I'm not sure of all of the tables that get hit with the addon, so I'm a little leery of doing this, but not completely against it either. I could just use some help in this area as to what tables I'd need to hit, etc.
  4. In this instance, I'm using the ClientAdd hook. I'm asking some other custom registration information such as the forum name they'd like to use, etc. At which point I want to take that forum name and create their account for them, etc.
  5. I'd like to be able to add an addon to a customers profile based on conditions outside of WHMCS. When I look at the API, I can't find any reference to only adding an addon (not an entire product). Is there a way to do this somehow that I'm missing?
  6. I have several custom fields that I require when someone creates an account. However none of the custom fields are passed in the $vars variable when trapping the event via a hook. So basically, it looks like my only option is to requery the database (or API call). I guess I can do that, but it just makes the point of having the rest of the variables come across without having to do another query, kinda pointless. I guess, can we get "Custom Client Fields" to be passed as well?
  7. Yeah, been working on doing it all from scratch myself... kinda lame since the software was purchased and is useless.
  8. BTW, that looks like a valid root password in your first post, might wanna edit that.
  9. I have no idea. I did check the session variables though and both of those values are set, at least on the one page. Then for whatever reason, they aren't set when clicking links on the page. No idea what might be set that is killing the sessions vars. Could be something to do with them being assigned to the wrong sessionID or something I suppose, so it get's blasted... not sure how to tell if I have the correct sessionID, or which one is the correct one.
  10. Short explanation. We're switching to WHMCS and going through the import/integration pains. We have the passwords in a DB table from our existing system, they are stored in their MD5, no salt mode. My understanding is, that in order to get these to hash properly, there's pretty much no way to add them to WHMCS and have them work. The reason would be that there's no way to add the salt to the hash at this point. I tried setting it so that it was stored as md5hash: basically leaving off the salt, but that didn't work. Because we can't get the old passwords to work with the new system, we've decided that the best idea will be to send the customer an email with a new password (however poorly that looks to our customers). So... When looking at the documentation there's a sendMail API. The Sendmail API isn't really very detailed in the documentation. I guess the messagename is how the correct template is identified? Seems weird not to use a uniqeid for the template.. Then again, I might be reading this wrong? And id... I would assume that's the clientID, but the description here, I don't understand. So the short version is, I want to send all of my customers an email with a new password they'll need to use in order to log into WHMCS. How do I do it? =)
  11. I've tried that, with limited success. As I said, I can get it to login, but not save the session, so the next link you click, you're not logged in. Here's a copy of my test code (with many things commented out as I've been trying various things). <? $postvars["username"] = "emailaddress@gmail.com"; $postvars["password"] = "password"; $postvars["token"] = "yourinstallationtokenfromadmincp"; $posturl = "http://www.domain.com/whmcs/dologin.php"; session_start(); $strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/'; session_write_close(); $lcon = curl_init(); curl_setopt($lcon, CURLOPT_COOKIE, $strCookie ); curl_setopt($lcon, CURLOPT_URL, $posturl); //curl_setopt($lcon, CURLOPT_HEADER, 1); curl_setopt($lcon, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($lcon, CURLOPT_VERBOSE, 1); curl_setopt($lcon, CURLOPT_POST, 1); curl_setopt($lcon, CURLOPT_POSTFIELDS, $postvars); curl_setopt($lcon, CURLOPT_FOLLOWLOCATION, true); curl_setopt($lcon, CURLOPT_COOKIESESSION, true); //curl_setopt($lcon, CURLOPT_COOKIEFILE, "cookiefile.txt"); curl_setopt($lcon, CURLOPT_COOKIEJAR, "cookiefile.txt"); //curl_setopt($lcon, CURLOPT_COOKIE, session_name() . '=' . session_id()); $ldata = curl_exec($lcon); if(curl_error($lcon)) { echo $url." - ".curl_error($lcon)."<br>"; } setcookie("WHMCSUID", $_SESSION["uid"],0,"","", false, true); setcookie("WHMCSPW", $_SESSION["upw"],0,"","", false, true); echo "<hr>$ldata<hr>"; curl_close($lcon); print_r($_SESSION); ?>
  12. Yeah, that's what I'm doing now. Still failing though. heh Basically, I'm just using cURL to hit the dologin.php page. But either a cookie or a session value isn't getting set correctly. Typically, since I'm doing the same thing as would happen normally, I'd think it'd work, but it's not. Well, it somewhat works. I can login now, and the first page I get to, works fine. But anything I click on after that, I'm logged out. Clearly I'm not doing something that needs to be done, just not sure exactly what. I'm still fooling around with it, but could use some help!
  13. Easier yes, but not in order to accomplish what we're looking to do. =)
  14. I'd still like to know if there's a way to auth sending the MD5 hash of the password (more secure that way) instead of plain text, but regardless, I'm trying out some code to auto login and well.. It's just not working. What's not working? I don't know. CURL I guess, however I don't get any data returned, no errors, etc.. so I'm just not sure what the deal is. Below is a copy of my text code (please ignore all the junk, as I said, it's test code). Of course, edit the first 3 lines to suite your testing values. <? $login_page_url = $forum_root."www.domain.com/whmcs/dologin.php"; $postfields["username"] = "emailaddress"; $postfields["password"] = "passwowrd"; unset($ch); $ch = curl_init(); echo "1: ".curl_error($ch)."<br>"; curl_setopt($ch, CURLOPT_URL, $login_page_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($ch, CURLOPT_MUTE, 0); //curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); echo "2: ".curl_error($ch)."<br>"; $cdata = curl_exec($ch); echo "3: ".curl_error($ch)."<br>"; curl_close($ch); //print_r($postfields); echo "<hr>$cdata<hr>"; die("WHCMS LOGIN"); ?> CURL is enabled on my server (and works fine normally), So.. yeah. No idea. Thanks for any help you can provide!
  15. John, I've been looking into this more and don't see how I can do it. I need my users to be able to sign on from various points. Right now, the only way I can see to login to WHMCS is to do a post to the login.php form. I can't do this as the users password I get is already MD5 encrypted. If there was an API for logging into WHMCS, then I could use that, but I couldn't find one. Am I just being blind? =)
  16. I have several difference systems in place currently, all of them are (or will be) synced using the same password hashes, etc. However, what I'd like to do is if someone signs on in System A, it also signs them on in Systems B, C and D. Right now, I see no way that I can automatically sign someone into WHMCS from an outside source. Is this true, or is there a way to do this? Thanks for any assistance you can provide! -Troy
  17. I'm also having issues with phone numbers that don't conform to US syntax, so I need a way to get those entered correctly as well.
  18. I'm working on a custom import script to pull users from a DB table into WHMCS Overall, this hasn't been an issue and I'm using the API action "addclient" to do this. The problem appears to be that during import, some of the data contains a country code like "ca" for Canada, but we don't have a state value for them. When trying to add the new client, WHMCS throws and error about the missing state value. It's doing this for other countries as well. I understand it want's a state value, but what if there shouldn't be one, or I just don't have it? I'd like to be able to add the client to WHMCS anyway, then I can have the user correct the issue later. Is there anything I can do to disable this validation? I could just assign "bogus" data, but I'd rather not do that. Thank you for your help!
  19. The site is full of spam, in the forums, blogs, comments, etc as well. Obviously no one is paying attention to the product/site.
×
×
  • 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