To see how to obtain the expression stated in the book, it helps to introduce a 'dummy' wavefunction $\psi$ to keep track of our math:
$$H\psi = \frac{1}{2m}(\frac{\hbar}{i}\triangledown-q\vec{A})^{2}\psi$$
Expanding this equation yields:
$$
H\psi = \frac{1}{2m}(\frac{\hbar}{i}\triangledown\cdot\frac{\hbar}{i}\triangledown-\frac{\hbar}{i}\triangledown\cdot(q\vec{A})-q\frac{\hbar}{i}\vec{A}\cdot\triangledown + q^{2}A^{2})\psi$$
$$
H\psi = \frac{1}{2m}(-\hbar^2\triangledown^2 -q\frac{\hbar}{i}\vec{A}\cdot\triangledown + q^{2}A^{2})\psi-\frac{1}{2m}\frac{\hbar}{i}q\triangledown\cdot(\vec{A}\psi)$$
The last term on the right can be expanded as:
$$
\triangledown\cdot(\vec{A}\psi)=\psi\triangledown\cdot\vec{A}+\vec{A}\cdot\triangledown\psi$$
Since the form of the vector potential $\vec{A}$ is given, we can compute the divergence of this potential. In spherical coordinates, it is : $$
\triangledown\cdot\vec{A} = \frac{1}{r \sin \theta }\frac{\partial}{\partial \phi}\frac{\Phi }{2\pi r}=0$$
Substituting the expression back into the original equation yields:
$$
H\psi = \frac{1}{2m}(-\hbar^2\triangledown^2 -q\frac{\hbar}{i}\vec{A}\cdot\triangledown + q^{2}A^{2})\psi-\frac{1}{2m}\frac{\hbar}{i}q\vec{A}\cdot\triangledown\psi$$
and after factorizing and removing the 'dummy' wavefunction, we finally arrive at the expression:
$$
H = \frac{1}{2m}(-\hbar^2\triangledown^2 -2q\frac{\hbar}{i}\vec{A}\cdot\triangledown + q^{2}A^{2})$$