Is it sami allah hu leman hameda or hamedah with a slight h? Because I said the former instead of the latter then I wasn’t sure which one was correct so I carried on with my Salah. Is my salah valid?

This is mustahab anyway and so your Salah is valid