What conditions should be met in order for the bank’s purchase scheme (muraabahah) to be considered permissible
Question

My question is: how sound is the following transaction, what is the ruling on it, what is the ruling on someone who has already gotten involved in it and what should he do?
The details of this muraabahah purchase program (as it is called by the bank) are as follows:
1 – The buyer goes and gets a price list for the bank from the main supplier of the product (a car showroom or agency, for example), including a description of the car, its colour, features and price (100,000 riyals, for example).
2 – The buyer obtains a letter stating his salary, and fills out the required forms to have part of his salary deposited in the bank for the period agreed upon with the bank (for example, three years), to pay off the total cost which includes the basic price plus the bank’s profit (for example, 7%).
3 – The contract is drawn up, including the processing fees (1000 riyals for example) and is signed by the bank, the buyer and the witnesses.
4 – The bank issues a draft cheque payable to the showroom or agency (the supplier) for the value of the car as quoted in the price list referred to in #1 above.
5 – The buyer takes the cheque and gives it to the supplier, who then does all the paperwork needed to register the car in the name of the buyer and gives it to him.
Praise be to Allah.This transaction is haram and is not permitted. Basically this transaction is a loan with interest, which is the essence of riba (usury), because the bank gives the buyer a cheque for 100,000 and takes payment for it in installments, adding interest and what they call processing fees. 
Calling this a purchase does not make it permissible, because this deal is essentially a riba-based loan and not a sale or purchase. Also, the bank is not buying the car from the showroom or selling it to the buyer, rather it is giving him a cheque for that amount. 
Buying products (whether cars or anything else) through the bank is not permissible unless two conditions are met: 
1 – The seller should take possession of this product before selling it. So the bank should buy the car, for example, from the showroom for itself. 
2 – The bank should take the car into its own possession by moving it (physically) from the showroom before selling it to the customer. 
If both or either of two conditions are not met, then the transaction is haram, and the reason for that is that when the bank did not buy the car for itself in a real sense, rather it only issued a cheque on behalf of its customer, that was a riba-based loan, because essentially the bank loaned the price of the car (say, 100,000 riyals) to the customer on the basis that it would take back 170,000 riyals. 
If the bank buys the car then sells it before taking possession of it, that goes against the words of the Prophet (peace and blessings of Allah be upon him) to Hakeem ibn Hizaam: “When you buy something, do not sell it until you have taken possession of it.” Narrated by Ahmed, 15399; al-Nasaa’i, 4613; classed as saheeh by al-Albani in Saheeh al-Jaami’, no. 342. 
Al-Daaraqutni and Abu Dawood (3499) narrated from Zayd ibn Thaabit that the Prophet (peace and blessings of Allah be upon him) forbade selling goods when they have been bought, until the merchants had added them to their own goods. This hadith was classed as hasan by al-Albani in Saheeh Abi Dawood. 
In al-Saheehayn it is narrated from Ibn ‘Abbas that the Prophet (peace and blessings of Allah be upon him) said: “Whoever buys food, let him not sell it until he has acquired it.” Al-Bukhaari, 2132; Muslim, 1525. Muslim added: Ibn ‘Abbas said: I think that this applies to everything else – i.e., there is no difference between food and other things in this regard. Based on this, the bank does not have the right to sell the car until it has taken possession of it. Goods are taken possession of according to custom, and taking possession of a car means that it is moved physically from where it was. Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: “Whatever is moveable, such as garments, animals and cars etc, possession is taken of it by moving it, because this is the custom. From Sharh al-Mumti’, 8/381. 
It says in Fatawa al-Lajnah al-Daa’imah (13/153): If a person asks someone to buy a specific car for him or a car that has certain features that he describes, and promises to buy it from him, and he buys it and takes possession of it, it is permissible for the one who asked for it to buy it from him after that, with cash or in installments for a known profit. This does not come under the heading of a man selling something that he does not own, because the one who was asked for the product only sold it to the one who asked for it after he had bought it and taken possession of it. He does not have the right to sell it to his friend, for example, before buying it, or after buying it but before taking possession of it, because the Prophet (peace and blessings of Allah be upon him) forbade selling a product where it was bought, until the merchants had added them to their own goods. End quote. 
With regard to the one who engaged in such a transaction in the past, if he did not know at the time that it is haram, and he did that thinking that it was permissible, then he does not have to do anything, because Allah says (interpretation of the meaning): 
“So whosoever receives an admonition from his Lord and stops eating Ribaa, shall not be punished for the past” [Al-Baqarah 2:275]
See also Question no. 2492. 
But whoever did that knowing that it is haram has committed the major sin of riba and exposed himself to a declaration of war from Allah and His Messenger. Allah says (interpretation of the meaning):
“O you who believe! Be afraid of Allah and give up what remains (due to you) from Ribaa (from now onward) if you are (really) believers.
And if you do not do it, then take a notice of war from Allah and His Messenger but if you repent, you shall have your capital sums. Deal not unjustly (by asking more than your capital sums), and you shall not be dealt with unjustly (by receiving less than your capital sums)”
[Al-Baqarah 2:278-279]
So he has to repent from this major sin, and resolve not to do that again. 
With regard to making use of the car that was bought in this manner, there is nothing wrong with doing so, in sha Allah, after repenting and regretting. See question no. 22905. 
And Allah knows best.