If the Employment Act applies, as long as the arrangement is
1) on a working day,
2) during working hours, and
3) a place mutually agreed to pay / receive salary,
It is legal.
Alternatively – and usually the case – employer can pay directly to your bank.
Reference can be found under my Page “Sources”:
Payment of Salary