Translation:Shulchan Aruch/Orach Chaim/244
244: What Actions Can the Heathen Perform on Behalf of the Jew.
1 A person agrees [meaning: he stipulates] with the heathen about the work and sets a price, and the heathen does it by himself, and even if he works on Shabbat, it is permissible. When are these words said? When in private; since all don't recognize that this work that is being done on Shabbat is for the Jew. But if it was well known and publicized, it is prohibited; because the one who sees the heathen work, doesn't know that he set a price, and says that so-and-so hired the heathen to do work for him on Shabbat. Therefore, one who establishes work with a heathen to build him his courtyard, or his wall, or to harvest for him his field: if the work was in the state, or in the t'chum, it is forbidden for him to allow him to do work for him on Shabbat because of those who see who do not know that a price has been set. Gloss: And even if he lives among the heathens, there is what to be concerned regarding guests who come there, or members of his household, who will suspect him [Beit Yosef in the name of Responsum of Ashkenazim]. And if the work was outside the t'chum and also no other city is within the t'chum of the place where work is being done, it is permissible. And a heathen that herded sheep belonging to a Jew into a pen of his field – (see below Chapter 537, Section 14).
2 To cut the stones and to fix the roofs, even in the house of the heathen, is forbidden, since it is for the need of something connected to the ground. And if they did so, he should not set them into the building. Gloss: And some say that if the Jew's ownership isn't publicized, it's permissible [Kol Bo].
3 If heathens built a house on Shabbat for a Jew in a forbidden manner, it is proper to be stringent by not entering it.
Gloss: However, if a Jew stipulated with a heathen to not do work for him on Shabbat, and the heathen did it against his will, to finish his work faster, there is nothing to be concerned about [Mordecai, beginning of Chapter "One who Turned"; and Rabbi Yerucham; and Beit Yosef. And see below, Chapter 543].
4 Public work, even to movable objects, such as a boat that is known to be a Jew's, is treated as work to objects connected to the ground.
5 If one hired a heathen for a year or two that he should write for him or that he should sew him clothing, behold he writes and sews on Shabbat as if he arranged with him that he will write him a book or that he will sew him clothing, in which case he works any time he will desire. And that is if he will not count for him day-by-day, and he should not do the work in the Jew’s house. And some forbid when hiring a heathen for a period of time. Gloss: And this is specifically regarding when he was hired to work for a specific task, such as clothing to sew or a book to write. But if he hired him for all work that he will need within the timeframe of the hiring, it is forbidden according to all (Beit Yosef) and as it will be explained, end of Chapter 247.
6 A Jew who buys the right to collect tax and he hires for himself a heathen to collect tax on Shabbat, it is permissible if it is according to kablanut, that is that he says to him, "when you will extract 100 dinarim, I will give you such and such." Gloss: And likewise, he is able to hire a heathen to collect the tax for all the Shabbatot, and the heathen will take the profits earned on Shabbat for himself. And we are not concerned that they will say he is working for the sake of the Jew, because in a situation of loss like this, they were not concerned [Beit Yosef]. And a Jew who oversees money of a king has the same rules applied as one who oversees the tax, and even though they are making sound to be heard on Shabbat through the coins [Haggahot Maimuniyyot, Chapter 7]. And see below, Simon 252. And the Jew should be careful to not sit next the heathen on Shabbat when he's involved with his work with the money or with receiving the tax [Mordecai, first chapter of Shabbat].