My situation is that i have a page and the seller is going to take the order of a client, after the client orders, the seller hits the confirm button and awaits for the client to pass his identification card, wich i do with a ajax request and pop up a dialog with the list of products, a message and a cancel button.
After my ajax is sended in the server side, i'm doing a 'for' with a 'sleep' to check if the user has passed his card and then if he has, i put the items into his bill (persist into the database). The problem is, if that the user decides to cancel de proccess, i can't get the cancel ajax request to work because its busy with the first request on the server side and waiting its return.
Anyone have nay suggestions on that? I really wanted that the workflow of the site works like this:
Client orders -> Seller add the items and hits confirm -> Client passes confirmation or Seller can Cancel -> End of procces