The formal laws for defining 2-categories along these lines were first spelled out by Godement:
- Roger Godement, Topologie algébrique et theorie des faisceaux, Hermann, Paris, 1958.
See the "five rules of functorial calculus" given in Appendix 1. Indeed, the horizontal composition of 2-cells is sometimes called the Godement product, and is defined in terms of whiskerings and vertical composites.
Added: it should be said that Godement was speaking of the functorial calculus specifically of $\text{Cat}$, and did not introduce 2-categories as an abstract notion. My understanding is that it was Ehresmann who introduced 2-categories, as a special case of double categories.
The notion of sesquicategory formalizes a context in which one has vertical compositions and whiskerings, but one does not have the crucial interchange equation that was singled out by Godement. Thus, a 2-category is a sesquicategory in which the interchange equation is satisfied (giving the horizontal product). Such a development is indicated in
- Ross Street, Categorical Structures, in Handbook of Algebra Vol. 1 (ed. M. Hazewinkel), Elsevier Science, Amsterdam 1996. (pdf)
This would seem to give what you want.