Auto-renew membership links to most recent recurring contribution
Overview
If a member sets up more than one recurring contribution it is only the most recent of these that is linked to the membership (i.e. the last recurring contribution ID is recorded on the membership record). Usually this isn't an issue as the more recent recurring contribution is the active one. However, this can cause a problem if an older recurring contribution is active and the more recent one isn't.
This causes two different problems:
- if a payment comes through for the older recurring contribution it might not update the membership correctly (this is certainly an issue for GoCardless)
- the auto-renew status on the membership is incorrect - e.g. it shows
Cancelled
rather thanIn Progress
This isn't a common situation but it can happen for example if a member signs up twice - the first time completing the process but the second time starting the process but not completing it. Perhaps if a member forgets that they already have an active recurring payment and set up a second one then realise and cancel the second one.
Reproduction steps
A pre-requisite is that the payment processor that supports recurring contributions.
- Sign up as a member with a recurring payment plan
- A recurring contribution is created with ID 0001
- A contribution is created
- A membership is created and linked to the recurring contribution ID 0001
- The recurring contribution is
In Progress
so the membership auto-renew status isIn Progress
- Return later and sign up again for membership with a recurring payment plan
- A recurring contribution is created with ID 0002
- A contribution is created
- A membership is updated to link to the recurring contribution ID 0002
- The recurring contribution is
In Progress
so the membership auto-renew status isIn Progress
- Realise your mistake and cancel the second recurring contribution
- The second recurring contribution status is now
Cancelled
so the membership auto-renew status isCancelled
- The second recurring contribution status is now
- Payment clears for the first recurring contribution
- The first recurring contribution is updated
- A new contribution is created
- The membership isn't updated because it isn't linked to the first recurring contribution
Current behaviour
The membership is linked to the most recent recurring contribution. This causes two issues:
- The auto-renew status is
Cancelled
which is incorrect - The membership doesn't update when the payment clears
Expected behaviour
The membership is linked to any (or the most recent?) active recurring contribution, which means that:
- The membership auto-renew status is
In Progress
- The membership updates when the payment clears
Environment information
N/A
Comments
Probably related to #928.