Author JK Rowling has accepted a charitable donation from a law firm which revealed she wrote a crime novel under a pseudonym.

The Harry Potter author says her crime-writing alter ego, Robert Galbraith, had respectable sales before being exposed in the Sunday Times as a pseudonym. Though there had been speculation she had leaked the news to bolster sales, the law firm Russells acknowledged that one if its partners had let the information slip to his wife’s best friend, who tweeted it to a Sunday Times columnist.

Ms. Rowling sued the law firm partner. Her attorney, Jenny Afia, told Britain’s High Court on Wednesday that Ms. Rowling was “distressed by such a fundamental betrayal of trust.”

The firm agreed to reimburse Ms. Rowling’s legal costs and to make a payment to the Soldiers’ Charity.