Last post Sep 27, 2017 10:09 AM by mgebhard
Sep 26, 2017 06:14 PM|bandit8327|LINK
So I have an application to write that includes locking a ticket up while a person pays. Hoping someone reading this has developed something like this before. So here's an example then my question.
Two people hit the website. Each wants to buy the same ticket. But until one of them pays its not really sold. Buyer 1 adds it to their cart and heads off to buy it at PayPal. Buyer 2 wants the same ticket but is blocked because of Buyer 1. Buyer 1 arrives
at PayPal and fails to make a payment for whatever reason. I am notified by PayPal that it did not go through so I unblock that seat. Now Buyer 2 could buy it but they have already settled on a different seat that was close but not exactly the one they wanted
and are at PayPal buying it.
So do you just say shit happens and move on or have you found a way to notify Buyer 2 that the seat MAY be available shortly but in waiting you may lose your close second?
Sep 27, 2017 07:32 AM|Billy Liu|LINK
I think you could lock the seat when one of the user click purchase to pay, not at Buyer 1 adds it to his cart.
When the user click purchase, you could check whether the seat is locked or not.
Then lock the seat the and go to paypal if the seat is not locked. Or tell the Buyer the seat is sold and let them to choose another one, if the seat is locked.
And You could unlock the seat when the purchase is failed and at the same time you could send a message to the buyer which has this seat in their cart.
Sep 27, 2017 10:09 AM|mgebhard|LINK
It is not possible for a computer program to know what a user wants. A program can only do what it is told it is up to the user to make a determination,
The ticket can be in 3 states, available, purchasing, purchased. The ticket goes from available to purchasing. Add a timer to the purchasing state, say 10 minutes. If timer times out or the transaction does not complete, set the ticket state to available.
When the ticket is in the purchasing state show the state and the amount of time left in the UI so another user can make a decision on making a purchase.