Westpac has agreed to pay up to $30 million to settle a long-running class action over allegedly excessive insurance premiums which included a trip to the High Court that resulted in common fund orders being struck down in the early stages of class actions.