Skip to content

Correctly update membership after redirect flow

Rich requested to merge github/fork/wpf500/wpf-membership into master

Created by: wpf500

Hi, thanks for sharing this plugin, its exactly what I needed!

I found an issue when using it for recurring memberships where the membership would never get updated. I'm new to CiviCRM so what I've changed might not make sense but it seems to work!

I switched the test for membershipID vs contributionRecurID around because it seems that in the case of recurring memberships both exist, and the ContributionRecur record holds all the information needed (including the amount) so there's no need to query the Contribution record.

I also noticed that the field amount doesn't exist for a Contribution, so I switched that to total_amount.

Merge request reports