Beginning ASP.NET 1.1 E-Commerce

Another aspect of web development you all seem to be interested in is E-Commerce. We hope to be having some tailor made DMXzone articles coming up on this subject later this year, but for the moment we're going to introduce you one of the latest books on the subject.

Using ASP.NET and VB.NET, Beginning ASP.NET 1.1 E-Commerce, a recent Apress book by Cristian Darie and Karli Watson, builds a web site in three phases of increasing complexity. Starting with a simple PayPal based site, the book moves onto the development of a custom shopping basket and eventually details how to develop a bespoke order pipeline and handle credit card payments yourself.

Whilst more a Microsoft oriented book without specific Dreamweaver information (it concentrates mainly on the server side processing), nevertheless this book contains valuable information for anybody thinking of implementing a .NET e-commerce solution.

In the attached sample chapter, we are taught about credit card processing.

Order a copy from Amazon >>

For convenience we've got a snippet of Chapter 15 on Credit Card Transactions below (the full sample chapter PDF download is available above).

Extract from Beginning ASP.NET 1.1. E-Commerce, Cristian Darie and Karli Watson, Apress, ISBN 1-59059-254-9, 2004, by kind permission of Apress

Understanding Credit Card Transactions

Whichever gateway you use; the basic principles of credit card transactions are the same. First, the sort of transactions you’ll be dealing with in an e-commerce web site are known as Card Not Present (CNP) transactions, which means you don’t have the credit card in front of you, and you can’t check the customer signature. This isn’t a problem; after all you’ve probably been performing CNP transactions for some time now: online, over the phone, by mail, and so on. It’s just something to be aware of should you see the CNP acronym.

Several advanced services are offered by various gateways, including cardholder address verification, security code checking, fraud screening, and so on. Each of these adds an additional layer of complexity to your credit card processing, and we’re not going to go into details here. Rather, this chapter provides a starting point from which you can add these services if required.

With all of these optional extras, the choice will involve how much money is passing through your system, and a trade off between the costs of implementation and the potential costs if something goes wrong that could be prevented if you use these extra services. If you are interested in these services, the “customer service representative” mentioned previously will be happy to explain things.

You can perform several types of transaction, including

  • Authorization: Basic type, checks card for funds and deducts them.
  • Pre-authorization: Checks cards for funds and allocates them if available, but doesn’t deduct them immediately.
  • Fulfillment: Completes a pre-authorization transaction, deducting the funds already allocated.
  • Refund: Refunds a completed transaction, or simply puts money on a credit card.

Again, the specifics vary, but these are the basic types.

In this chapter, you’ll use the pre/fulfill model, in which you don’t take payment until just before you instruct your supplier to ship goods. This has been hinted at previouslyby the structure of the pipeline you created in the last chapter.

Implementing Credit Card Processing

Now that we’ve covered the basics, we need to look at how to get things working in the JokePoint application using the DataCash system. First, you need to obtain a test account with DataCash:

  1. Point your browser at http://www.datacash.com/.
  1. Head to the Support > Integration Info section of the web site.
  1. Enter your details and submit.
  2. From the email you receive, make a note of your account username and password, as well as the additional information required for accessing the DataCash reporting system.

The next step would normally be to download one of DataCash’s toolkits for easy integration. However, because DataCash doesn’t provide a .NET-compatible implementation, you must use the XML API for performing transactions. Basically, this involves sending XML requests to a certain URL using an SSL connection, and deciphering the XML result. This is easy to do in .NET.

NOTE After we have looked at DataCash in detail, we’ll examine the PayFlow Pro system, although we won’t show the code implementation. The code is, however, available in the Downloads section on the Apress web site (http://www.apress.com) for this book.

Ian Blackham

Ian BlackhamFollowing a degree in Chemistry and a doctorate in Scanning Tunneling Microscopy, Ian spent several years wrestling with acronyms in industrial R&D (SEM with a side order of EDS, AFM and TEM augmented with a topping of XPS and SIMS and yet more SEM and TEM).

Feeling that he needed a career with more terminology but less high voltages, Ian became a technical/commissioning editor with Wrox Press working on books as diverse as Beg VB Application Development and Professional Java Security. After Wrox's dissolution and a few short term assignments Ian became content manager at DMXzone.

Ian is a refugee from the industrial Black Country having slipped across the border to live in Birmingham. In his spare time he helps out with the website of a local history society, tries to makes sure he does what his wife Kate says, and worries that the little 'un Noah is already more grown up than he is.

See All Postings From Ian Blackham >>