-
Notifications
You must be signed in to change notification settings - Fork 40
Description
When a recurring contribution fails, the next scheduled date appears to always be set to one frequency interval in the future, no matter what the failure count is. I followed this through in the debugger and can see that the ContributionRecur is being correctly set to have the same next scheduled date as before the failed attempt, but then later when the failed Contribution is added, the next scheduled date is set to one frequency interval in the future by core.
This Contribution API call here has the result of the next scheduled date being pushed ahead, which happens after the ContributionRecur has been adjusted, so it overwrites the next scheduled date set earlier. I believe this is the code in core that is setting the next scheduled date ahead with the 48 hours test (the next scheduled is today, which is within 48 hours of now, so it is set to one frequency unit in the future).
So I think the solution here might be to reset the ContributionRecur next scheduled date after creating the failed Contribution. Or alternately, maybe this should be changed in core.