Barclays is to pay millions in compensation for recent IT outages which prevented customers from banking.