Whenever any contract is found to be illegal, for the reasons stated in Sections 5.07 or 5.08 and the city has received the goods or property involved, the council may, by resolution, order the return of the goods or property or retain them, paying for them not at the contract price, but at their fair value, provided such value is not in excess of the contract price. If payment has already been made, the city shall be entitled to recover the excess, if any, over the fair value.