Pay As You Go
By Al Williams
More and more businesses have begun asking their users to pay for what they receive on the Web. But for Web developers, this introduces a whole new set of problems. I've implemented a few e-commerce sites, and I know what a headache it is to deal with issues like SSL security and transaction processing. However, consider micropayments. Do you really need Fort Knox security after the initial credit card transaction has taken place?
In a micropayment scenario, you wouldn't need a separate transaction for every customer purchase. Users could instead charge up their accounts with funds from a single card transaction, and then spend online from that balance. (Several services, like Stamps.com, already work this way.) Once you've sidestepped the thorny problems of dealing with real-world money, security concerns become much less crucial.
To demonstrate such a system, I developed a prototype fee-based, FAQ list. I decided to use Active Server Pages, because it's easy to use and adept at handling databases. Along the way, I also had to mix in a bit of JavaScript on the client side to make everything work correctly. The complete source code for the project is available as a zip file.
The Design
I wanted to decouple the payment collection portion, which I didn't prototype, from the content delivery portion. There are four key pieces: You need a way to authenticate the user and access his or her account balance. You also need a database of FAQs, and a way to display the FAQs and charge a small amount for each item.