Jump to content

Credit Card Charging Settings - potential disaster


SteelSignature

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 😄

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • 3 months later...
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

 

 

Link to comment
Share on other sites

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).

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