Retail pharmacy giant Rite Aid has agreed to pay $6.8 million to its customers following a significant data breach.