Why doesn't he want to give you back the 270 DT in cash?
It's not that he can't, it's that he doesn't want to.
For a small business like a bookstore, cash in the till is vital. Giving back 270 DT all at once would make a huge dent in his day.
So he makes a simple calculation: he keeps your real bills, the ones your friend paid for, to cover his rent, suppliers, and employees.
And instead, he gives you gift certificates. On paper, he still owes you 270 DT, but in reality, he's not giving them to you now. He's hoping you'll come back later, maybe, or maybe not.