How I Reimplemented My Shopping Cart To Sell More Software, w/ Code
bingocardcreator.com
bingocardcreator.com
Article includes:
+ Results of my A/B tests with previous ways of presenting software for sales to my customers.
+ How I use lightboxes to make a good deal of money
+ An AJAX cart I have used to good effect
+ How I went about designing and reimplementing a cart, in JS, to give the feel of the AJAXy one but improve its speed and UI
+ Code for everything, which I put in the public domain. Go nuts.
Great advice, I like your insight into how users interact with shopping carts. I'll be taking this with me on my project!
FYI: the link to e-junkie at the end of the page is broken. It points to: http://www.e-junkie/
Two possible ways to do this:
1) Use a different HMAC key for each page you generate. 2) HMAC the pair (price,nonce) where nonce never repeats from one page to another. The server has to keep the nonce, as well, i.e. is not obtained from the web page.
var forSale = {
"book": {"price": 19.95, "description": "a book", "checksum": "c6da835c1fd2ee98d68eee3912dd199e41c82a32"}
}
The value for 'checksum' is just a SHA1 hex digest of the ('book', '19.95', 'secret'), joined by tab characters. It can be included as a hidden form field or invisible element within your page; it doesn't matter so long as you can capture it and POST is along with the item + price.In your order-processing logic, just check that the hash verifies with your secret key ('secret' in the above), and you know with a reasonable degree of certainty that the original page was one generated by your server.
The cart posts directly to them, so hypothetically assuming I generated a secret and passed it over, they'd process the order anyhow and then tell me "By the way, your website passed this secret with the order -- do whatever with it", after which point a) the customer would have a registration key and b) if they ordered a CD, it would be scheduled to ship already.
Which is a long way of saying "There are ways to make this setup more secure but they'd involve me having to rewrite large portions of my business processes." Like I mentioned: it would cost me a lot of time at a very minor increase in security.
Probably illusory, actually. No amount of securing my cart will protect me from this attack: buy the software, write me an email saying "You offer an unconditional guarantee. I'd like a refund." And there is absolutely nothing that anyone could say or do which would make me stop offering that unconditional guarantee, because it is practically a license to print money. (To anyone who produces a low-marginal-cost product or service: if you do not have a guarantee, start A/B testing one. Its the closest thing in life to free money.)
It might have been an earlier edition of this one, but I do remember the bright red cover: http://www.amazon.com/Hacking-Exposed-Web-Applications-2nd/d...
A separate issue is that using this hash(message, secret) construction has problems if the underlying hash function has chosen-prefix collisions. MD5 has this problem already. While no one knows how to generate such collisions for SHA1, the fact that its design is close to MD5 is cause for concern. In contrast, if you use HMAC, you have confidence that the data was generated by you with much weaker assumptions on the hash function. The wikipedia page for HMAC has some useful discussion here and pseudocode: http://en.wikipedia.org/wiki/HMAC
Why not just print your JS from server-side - i.e. you can still have your prices in your JS but have the server generate these?
Is this an invitation to get a 1 penny trial version of your software?
Should be mechanical_fish I think.
It should fall-through to e-junkie's traditional non-Javascript cart hosted offsite. I personally think the experience is decidedly suboptimal next to either of the JS carts but, honestly, I think the Internet is moving away from assuming that Javascript is optional.
(I would have a different opinion if I had to support a range of mobile browsers but, well, I sell downloadable software to elementary schoolteachers. Most of them don't think "Ooh great I loved this downloadable free trial! Let me write down the URL, get out my iPhone, type in the URL, then order a copy!")
But yeah, to the extent that people find this article as valuable and link to it, Google will see my site as more trustworthy and send me more frazzled teachers trying to get ready for fourth period.
I really don't have a problem with that: they get their prep work done, I get money, the rest of the world gets a few hours of engineer time writing what I hope was a useful article as a result of the cross-subsidy. The notion is quite similar to OSS. Its a win for everybody.