Jump to content

dixonjoseph.k

Member
  • Posts

    12
  • Joined

  • Last visited

About dixonjoseph.k

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

dixonjoseph.k's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. Hi, We have to resell some of our vps/dedi products. So I think we need the following features. 1. Ability to make resellers groups and assign specific discounts for each group 2. Resellers control panel in our site To manage Resellers account and create api key and its credentials Purchases and commission details if required. 3.Api to manage the purchase process happening in the resellers whmcs. 4.Reseller addon Addon to integrate with the resellers whmcs to make the products purchasable from their site itself.
  2. Hi, I disabled all the files which are using 'PreModuleTerminate' hook and now the termination is working fine. I have to check that code.
  3. Hi, We have a hook to terminate the cpanel license. It was working earlier. Now it is not working. When I checked, there is no $vars values are coming to that hook. Used the below code. function terminate_hook_check($vars) { echo "<pre>"; var_dump($vars); die(); } add_hook('AfterModuleTerminate', 1, 'terminate_hook_check'); It just printed as null array (size=1) 'params' => null Also tried 'PreModuleTerminate' hook and it returned values. So please let me know the issue.
  4. Hi, Actually we want the 'ID Protection' as auto selected by default when we reach the cart/checkout page even the user is not edit the domain configuration. So please let us know is there any option available in the admin side to work it out?. I have done it by modified the configuration template, but it will work only if he entered to the edit configuration page then go to the check out page.
  5. Hi, I need the cart array or the order details in the complete page for some tracking. I have to pass the product details like id/name, price, quantity, discounts etc with a url. So please let me know how can I do it? Thanks, Dixon Joseph.
  6. Hi, We want to cancel the paypal subscription upon termination. For that we will use this hook http://docs.whmcs.com/Hooks:AfterModuleTerminate and paypal api to cancel the subscription. Whmcs has a paypal module by default as you know. But we don't know how to use it with a hook?. Googled a lot, but not find anything helpful and also asked whmcs support, but no useful replies. Also the module is encoded as you know. So we searched for paypal sdk and got one. But the same thing here too, ie we don't know that how do we integrate the sdk in whmcs? Can we do it as a class? then how can we do?. Or Where do we upload this sdk?. We hope that any one can help us Thanks, Dixon Joseph.
  7. Hi, Anybody know how to use/integrate Update Client Product api. I tried and it is showing as success, but not updating the config values or custom field values. $postfields["action"] = "updateclientproduct"; postfields["serviceid"] = 229; tbhostings.id $postfields["pid"] = 152; product id $postfields["configoptions"] = base64_encode(serialize(array(565 => array('optionid' => '7758', 'qty' => '1')))); 565- configid, 7758- optionid in tblhostingconfigoptions table. Also tried custom fields updation $postfields["customfields"] = array("253"=>"test"); 253- custom field id but not updating anything. I am working on test environment, not in live. It is just showing 'updateclientproduct success 229". Anybody why is it not updating?. Any issues if I use test site?. I have been working on the same for long time.Please........... help. Thanks, Dixon.
  8. Hi, It seems that when a user does not pay their addons, and they become overdue, they have their status changed to suspended followed by terminated, and when they are paid by the client they do not go to active, they stay with the terminated status although their due date is changed as if its paid, so that means it goes undetected and next month he will not be invoiced for it, meaning they receive it for free. We developed a script and it is give below. Please check and let us know that is it correct or not?. Please advise if any changes needed? function hook_activate_paid_addons($vars) { $invoiceid = $vars['invoiceid']; $query = "SELECT addon.id as addon_id FROM tblinvoiceitems itms inner join tblinvoices invc on itms.invoiceid = invc.id inner join tblhosting host on host.id=itms.relid inner join tblhostingaddons addon on host.id=addon.hostingid where itms.invoiceid = $invoiceid and addon.status='Terminated' and invc.status = 'Paid' and (itms.type = 'Addon' or itms.type = 'DomainAddonDNS' or itms.type = 'DomainAddonEMF' or itms.type = 'DomainAddonIDP')" ; if(!mysql_query($query)) { echo("Error description: " . mysql_error()); } else { $result = mysql_query($query); } $cnt = mysql_num_rows($result); $url = "https://example.com/includes/api.php"; # URL to WHMCS API file $postfields["username"] ="test"; $postfields["password"] = md5("test"); if($cnt > 0) { while( $row = mysql_fetch_assoc( $result ) ) { $addon_id = $data['addon_id']; $postfields["action"] = "updateclientaddon"; $postfields["addonid "] = $addon_id; $postfields["status "] = "active"; $query_string = ""; foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&"; $chh = curl_init(); curl_setopt($chh, CURLOPT_URL, $url); curl_setopt($chh, CURLOPT_POST, 1); curl_setopt($chh, CURLOPT_TIMEOUT, 30); curl_setopt($chh, CURLOPT_RETURNTRANSFER, 1); curl_setopt($chh, CURLOPT_POSTFIELDS, $query_string); curl_setopt($chh, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($chh, CURLOPT_SSL_VERIFYPEER, 0); $xmldata = curl_exec($chh); } } } add_hook("InvoicePaid",1,"hook_activate_paid_addons"); Also please let us know that "relid" field in the table tblinvoiceitems is the value of tblhosting.id? Hope that anybody can help us. Thanks.
  9. Hi, We have to update client products dynamically. For that we developed a script, it should update configurable custom field (which is a hidden filed) with static values. But it is not updating even it shows "Success" message. Please see the code below. <?php $url = "https://example.com:8081/includes/api.php"; $postfields["username"] ="test"; $postfields["password"] = md5("test"); $postfields["action"] = "updateclientproduct"; $postfields["serviceid"] = 229; $postfields["pid"] = 152; $postfields["autorecalc"] = 1; $postfields["configoptions"] = base64_encode(serialize(array(537 => array('optionid' => '7613', 'qty' => '1')))); $postfields["responsetype"] = "xml"; $query_string = ""; foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $xmldata = curl_exec($ch); if (curl_error($ch)) { die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch)); } else { print_r($xmldata); } ?> The above script is trying to update product data in test licensed whmcs site and it is running from live whmcs directory. When it executes it shows as 'Success', but not updated. Please help.
  10. Hi, We have to update client products dynamically. For that we developed a script, it should update configurable custom field (which is a hidden filed) with static values. But it is not updating even it shows "Success" message. Please see the code below. <?php $url = "https://example.com:8081/includes/api.php"; $postfields["username"] ="test"; $postfields["password"] = md5("test"); $postfields["action"] = "updateclientproduct"; $postfields["serviceid"] = 229; $postfields["pid"] = 152; $postfields["autorecalc"] = 1; $postfields["configoptions"] = base64_encode(serialize(array(537 => array('optionid' => '7613', 'qty' => '1')))); $postfields["responsetype"] = "xml"; $query_string = ""; foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $xmldata = curl_exec($ch); if (curl_error($ch)) { die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch)); } else { print_r($xmldata); } ?> The above script is trying to update product data in test licensed whmcs site and it is running from live whmcs directory. When it executes it shows as 'Success', but not updated. Please help.
  11. Thanks for your reply. Actually, there is a cron job in whmcs may be you know it will close the inactive tickets( tickets with status as "Answered" and no reply for 72+hrs) automatically after 72+hrs if it has no other replies. So what we I did is that used PreCronJob hook, it should work just before cron job. So we have to take the "Answered" status tickets with lastreply >= 72. But it is missing some tickets yet.
  12. Hi, We are creating a hook which is used to send email with the details of closed tickets which are inactive for 72+hrs. Unfortunately it is not taking all tickets, missing of a few tickets. You can see the code below. Anybody can help us. Hope that any will help us. function hook_before_cron_job_for_close_tickets() { $query = "SELECT tid,title FROM tbltickets where HOUR(TIMEDIFF(NOW(), lastreply)) >= 72 and status ='Answered'" ; $result = mysql_query($query); $tickets = array(); $titles = array(); $cnt = mysql_num_rows($result); if($cnt > 0) { for($x=0; $x<$cnt ;$x++) { $tickt_id = mysql_result($result,$x,'tid'); $title = mysql_result($result,$x,'title'); $tickets[$x] = $tickt_id; $titles[$x] = $title; } $content = " <h4>Ticket Title</h4>"; for($x=0; $x<$cnt ;$x++) { $content .= " ".$tickets[$x]." ".$titles[$x]." <br>"; } $header = "From: support@hostsailor.com\r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: text/html; charset=utf-8\r\n"; $header.= "X-Priority: 1\r\n"; mail('example@gmail.com','Tickets Closed today',$content,$header); } return true; } add_hook("PreCronJob",1,"hook_before_cron_job_for_close_tickets"); Thanks.
×
×
  • 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