Introduction

Microsoft WebMatrix provides an easy way to get started with web development, and together with new Razor syntax for ASP.NET Web Pages it includes everything you need to get your web site up, running and integrated with many other sites and networks, in a short period of time. The WebMatrix helpers are designed to make your life easier when creating web sites. They provide you a simple and consistent way of performing common web development tasks that otherwise would require a great deal of custom coding. With a few lines of code you should be able to secure your web site using membership, store information in Windows Azure Storage, integrate your site with Facebook, among others things.

The PayPal helper for WebMatrix allows you to integrate PayPal payments within your WebMatrix website or e-commerce application. With a few lines of code, you’ll enable your Web site customers to click on a payment button to pay for their purchases with their PayPal accounts.

The helper supports both the PayPal Button Manager API and the Adaptive Payments API. Using the Button Manager API you will be able to create (and manage) PayPal buttons like Add To Cart or Buy Now, that will let your customers purchase single or multiple items, among other things. With the Adaptive Payments API you can process from your WebMatrix web site PayPal transactions, in both simple and complex scenarios. You can build Web applications that handle payments, preapprovals for payments, and refunds.

Get Started in 60 seconds

  1. Download the PayPal Helper library (PayPal.dll)
  2. Create a new website or template in WebMatrix
  3. Create a bin folder off the root
  4. Copy and paste the PayPal library into the bin folder
  5. Download the Documentation for instructions on using the helper
  6. You're done, start using PayPal for payments!

Documentation and Samples

Documentation is available as a separate download available in the Downloads section.

Optionally, you can download a sample WebMatrix web site based on the Bakery Template, where you can see how to use the PayPal helper to capture payments for simple and chained payment scenarios. To download and run it with Microsoft WebMatrix, follow these steps:
  1. Download the sample site from the Downloads section. Extract the contents and open the folder in WebMatrix.
  2. Configure your PayPal API credentials in the _AppStart.cshtml page (to learn how to create testing PayPal accounts for the PayPal sandbox see the documentation in the Downlads section).
  3. Specify the receiver email in the OrderSimpleSuccess.cshtml page.
  4. Specify the emails of the primary and secondary receivers in OrderChainedSuccess.cshtml page.
  5. Run the sample!

Other Useful Resources

Last edited Jan 11, 2011 at 7:44 PM by jsenior, version 14