Quantcast
Channel: A bit of this, a bit of that…
Viewing all articles
Browse latest Browse all 10

Clicking more than once may charge your credit card multiple times…

$
0
0

I bought some tickets from the Royal Liverpool Philharmonic Hall (that sounds like I’m all very cultured but, sorry to disappoint, they were for a pirate fancy dress party). At the checkout I was confronted with this:

buy_click_once

Jeysus… Come on. It’s the 21st century for heaven’s sake. Surely this problem has been dealt with before?

Well, yes it has. The common solution is to disable the ‘Buy’ button using JavaScript in its “onclick” handler (or change its text or some such thing). This is probably what I would have done but it has the problem that it falls over if JavaScript isn’t enabled and will incur the wrath of Uncle Dave… You could argue that those without JavaScript enabled probably number less than 10% and then only a tiny fraction of those are going to be trigger happy so it solves the problem more or less. To complement that you could provide a big red warning as above and hide it with JavaScript as the page loads. This would mean it is displayed to those without JavaScript and would be hidden from those with it. This probably fits in with the Unobtrusive JavaScript mantra.

A more meaty non JavaScript solution is to put some sort of form id into a hidden field in the form on the server side when it is first rendered and then store it when the order is first received. Then only process orders that have not already been received. This works but the problem that arises is that after the second, erroneous, click you have to deal with where the user is redirected to so you need to be able to retrieve the order using the hidden value to allow the next page, confirmation or whatever, to be properly served (I can’t use served in this context anymore without thinking of South Park). This requires a bit of thought as the order may not have been processed when the second click is ‘received’ so you may not yet have an order to work against.

So, has anyone else got any bright ideas or should those with an itchy trigger finger be left to suffer the duplicate order fate of their own making?


Viewing all articles
Browse latest Browse all 10

Trending Articles