Gifting with process receipt

i have no clue how to do this

how would i save which player the gift is supposed to go to

my code for buying normal items works well but if i want to add gifting i would have no way of knowing who to gift it to because process receipt is its own thing separate from the code of picking a target to gift and i dont know how i would connect them

my only idea is a bindable event which is fired after the purchase is completed which the gifting code waits for but i dont think this would be optimal

help