Treasury of merit
The treasury of merit or treasury of the Church (thesaurus ecclesiae; , thesaurós, treasure; , ekklēsía‚ convening, congregation, parish) consists, according to Catholic belief, of the merits of Jesus Christ and his faithful, a treasury that because of the communion of saints benefits others too. According to the Westminster Dictionary of Theological Terms, this Catholic belief is a way of expressing the view that the good works done by Jesus and others can benefit other people, and "contemporary Roman Catholic theologians see it as a metaphor for ways in which the faith of Christ and the saints helps others". Treasury of the Church
The Catechism of the Catholic Church states: "[T]he 'treasury of the Church' is the infinite value, which can never be exhausted, which Christ's merits have before God. They were offered so that the whole of mankind could be set free from sin and attain communion with the Father. In Christ, the Redeemer himself, the satisfactions and merits of his Redemption exist and find their efficacy. This treasury includes as well the prayers and good works of the Blessed Virgin Mary. They are truly immense, unfathomable, and even pristine in their value before God. In the treasury, too, are the prayers and good works of all the saints, all those who have followed in the footsteps of Christ the Lord and by his grace have made their lives holy and carried out the mission the Father entrusted to them. In this way they attained their own salvation and at the same time cooperated in saving their brothers in the unity of the Mystical Body." The treasures that any individual Christian can lay up in heaven are nothing in comparison to those that Jesus himself has laid up, and it is for a portion of his merits that 4th-century Ephrem the Syrian appealed so as to wipe out his own indebtedness. is also seen as a basis for this belief: "Now I [the Apostle Paul] rejoice in my sufferings for your sake, and in my flesh I am filling up what is lacking in Christ's afflictions for the sake of his body, that is, the church, of which I became a minister according to the stewardship from God that was given to me for you". Of this, Michael J. Gorman has written: "Just as Paul constantly reminds his readers that Christ (suffered and) died for them, he now reminds them that he suffers for them, for Christ's body. His role of suffering servant is complemented by his preaching and teaching ministry (1:25) in which he participates in the full revelation of God's mystery to those who believe the message (God's 'saints'), especially among the Gentiles (1:26–27)." In the Summa Theologica, Thomas Aquinas argued that the saints performed their good actions "for the whole Church in general, even as the Apostle declares that he fills up 'those things that are wanting of the sufferings of Christ … for His body, which is the Church' to whom he wrote. These merits then are the common property of the whole Church. Now those things that are the common property of a number are distributed to the various individuals according to the judgment of him who rules them all. Hence, just as one man would obtain the remission of his punishment if another were to satisfy for him, so would he too if another's satisfactions be applied to him by one who has the power to do so." There are various interpretations of what Paul meant by "...in my flesh I am filling up what is lacking in the afflictions of Christ on behalf of his body, which is the church,..." They seem to agree that he does not suggest that the redemptive action of Christ was in any way insufficient. John Chrysostom says, "The wisdom, the will, the justice of Jesus Christ, requireth and ordaineth that his body and members should be companions of his sufferings, as they expect to be companions of his glory; that so suffering with him, and after his example, they may apply to their own wants and to the necessities of others the merits and satisfaction of Jesus Christ, which application is what is wanting, and what we are permitted to supply by the sacraments and sacrifice of the new law." Taylor Marshall notes the recommendation of Jesus to lay up for ourselves treasures in heaven: "Do not lay up for yourselves treasures on earth, where moth and rust destroy and where thieves break in and steal, but lay up for yourselves treasures in heaven, where neither moth nor rust destroys and where thieves do not break in and steal." Confessors and lapsi 
In early Christianity, those who had committed serious sins submitted to a more or less long period of penance before being reconciled with the Church. How to deal with the many apostates at the time of the persecution of Decius constituted a problem. They were known as the lapsi (the fallen). Those who, on the contrary, confessed their faith in Christ and were therefore condemned were referred to as "confessors". Those condemned to death on that charge were called "martyrs" from the Greek word meaning "witness", having given witness unto death. "The martyrs' and confessors' sufferings were credited with the power of compensating the sin of the lapsi", To them the lapsi turned to obtain speedy reconciliation, "utilising for their benefit the merits accumulated by the heroism of the confessors". The Church authorities, especially from the 3rd century on, allowed the intercession of confessors to shorten the time of penance to be undergone by those who sought forgiveness. A priest or deacon could reconcile lapsi in danger of death on the basis of a martyr's letter of indulgence, but in general the intervention of the higher church authority, the bishop, was required. "Officeholders, not charismatic individuals, were to have the final say on admission to the Church's assemblies." Remission of penance 

The 314 Council of Ancyra witnessed in its canons 2, 5 and 16 to the power of the bishops to grant indulgence, by reducing the period of penance to be performed, to lapsi who showed they were sincerely repentant. The Council of Epaone in 517 shows the rise of the practice of replacing a severe older canonical penance with a new milder penance: its 29th canon reduced to two years the penance that apostates were to undergo on their return to the Church, but obliged them to fast once every three days during those two years, to come frequently to church and take their place at the penitents' door, and to leave church with the catechumens before the Eucharistic part commenced. Any who objected to the new arrangement were to observe the much longer ancient penance. It became customary to commute penances to less demanding works, such as prayers, alms, fasts and even the payment of fixed sums of money depending on the various kinds of offenses (tariff penances). By the 10th century some penances were not replaced by other penances but were simply reduced in connection with pious donations, pilgrimages and similar meritorious works. Then, in the 11th and 12th centuries, the recognition of the value of these works began to become associated not so much with canonical penance but with remission of the temporal punishment due to sin, giving on the way to indulgence in the precise sense of the term aside from such penance, which, although it continued to be spoken of in terms of remission of a certain number of days or years of canonical penance, is now expressed as the granting to someone who performs a pious action, "in addition to the remission of temporal punishment acquired by the action itself, an equal remission of punishment through the intervention of the Church". As grounds for this remission of temporal (not eternal) punishment due to sin, theologians looked to God's mercy and the prayers of the Church. Some saw its basis in the good deeds of the living members of the Church, as those of the martyrs and confessors counted in favour of the lapsi. The view that finally prevailed was that of the treasury of merit, which was first put forward around 1230. Protestant view 
In Philip Melanchthon's doctrine of imputed righteousness, it is on account of the alien merit of Christ that a believer is declared righteous by God. Buddhist equivalent

Transfer of merit is a standard part of Buddhist spiritual discipline where the practitioner's religious merit, resulting from good deeds, is transferred to deceased relatives, to deities, or to all sentient beings. Such transfer is done mentally, and it is believed that the recipient can often receive this merit, if they rejoice in the meritorious acts of the person transferring their merit. See also 
 Alexander of Hales
 Communion of saints
 Merit (Catholicism)
 Indulgentiarum Doctrina

References 

Christian terminology
Catholic theology and doctrine
Treasures in religion