What would be the best way to do this with a cart

I have a POS system I am working on and I’ve hit a wall so I’m looking for suggestions

I have the products all working, no issues.
However there are also gift cards available of which a unique number needs to be stored with the name and phone number.
Heres the confusion:
I need to add the value of the gift card into the cart, when clicking the pay button I need it to store the voucher information into a table (only if there is a voucher in there) otherwise I just need to process the payment.
I’m thinking to store the information into Datastore (voucher) and Datastore (cart) but how on earth would I get these 2 to merge?

Any suggestions would be welcome

Community Page
Last updated: