About this toolkit ------------------ This developers toolkit is a Visual Studio .NET 2005 solution that helps you to build extra payment gateways for the eTailer ecommerce module for DotNetNuke. This toolkit contains a full copy of the eTailer Authorize.NET payment gateway, which you can use as an example and template for you own gateway. Prerequisites ------------- 1. You will need at least a runtime copy (i.e. the DotNetNuke PA) of eTailer (source copy is recommended for setting up a debugging environment). 2. Visual Studio .NET 2005. 3. Visual Studio .NET 2005 Web Application Project Extension. Setting up a debugging environment ---------------------------------- It is recommended (though not required) that you have a copy of the eTailer source code as this will allow you to generate debug symbols for eTailer which will in turn allow you to step through the eTailer code and your own payment gateway code when debugging issues with your payment gateway. Copies of eTailer Source Code can be purchased from http://www.emerald-solutions.co.uk/eTailer.aspx#BuyeTailer. If you have a copy of eTailer source, you will note that the VS.NET 2005 project you have contains a Web Site Project that contains both eTailer and a copy of DotNetNuke 4.5.1. To setup debugging of both eTailer and your gateway, you will need to do the following: 1. Publish the eTailer and DNN source with debug symbols. You can do this with the aspnet_compiler.exe tool. I use a batch file containing the following commands: rd "d:\vsprojects\dnn_4_5_1_published" /s /q md "d:\vsprojects\dnn_4_5_1_published" cd "C:\Windows\Microsoft.NET\Framework\v2.0.50727" aspnet_compiler -p "d:\vsprojects\dnn_4_5_1" -d "d:\vsprojects\dnn_4_5_1_published" -v /dnn_4_5_1 -u -fixednames 2. Copy the project output of your new payment gateway to the same location as your published copy of eTailer & DNN. You can do this with post build events on your payment gateway project. I use the following post build event: copy /Y "$(TargetDir)*.dll" "..\..\..\..\DNN_4_5_1_Published\Bin" copy /Y "$(TargetDir)*.pdb" "..\..\..\..\DNN_4_5_1_Published\Bin" copy /Y "$(ProjectDir)AuthorizeNetAIM.ascx" "..\..\..\..\DNN_4_5_1_Published\DesktopModules\eTailer\PaymentGateways\AuthorizeNetAIM.ascx" copy /Y "$(ProjectDir)App_LocalResources\AuthorizeNetAIM.ascx.resx" "..\..\..\..\DNN_4_5_1_Published\DesktopModules\eTailer\PaymentGateways\App_LocalResources\AuthorizeNetAIM.ascx.resx" 3. Configure IIS on your development machine to run your DotNetNuke Portal. 4. Attach your VS.NET debugger to IIS. 5. Run your DNN portal (using IIS) through your web browser. If you do not have the source version of eTailer, then you cannot generate debug symbols for eTailer. To test your payment gateway, you should follow steps 2 - 5 above, but you should publish your payment gateway project to the location of your DotNetNuke portal which contains your PA copy of eTailer. NOTE that in this case, you will only be able to debug your payment gateway, and not the integration between eTailer and your gateway. Developing a new Payment Gateway -------------------------------- eTailer payment gateways are designed to be "plug and play". There are three steps required when creating a new gateway: 1. Create a new Web Application Project for your gateway. 2. Add a single web user control to that new project. 3. Make that web user control implement the "eTailerPaymentGatewayBase" base class. The eTailerPaymentGatewayBase contains abstract methods which you must implement that are called by eTailer at certain points in the application. For example, the method "GoToPaymentGateway" is called by eTailer when a user confirms an order and should be used bu you to either: 1. Submit card details to the payment gateway (Authorize.NET model) OR 2. Transfer the user to the payment gateway (PayPal model). The best way to understand the various methods and properties that you must implement is with a fully working code example, and this development toolkit comes with a full version of the Authorize.NET payment gateway. You can use this as a template for your own gateway development. Deploying a payment gateway --------------------------- Once you have finished building your payment gateway, you have to deploy three files to your DNN portal: 1. The .ascx file that contains your gateway fields. 2. The local resource file (ascx.resx) that contains any localisable strings you have used (NOTE: using a local resource file is not required, but it is recommended that you do so). 3. The compiled assembly (.dll) for your gateway project. There are two ways to deploy the gateway: 1. Manually (copy these files to your DotNetNuke portal installation) Copy the ascx file to DesktopModules/eTailer/PaymentGateways/ Copy the ascx.resx file to DesktopModules/eTailer/PaymentGateways//App_LocalResources Copy the dll to the bin folder. 2. For convenience, you may wish to setup a DotNetNuke module PA to install your new payment gateway on DNN installations which already contain a copy of eTailer. To do this you need the following: 1. A manifesto file (*.dnn) which tells DNN what files to install and where to install them. 2. A ZIP file containing your .dnn file and all files required by your payment gateway. I use a batch file to generate a PA ZIP file from the content of a published Web Application Project, the steps I follow are: 1. Publish payment gateway project to any location on hard drive. 2. Run a batch file containing the following code: md C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install copy C:\Users\Allan\Desktop\a\bin\EmeraldSolutions.eTailer.PaymentGateways.AuthorizeNet.AIM.dll C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install copy C:\Users\Allan\Desktop\a\*.ascx C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install copy C:\Users\Allan\Desktop\a\App_LocalResources\*.resx C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install copy C:\Users\Allan\Desktop\a\eTailer_Gateways_Authorize.NET.dnn C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install "D:\Program Files\7-Zip\7z.exe" a -tzip C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install.zip C:\Users\Allan\Desktop\eTailer_Gateways_Authorize.NET_01_00_00_Install\*.** -r NOTE: 7x.exe is the command line version of 7Zip, a file zipping utility.