The paypal program enables sale of software or other products from a web site and secure processing of payments via PayPal. The paypal program allows for significant degree of flexibility in the configuration of the sale process, with up to 128 custom URL parameters controlling the flow of the sale. For the minimum startup configuration only 2 parameters are required: item_number and item_name.



Here are step by step instructions on setting up paypal program on the web server, and configuring it to sell product_x (item_name=product_x):
  1. Create PayPal account. It can be personal or business account.
  2. Login to PayPal account and click on My Account tab. Then click on Profile tab. Down the page click on Web Payment Preferences. Have the following options turned On or Off Click on Merchant Services and then on Buy Now Button. On the next page choose the following values: Scroll down the page and click on Add More Options button. On the next page choose Click on Create Button Now. On the next page select and copy HTML form code provided in the window and save it. That piece of HTML code will be used in 3.htm file in step 10. You may want to add target=_top string to form action tag if you are using frames or iframes.
  3. Create product_x home page. This page is an example of product home page. The product_x home page should have URL link to product_x purchase page, with 2 mandatory parameters: item_number and item_name as in example:
    <A HREF="">Buy product_x</A>
    The part in the URL link should be the same one used for Return URL parameter in step 2 above when creating Buy Now Button
  4. Install paypal executable into cgi-bin directory of the web server under some name, e.g. p, so that the full URL to that executable is the same as was typed in the step 2 when creating Buy Now Button, for example
  5. Type the URL into the browser and verify the executable works. It should produce "paypal: no license found" string in the browser window.
  6. Create subdirectory paypal under cgi-bin directory of the web server. Make nobody the owner of cgi-bin/paypal subdirectory.
  7. Generate paypal.key license file and copy it to cgi-bin/paypal subdirectory. Set the permissions on the paypal.key file so that the nobody account is able to read paypal.key file.
  8. Create subdirectory item_number under cgi-bin/paypal directory of the web server. Here item_number should actually be the numeric Item ID, for example cgi-bin/paypal/119 if item_number=119. Create symbolic link cgi-bin/paypal/item_name→cgi-bin/paypal/item_number, for example cgi-bin/paypal/product_x→cgi-bin/paypal/119
  9. Create subdirectory cgi-bin/paypal/item_number/trans, for example cgi-bin/paypal/119/trans if item_number=119. The cgi-bin/paypal/item_number/trans subdirectory will store paypal confirmation pages for all purchases.
  10. Create the following files under cgi-bin/paypal/item_number subdirectory. Click on the links to see the examples of the files. Note:

paypal executables available for download:
Linuxpaypal_linux.tgzTest the paypal executable on command line. It should print some HTML output. If it coredumps or errors out on incompatible library, send email to support, describing the problem.
MS Windows cygwinpaypal_cygwin.tgzThe executable requires cygwin1.dll library to be present in the PATH.

Please email questions or comments to