I don't think its legal, considering that not too long ago even here on HN there was a post about "Pay or Okay" not being considered legal https://news.ycombinator.com/item?id=38458660
Some further articles/document about it:
https://noyb.eu/en/statement-edpb-pay-or-okay-opinion
https://www.edpb.europa.eu/system/files/2024-04/edpb_opinion...