British Gas is to pay £20m over its treatment of customers who had a prepayment meter forcibly installed.