The dictionary says
pay somebody to do something
Ray paid some kids to wash the car.
However, they didn't explain how to use this structure pay somebody to do something correctly.
Is it confusing to say "I paid him 20 dollars to buy the T-shirt"?
That is because "I would buy the T-shirt" or "He would buy the T-shirt".
It could mean I was lazy to buy the T-shirt so I asked him to buy it for me and I would pay him $20 for that.
It could mean I bought the T-shirt from him for $20.