Recoupment may be pleaded in all actions ex contractu where the plaintiff is liable to the defendant under the same contract. If the damages of the defendant exceed those of the plaintiff, the defendant shall be awarded the amount of such excess from the plaintiff. (Orig. Code 1863, § 2853; Code 1868, § 2861; Code 1873, § 2912; Ga. L. 1878-79, p. 147, § 1; Code 1882, § 2912; Civil Code 1895, § 3759; Civil Code 1910, § 4353; Code 1933, § 20-1314.)