This sample shows all the code in a single method which I assume is supposed to be embedded in an ASP.NET page. I would like to have something more reusable, so I restructured the code a bit.
Coding Library:
.NET C#
More Authorize.Net Resources:

