Charge-transfer processes in atom-surface collisions at low energies: a Green's function approach