No, it has to be paid after the work contract ends, either in one go or monthly.
From what I could read the amount must be "reasonable": between 1/3 and 2/3 of the salary depending on how wide the non-compete is (https://www.village-justice.com/articles/montant-contreparti...)
It has to be a financial compensation during the period covered by the non-compete. I think it also has to match your salary (otherwise it would be easy to exploit), but I'm not 100% sure.
This is hard to say and I am not a lawyer. As I understand, the non-competes financial compensation has to be given when the contract end, therefore, it cannot be included in the salary.