(1) The earnest is, in case of doubt, to be credited against the performance owed by the giver of the earnest, or, where this cannot occur, is to be returned when the contract is performed.
(2) If the contract is cancelled, the earnest is to be returned.