All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Selling warranties on computers or other items is not permissible because it involves risk and uncertainty, as stated in Fatwa 34376.
Therefore, you are not permitted to sell it even with the intention of giving in charity the commission that you get from it. Giving what is forbidden in charity is not accepted because Allaah is Tayyib (Good) and only accepts that which is good. Rather, you should be confined in your work to selling lawful items only, even if your salary is small. A Muslim should seek lawful provision even if it is little and avoid what is forbidden even if it is much and easy. Allaah says (what means): {Say, “Not equal are the evil and the good, although the abundance of evil might impress you.” So fear Allaah, O you of understanding, that you may be successful.}[Quran 5:100]
A good earning is a cause for receiving blessing in sustenance, enjoyment in life, for the answering of prayers, aid in obedience, success in the deeds of the world and the Hereafter; and a bad earning is a cause for the wiping away of blessing in sustenance, a miserable life, it prevents the answering of prayers and good deeds, and causes the anger and loathing of Allaah, and it is indeed a great sin.
Therefore, you should seek Allaah’s Forgiveness and stop selling warranties. Also, it is enough to repent from what you have done if you had not known that it was forbidden, and you are not obliged to donate in charity what you earned from it according to the opinion of some scholars; Allaah says (which means): {So whoever has received an admonition from his Lord and desists may have what is past.} [Quran 2:275]