Claude threw himself into caring for little Jehan. He was more than a brother to the baby—he was the child’s mother and father! He had been taking care of Jehan for about a year when he heard the old women talking about the deformed orphan. When he looked at the unlucky creature, he was moved by deep compassion. He vowed in his heart to rear the child for the love of his brother. What if Jehan might prove to have some faults in the future? Perhaps this charity done in his name might be placed to his credit.
The first part of the cited sentence is more clear to me, Dose it mean: what if Jehan won't be a good person.
But I have not got any idea about the second part. meaning of" Perhaps this charity done in his name might be placed to his credit"