Jump to content

nehabhole28

Member
  • Posts

    8
  • Joined

  • Last visited

About nehabhole28

nehabhole28's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. NOT ACCEPTABLE! An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security. i am getting this error suddenly from this morning . no api request to whmcs are working now and i am getting this above error as response in every api request.please help me !!
  2. there are different customers for which i need to send different invoices depending on product and services so is there any way to do it when an invoice is automatically created by cron it can auto matically send a particular invoice template according to the service for which the invoice is created.
  3. i need to update my website database on a particular invoice payment and addon activation for which i have made three action hooks one on invoice creation for data entry , second on addon activation third on invoice payment the first one is working properly and i be able to successfully enter data in my database on invoice creation but the other two are not working. my hooks.php code--- this is my first function which is working fine. function update_db($vars) { //when any invoice is created---- $invoiceid=$vars['invoiceid']; $url = 'http://www.XXX.com/user/add_order_todb'; $date=date('Y-m-d'); $postfields = array( 'orderid' =>$invoiceid, 'date' => $date); $options = array( 'CURLOPT_TIMEOUT' => '1000'); $response = curlCall($url,$postfields,$options); } the below two functions are not working . function update_status($vars) { //when any invoice is paid--- $invoiceid=$vars['invoiceid']; $url = 'http://www.XXX.com/user/paid_invoice_upgrade'; $postfields = array( 'invoiceid' =>$invoiceid); $options = array( 'CURLOPT_TIMEOUT' => '1000'); $response = curlCall($url,$postfields,$options); } function hook_add_storage($vars) { //when any addo on is activated---- $addonid=$vars['id']; $userid=$vars['userid']; $serviceid=$vars['serviceid']; $predefined_addonid=$vars['addonid']; $url = 'http://www.XXX.com/user/add_client_storage'; $postfields=array('id'=>$addonid,'userid'=>$userid,'serviceid'=>$serviceid,'addonid'=>$predefined_addonid); $options = array( 'CURLOPT_TIMEOUT' => '500'); $response = curlCall($url,$postfields,$options); } add_hook("InvoiceCreated",1,"update_db"); add_hook("AddonActivation",1,"hook_add_storage"); add_hook("InvoicePaid",1,"update_status"); i dont even know if it is being called or not i have tried using echo and print option and also tried redirection through header() function but none of them worked isn't there any way to check if hooks function is being called or not. one of the curl url function i have used called by hook_add_storage() hook function inside user controller in my site-- public function add_client_storage() { $addonid=$_REQUEST['id']; $clientid=$_REQUEST['userid']; $serviceid=$_REQUEST['serviceid']; $predefined_addonid=$_REQUEST['addonid']; $res=$this->mdl_user->update_storage_client($clientid); } when i run this controller funtion using default values it works fine .there must be some problem with the hooks function.please help me.
×
×
  • 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