Click here to Skip to main content
16,013,338 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
AVAILABLE TICKETS : 1
if there is one ticket and 3 user are trying to book it .

One user is trying to book the ticket.

other two user are playing a prank of booking a ticket like booking it and going to the payment site and not paying and he is repeating it .

what i have done till now:


i will lock the ticket when a user books it
if both the user are playing a prank the real user who is trying to book the ticket wont be able to book easily as he need to try again and again what can i do here :(


i need standard concepts used in all booking system if many user trying to book the remaining ticket(1) in all websites

thanks in advance
Posted
Updated 10-Dec-11 11:46am
v3
Comments
[no name] 10-Dec-11 10:52am    
not clear :|
mohanrajkiller 10-Dec-11 21:06pm    
Edited now

1 solution

First of all, how is it possible for user one to get to the payment page? If the selected ticket is not available anymore it should reflect this on the very next request to the server.

Another option would be to let user one finish the payment as usual but internally set the status to "on request", meaning that it should be assigned a ticket as soon as gets available or an someone must manually try to resolve this by trying to get a ticket for this user some other way and assign that to the user. The worst case would be that this fails and the user will get its money back (and maybe something like 10% off the next purchase). In some countries there are rules on how such should be handled. Something like tickets can have specific rules that are more lenient due to the fact that you system might depend on other systems that do not only sell tickets to you but also a lot of others. The rule could be that it is possible for the selling party to cancel the purchase in for example 24 hours but of course this should be mentioned to the user.

It would be best to show the user a message about being out of tickets on the next round trip to the server. For websites it is hard to show real time on the page without network overhead. I also wouldn't be to worries such pranks because there is really no fun in doing it. The prankster won't see any direct result and therefor won't get instant gratification doing such a thing. We should of course mind about people that have no life but not in this situation. ;-)

Good luck!
 
Share this answer
 
Comments
mohanrajkiller 10-Dec-11 13:52pm    
i will only decrease the ticket for successive payment
E.F. Nijboer 11-Dec-11 12:20pm    
In that case it is possible that two users book the last ticket at nearly the same time. In that case the status of one of them should indicate that some action must be taken to fulfill this request some other way and might need to reimbursed. Another option could be to have a few spare tickets that cannot be booked but are merely for handling these kind of situations. This is somewhat the same as with hotels that always have at least one spare room in case of an unforeseen incident.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900