This paper deals with the problem of an electron in a non-homogeneous magnetic field perpendicular to a plane. From the classical point of view this is an integrable, but not superintegrable, solvable system. In the quantum framework of the Dirac equation this integrable system is solvable too; the energy levels and wavefunctions of bound states, for its reduction to the plane, are computed. The effective onedimensional matrix Hamiltonian is shown to belong to a shape-invariant hierarchy. Through this example we will shed some light on the specific properties of a quantum integrable system with respect to those characteristic of superintegrable systems.