I have taken a loan from my company for about 4000 D. The agreement was that I pay a fixed amount of money every month until I paid the loan for a total of the same amount that I took (4000D). But after that I discovered that the company agreed with a bank to give me the loan and the company will pay the interest amount after I paid the 4000D. I don't know if that money is considered as a Riba or not. I want to inform you that all banks in my country are dealing with Riba and I really need the money to buy a flat in order to marry, and renting is not allowed in this country.
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
You have committed no sin by taking the money from the bank since it is merely a good loan; you took a certain amount and repay the same amount. You have no connection with what is going on between your company and the bank, especially since you came to know of that after having completed the legal procedure of the loan.
However, if you carried out the contract directly with the bank then it would be a forbidden contract, regardless of whether you paid the interest or your company paid it, because the original contract included dealing with Riba. Therefore, you would have to return the amount you took since it would be forbidden.
Generally, taking loans with Riba is forbidden. So, no one should take such a loan if they can avoid it. But, if one is compelled, it is permissible only to fulfill his necessity. This permissibility is based on the known rule of Sharee’ah 'Necessity makes what is forbidden permissible.” There is another rule that ‘a necessity is estimated only to the extent of its being dire.' This means one can use the forbidden thing only to the degree that he reduces the state of compulsion.
Having a house, in fact, is a necessity if no accommodation is available to rent. However, taking interest-based loans is forbidden if rented accommodations are available, since in this case, the necessity no longer exists. The same rule applies to any necessity such as the necessity to food, clothes, etc.
Allah knows best.
You can search for fatwa through many choices