Cash payment made by a third party to the seller, who then takes installments from the buyer for more

A person sells something to someone for 3,000 Riyals to be paid in installments over a period of 3 months, bearing in mind that the cost would be 2,000 Riyals if paid in one go. Once the agreement is done, a third person comes along and pays for the goods in one go for 2,000 Riyals, and then agrees to take on the three installments from the buyer for 3,000 Riyals. Is this transaction correct?

The first contract goods are sold in exchange for money, and the price is increased due to fixed period in which the full amount will be paid. This contract is permissible.  As for the second contract, where the third party is given 2,000 Riyals in exchange for 3,000 over a period of time, then this is the very definition of interest, and it becomes buying money for more money.