affiliatewp/AffiliateWP — pull request #412 by sumobi (2014-10-12 22:41:06+00:00)
Title: Pass referral total to affiliate_wp()->referrals->update

https://github.com/affiliatewp/AffiliateWP/issues/406

This seems better. I moved the code for calculating the referral above so it can be used for both a new tracked discount, or to update an existing referral with the referral total.