Aidan Garnish

Collaboration Not Competition

PayPal example project C# ASP.Net

A few weeks ago I spent some time integrating PayPal Express Checkout into http://bookhashtags.com so that I could take payments for the featured book spot.

Whilst PayPal produces a lot of documentation and provides some tools to help generate code these were not always that helpful. For example the code wizard produces code that doesn't build and uses a very old version of the API which means that a lot of the things you can now do according to the documentation just didn't work and it wasn't immediately obvious why.

I have put together a bare bones Visual Studio 2010 project that will give you a quick understanding of the basics of the three Express Checkout calls (SetExpressCheckout, GetExpressCheckoutDetails and DoExpressCheckout) you need to make to get things working.

To get the project to run you will need to set up a PayPal sandbox account here - https://developer.paypal.com

You will need to add your sandbox account username, password and signature in the NVPAPICaller class.

Once that is done just press play, change the default values on the default.aspx page and hit the Pay button.

The example only adds one item and doesn't handle shipping costs. For more information on parameter names etc. see the PayPal Express Checkout Integration pdf

Download the project