guyc Posted January 29, 2014 Share Posted January 29, 2014 we had a list of 300 users with their credit card info that we didn't want to insert manually. We ran a script on the database and inserted the info into the tblclients tblcustomfieldsvalues tables. Our concern is only the expiration date as we left the credit number blank (we use token instead) In the tblclients table the expiration date of the credit is encrypted using AES_ENCRYPT with a hash. yesterday we entered all the info into the table using the had we got when running query log and saw what was used to extract the data. Today the hash changed and we had to run the script again with the new hash. Does this hash changes on a daily basis and the entire exp date in the db is updated with it? If so, should there be another table where we should put the client id to be updated? If not, why did the hash changed? Thanks 0 Quote Link to comment Share on other sites More sharing options...
guyc Posted January 29, 2014 Author Share Posted January 29, 2014 after further investigation we realized that each (per user) exp date/cc number is encrypted using a different hash. This is not the hash in cofiguration.php mind you. how can we find this hash for each user? 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted January 29, 2014 Share Posted January 29, 2014 I would suggest using the API to enter this data. The API will take care of the encryption for you. $postfields["username"] = $whmcsAdmin; $postfields["password"] = $whmcsPass; $postfields["action"] = "updateclient"; $postfields["clientid"] = $clientid; $postfields["cardnum"] = $cardnum; $postfields["cardtype"] = $cardtype; # <-- (Example: MC, VI, DS, AR, DC, JC) $postfields["expdate"] = $expdate; # <-- (In format of MMYY) 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted January 29, 2014 Share Posted January 29, 2014 (edited) I tried to send you a PM, but wasn't able to. Edited January 29, 2014 by SeanP 0 Quote Link to comment Share on other sites More sharing options...
guyc Posted January 29, 2014 Author Share Posted January 29, 2014 can you give me an eample how to do it with curl from the command line? - - - Updated - - - never mind, I got it. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
guyc Posted January 29, 2014 Author Share Posted January 29, 2014 Thanks SiteOx, the solution works perfectly. Just to add that the field of the password should be $postfields["password"] = md5(password) 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted January 29, 2014 Share Posted January 29, 2014 Thanks SiteOx, the solution works perfectly. Just to add that the field of the password should be$postfields["password"] = md5(password) Right, sorry. I did the md5, on the admin password, elsewhere in my code. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.