when a user creates an order I store it in a database and redirect user to payment platform, but if user doesn’t complete purchase and returns to the the website and creates a new order it gets stored as well. So in theory 100 unpaid orders could get stored.
I was asked to make that only one unpaid order be stored by user. There is no user login needed for creating an order.
I’m thinking of storing session token in order and deleting it once order is completed, but I don’t know if this is a correct way to go?