Skip to content

Next scheduled date is not set correctly when recurring contribution fails #422

@larssandergreen

Description

@larssandergreen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions