I am developing a online hotel reservation system and I have found the need to put a timer that limits the time a customer can finish his reservation. I am doing this because of some concurrency issues. The timer would span starting from the selection of rooms until after the payment is completed.
I am planning to use paypal but I am not sure if it has a timer feature ( the confirm payment button will be disabled once the time runs out ).
My flow goes like this: Select Room Page -> customer information page (start timer) -> Payment (paypal) -> Result page
Any suggestions are welcome... (I am new to web development) Thanks in advance..
You can always store an UNIX style time in a session:
session_start();
$_SESSION['start'] = time();
And when you want to finish it, you can get the timestamp difference (time elapsed) by subtracting the stored time from the current one:
time() - $_SESSION['start'];
Check http://php.net/time for more information.