If the application is refused, withdrawn prior to notification of the decision on the grant of a European patent or, at that time, deemed to be withdrawn, the fee for grant and publishing shall be refunded (for more details see A-X, 10.2.7).
Rule 71a(6)