All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
We believe that it is impermissible to oblige the boy to pay a penalty to the girl for backing out of the engagement. Hence, it is impermissible for her parents to take this money or to spend it for the benefit of the mosque, school, or any other charitable institution. For more benefit, please refer to fatwa 82215.
What should be done is to return the money to the boy. However, if he willingly pays a sum of money to the girl, then there is no harm in accepting the gift in this case. When she accepts the money, she has the right to spend it in charity for the benefit of the mosque, school, or any other institution.
Allaah knows best.