I'm not sure if the desired result can be achieved because in this particular case this requires buying, installing, and testing, but I suspect it is. The Easy Digital Downloads plugin has a huge variety of add-ons (free and premium), and one of them is Points and Rewards ($ 59):
Extension for building a "store credit" type system. Want to rewards customers for helping out in your support forums or for reporting a bug? Simply give them some points that can be redeemed on future purchases.
The author of EDD, Pippin Williamson , is a leading developer in the community WordPress. The quality of your code is flawless, being very easy to extend its functionality through hooks or creating your own extensions to EDD.