When I try to purchase online my card doesn’t work.

It works through an app or in person, but online it says payment failed. (Tried on two websites, on two separate occasions)

All details are correct, I’ve not received a text regarding fraud and the websites are legitimate.