The Hachamim prohibited "Sechar Shabbat"-receiving compensation for work done on Shabbat. However, it is permissible to receive payment for such work if it is subsumed in payment for other work that was not done on Shabbat. This leniency is known as "Havla’ah."
The Shemirat Shabbat K’Hilhata discusses a number of practical applications of "Havla’ah." Generally, there is no issue for a Jewish hotel owner to receive a rental fee for a room that was booked just for Shabbat, since included in that fee is also the time the guest spent in the room immediately before and after Shabbat. Theoretically, even if a guest would arrive with the onset of Shabbat and depart as Shabbat concluded, the payment would still include the cooking and cleaning done before Shabbat to prepare for his arrival.
The case of waiters who work only for a few hours on Shabbat presents a more serious issue. If they are not assigned a task before or after Shabbat, then there is no possibility of "Havla’ah," and it is a problem to receive that compensation. Similarly, in order to pay a babysitter for work done only on Shabbat, they should be assigned an additional responsibility before or after Shabbat so that the payment can be subsumed in it. There is also the possibility of giving them the compensation as a gift, but that is deemed as bordering on trickery.
One may receive compensation for work done on Shabbat, if the payment is subsumed in another payment due for other work not done on Shabbat.