I think there is a distinction between a charitable donation pop-up that forces the user to round up, donate, or actively select 'no donation' is a dark pattern.
Whereas having the option to select a charitable donation, or passively ignore it, as a part of the normal checking out is fine.