SteelSignature Posted October 17, 2019 Share Posted October 17, 2019 Attempt Credit Capturing is currently running every 5 minutes as a cron. It's great except if a payment fails, because... Quote Attempt Only Once By default, unpaid invoices will have their payment capture attempted daily until successful. By enabling this option, WHMCS will only attempt to charge the customer’s card once. If it fails, it will not try again until the client or an admin makes a manual payment attempt. Now that it's set to run every 5 minutes, would a failed payment be attempted every 5 minutes and send a "Credit Card Payment Failed" message each time. This would obliterate someone's inbox until it was resolved = BAD Is there a way to hard cap attempts or is this already built in through the "Retry Every Week For" setting? I hoping a power user that understands the payment rules in WHMCS could provide some clarity. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 17, 2019 Share Posted October 17, 2019 as you can see from the Crons docs, most tasks run daily (only once per day) - including cc processing... so unless you are overriding the default cron settings with additional tasks, cc processing should only occur daily, not every five minutes. 0 Quote Link to comment Share on other sites More sharing options...
SteelSignature Posted October 17, 2019 Author Share Posted October 17, 2019 1 hour ago, brian! said: as you can see from the Crons docs, most tasks run daily (only once per day) - including cc processing... so unless you are overriding the default cron settings with additional tasks, cc processing should only occur daily, not every five minutes. That is true, but the behavior has been overriden with: do --ProcessCreditCardPayments Do you know what will happen with failed payment attempts now? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 18, 2019 Share Posted October 18, 2019 16 hours ago, SteelSignature said: Do you know what will happen with failed payment attempts now? to be honest, no I don't... I don't think i've ever ran it as a forced task, so have never came across what would happen in the situation you describe. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted October 18, 2019 Share Posted October 18, 2019 I don't understand what you're trying to achieve by running the cron job every 5 minutes. Care to elaborate? 0 Quote Link to comment Share on other sites More sharing options...
SteelSignature Posted October 18, 2019 Author Share Posted October 18, 2019 8 hours ago, brian! said: to be honest, no I don't... I don't think i've ever ran it as a forced task, so have never came across what would happen in the situation you describe. I'll do some testing and report back. I have to wonder what good the "Retry Every Week For" option is if it doesn't help here. 4 hours ago, DennisHermannsen said: I don't understand what you're trying to achieve by running the cron job every 5 minutes. Care to elaborate? Two words: Billable Items 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted October 18, 2019 Share Posted October 18, 2019 Well, you have the option to create the invoice manually right after creating the billable item. Are you dealing with automated billable items? In that case, you could just use the GenInvoices API: https://developers.whmcs.com/api-reference/geninvoices/ Create a file called gen-invoices.php and place it in the crons folder. <?php $command = 'GenInvoices'; $postData = array( ); localAPI($command, $postData); Create a cron job that visits that php file every 5 minutes, and that should be it 😄 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 19, 2019 Share Posted October 19, 2019 16 hours ago, SteelSignature said: I'll do some testing and report back. keep an eye on the activity log. 16 hours ago, SteelSignature said: I have to wonder what good the "Retry Every Week For" option is if it doesn't help here. huh... by default, WHMCS will try to take payment daily... the above option changes that to retrying once a week... you're trying to retry it every 5 minutes! 14 hours ago, DennisHermannsen said: In that case, you could just use the GenInvoices API or just run the CreateInvoices cron task hourly or whatever... 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted October 19, 2019 Share Posted October 19, 2019 1 hour ago, brian! said: or just run the CreateInvoices cron task hourly or whatever... Well... If you insist on making it easy 🙄😂 1 Quote Link to comment Share on other sites More sharing options...
danielfelipe16 Posted January 20, 2020 Share Posted January 20, 2020 On 10/18/2019 at 9:02 AM, DennisHermannsen said: I don't understand what you're trying to achieve by running the cron job every 5 minutes. Care to elaborate? Hello! Just to add some information, I think he wants to run the cron every 5 minutos, because WHMCS documentations says to do it: System Cron The system cron automates tasks within WHMCS. It should be configured as follows: Version System Cron Frequency WHMCS 6.3.x and earlier Once per day WHMCS 7.0 and later Every 5 minutes, or as frequently as your web hosting provider allows (minimum once per hour) https://docs.whmcs.com/Crons 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted January 22, 2020 Share Posted January 22, 2020 On 1/20/2020 at 8:15 PM, danielfelipe16 said: I think he wants to run the cron every 5 minutos, because WHMCS documentations says to do it: No. The "daily" cron job needs to only run once per day. You can see the default frequencies here: https://docs.whmcs.com/Crons#Task_Options_for_skip_.26_do WHMCS doens't execute all tasks every 5 minutes. It only executes the ones that are due for execution (if any). 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.