Jump to content


Senior Member
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About yomyyo

  • Rank
    Junior Member
  1. Hi, I have been trying to test out a couple of ways to work with account cancellation for a service, and I noticed that WHMCS wasn't automatically cancelling services and was leaving them in the cancellation requests. I checked the logs for any errors and I got this error specifically. Cron Job: ERROR: Manual Cancellation Required - No Module - Do I need a module to cancel services, I thought that the cron job handles it but maybe not. Should it be a manual cancellation or is something going wrong with the cron job.
  2. Hello, I was looking at the ServiceEdit hook and was wondering if it changes every time the service is edited (eg. if a product becomes cancelled/suspended from a cron task) or if it only runs when admin/users edit the service. Thank you!
  3. Hello, I'm trying to do testing with the PreAutomationTask/PostAutomationTask hook. What can I do to run the hook to see if what my function does is correct. I would also like to find out what values $vars['task'] holds so I can run my code when a specific task runs. Is there a way I can view what that variable holds. I tried doing die(print_r($vars['task'])) but it looks like the page doesn't die and it's something else that stops.
  4. @upalm I just have something very simple like the following: add_hook("CancellationRequest", 1, function($vars){ $userid = $vars['userid']; $relid = $vars['relid']; //Call GetClientsProducts API using user id $results = //API CALL $products = $results['products']['product']; //Loop through $products until we find a product that matches $relid foreach(....){ if($productid == $relid){ //Send a curl request to my product and delete their user account } } }); The problem with my code is that CancellationRequest runs immediately, regardless of whether or not the user chose to cancel at the end of the billing period or not.
  5. What does $vars['task'] of PreAutomationTask or PostAutomationTask return? Whats a good way I can do testing with these hooks so I can get the right values? Thank you for all the help!
  6. Thanks for the tip! I'll look into those and see what I can find
  7. Hello, I wanted to figure out how cancellation requests are processed. When customers choose to cancel a service, and choose End of Billing Period specifically, is there any hooks that fire on the End of Billing Period? That way, once the time comes I can fire a request to my service and suspend their account. I have Immediate Cancellation done through the CancellationRequest hook, but is there any way for me to get data at the end of a billing period? Thank you
  8. Just another question real quick, when a customer buys a product set for monthly billing on the end of the month, say March 31st, and next month doesn't have April 31st, which day would the bill come in this scenario
  9. Thank you for that! I'll try to do so
  10. Hi, I am trying to implement a new hook on AddInvoiceLateFee and I need to test if my function will work on this hook. Is there a way I can advance the date of whmcs so that the hook fires? Thank you.
  11. Hello I am new to working with WHMCS hooks, and I wanted an opinion on which hooks I should use. I have a service that is paid for through WHMCS, and I want to use a hook so that when they are late on payment, their account to my service is suspended until they have paid. Which hook sounds like it would work the best in this situation?
  12. I am adding a hook to my module and testing the hook on my dev whmcs site. In the hook, I am sending a curl request to the dev server of another site. Is there a variable to tell the difference between the whmcs dev site and production site, so that if dev site send a request to dev, and if production site, do the request to production?
  13. I am trying to validate custom fields for my item, but whether or not the custom field is valid, I will be thrown an error. If it's an invalid field it'll say "Please correct the following errors before continuing: This email address is already in use." However if the user gives a valid field, it will just give "Please correct the following errors before continuing:" without anything after. I have the hook set up as so function checkUser($vars){ $postData = array( 'data' => array( 'email' => $vars['customfield'][6], ) ); $ch = curl_init(); if($ch == false){ throw new Exception('failed to init'); } curl_setopt_array($ch, array( CURLOPT_URL => myUrlGoesHere, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HEADER => 0, CURLOPT_POSTFIELDS => http_build_query($postData), )); //Save the result from the request $output = curl_exec($ch); $res = json_decode($output); curl_close($ch); console_log($res); if($res){ $message = "This email address is already in use."; return $message; } } Is there a value I need to return using this hook. Thank you!
  14. Welcome to WHMCS.Community yomyyo! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.

  • 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