A person cannot recover money paid under a mistake of fact who has received the equivalent for which he bargained, because there is no failure of consideration. Nor is the fact immaterial that he need not, and would not have made the payment had he known the true state of things. A bank, for example, that pays the check of a depositor under the erroneous belief that it has sufficient funds, may not recover from the payee the excess to the depositor's credit. But if the purchaser of goods has paid the price, and the seller fails to deliver them, the purchaser may recover his money. And in any case, a person who has paid money under an agreement which he may rescind and does so, because there was a failure of consideration, may recover what he has paid. An action will lie against a person who sells goods as his own, but which do not belong to him, whenever the real owner claims them from the purchaser. In like manner an action will lie against a person who sells bills, notes, bonds, stock or other securities which prove to be worthless, or against a person who agrees to transfer the title to land which, for lack of title or other reason, cannot pass.
As a rule, the consideration of a contract must totally fail to entitle a person to recover back the money he has paid. If the consideration has only partly failed, the remedy, if there is any, is for a breach of the contract, and not to recover back the money he has paid. Thus, if an article is sold with a warranty of its quality, and it is not worthless, his remedy is an action to recover damages for a breach of the warranty, and not an action to recover back the money paid for the thing purchased.
A liability cannot be imposed on a person without his act or consent. One man cannot force a benefit on another without his knowledge or consent, and then compel him to pay for it. "If a person," says Clark, "intentionally and knowingly performs services for another or otherwise confers a benefit on him without his knowledge, so that he has no opportunity to refuse the benefit, the law will not create a liability to pay for it. So, where a person supplies another with goods, the latter supposing that he is being supplied by another person with whom he had contracted for the goods, the law will not even imply a promise to pay for the goods." Where benefits are conferred by one person on another under such circumstances as to raise no promise in fact or in law to pay for them, he may, nevertheless, become liable by retaining them. Thus, if a person were to receive goods from another reasonably but mistakenly believing them to be intended as a gift, and, after learning of his mistake, should retain them, when he might return them, or if he should receive part of the goods purchased from another, and retain them after failure of the latter to supply the rest of the goods, the law would compel him to pay for them. And the same rule applies where benefits are in any other way received under such circumstances as to create no contractual obligation, and are retained when they should in justice be returned. If, however, the benefits thus received are incapable of being returned, as where they consist of services, or of materials which have been used in repairing a house, no liability is created.