I need to create a gift card / vouchers.
I just want php code.
I have an online store, and I want my users to have the posivilidad to buy a gift card and then another user to buy a product can use that gift card.
I want to develop a php class that can generate a unique ID for each gift, then save that ID in a sql database, with the status of that gift card and then when it is spent that ID can not be used again.
I need that code to be developed safely since every gift is like money.
Please, do not ask me for examples. I want you to give me proposals on how each one would develop.