Jump to content

Simulating recurring payment not working


Recommended Posts

I'm trying to test my own hook on a recurring service payment. I have set the "Next Due Date" parameter on a product with a date smaller than today, I have run "php -q /var/www/midnightstreamer/whmcs/crons/cron.php" in a terminal but the order won't expire. In client area it's still Active green even if the next due date is expired. Plus, in the panel dashboard I have this warning: Last Automation Run: Never Nees Attention, but when I click the warning link I see: Cron Status Ok Last Run: 12/08/2018 17:05. So, Cron is running correctly or it isn't? I think I'm going to open a ticket for this.

 

Link to comment
Share on other sites

Even though you can run cron.php hundreds of times per hour, the daily process that creates invoices and suspend services runs only once per day.

Let's say that you want to run it right now. Current time is 11:55 AM. Visit Setup > Automation Settings > Scheduling > Time of Day and set 11:00am. If you run cron.php now, you'll get the daily cron. The daily cron of course is supposed to run only once per day therefore if you want to run it multiple times you have to convince WHMCS that the daily cron didn't run with this query:

UPDATE `tblconfiguration` SET value = '' WHERE setting = 'lastDailyCronInvocationTime'

Now you can trigger the daily cron again. You need to run this query every time you want to trigger daily cron and don't forget that you also need to update 11:00am as time passes.

There are easier approaches but I prefer this one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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