Answer:
This story is an example of the just-world hypothesis or just-world fallacy.
Explanation:
According to the just-world hypothesis, a person is going to be rewarded if she or he performs a morally good act, and punished in case of performing a morally bad act. It comes from the belief that the world is fair and every action in the world has consequences. As a result, good people are rewarded, while bad people are punished.
Here, the homeless man returned the engagement ring (morally good act) and was received donations (reward for a morally good act).