Gelfand pairs on the Heisenberg group and Schwartz functions