Re: Double click problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 19, 2008 at 11:48 AM, tedd <tedd@xxxxxxxxxxxx> wrote:
> Hi gang:
>
>  I have a situation where users can purchase stuff online.
>
>  In the last step in the process, the user clicks a "confirm purchase"
>  button and their credit card is checked and if it's valid, they are
>  awarded the product. Everything works, but it takes a little time to
>  check the credit card.
>
>  During the time it takes to send the credit card information to the
>  clearing house and get back an "Ok" with a transaction ID, the user
>  can click the "confirm purchase" button more than once. As such, more
>  than one order can be made during the process.

    I'd use a JavaScript onClick event to disable the button, but I'd
back it up with a timestamp tracker to compare clicks of the button.
If someone clicks the button and, for whatever reason, the script
times-out, they'll probably try to order again.  No sweat.  The
timestamp tracker can verify that the order was not successful within
(n) (duration), and if one is found within said duration, the user is
shown a message stating that their order has already been processed,
with an option to purchase the item again if that was their intent.
If there wasn't a successful response from the payment processor, the
timestamp isn't recorded, and the purchase can go through as expected.

-- 
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux