All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
The basic principle in trade (buying and selling) is that it is permissible unless there is a reason which makes it prohibited.
The transaction that you mentioned can be adapted into a permissible form of compensation.
Allah knows best.