What do I need to use straight talk on an iPhone?

I'm on eBay looking for a iPhone 4 as long as its unlocked does it matter what carrier it was? Because its hard to find a tmobile one they are mostly att. On straight talks website they only sell tmobile SIM cards now. What should I do

Yea, I think as long as it's unlocked it should be fine.
I bought an iPhone 4S on eBay (The carrier was AT&T) and, I'm planning to use it on T-Mobile.