First you need to (should) sign up for an account at :
https://developer.paypal.com/

Pitfall I have never reliably logged on with my Mac OSX 10.3.9 using either FireFox or Safari. Opera works. Also, Win XP home + FireFox 1.5 had trouble

Launch the Sandbox
create 2 accounts with the Sandbox PayPal. One for your merchant and one for your test customer.
Give your customer a credit card [credit card number needs to be valid! expiration date and security code can be anything]
Pitfall Use the 'mail' tab on the sandbox window to confirm your new accounts--don't look in your regular email account.
Hint: If you give your customer a valid email address, your cgi can send notifications there.

Log into your merchant account in Sandbox PayPal. Click on the Profile tab.
Adjust these things:

Instant Payment Notification Preferences
Edit-> On
Url: www.yourdomain.com/cgi-bin/myIPN.cgi
Website Payment Preferences
AutoReturn -> yes
Return url: www.yourdomain.com/cgi-bin/myPDT.cgi
Payment Data Transfer-> On (Make a note of your Identity Token--it's very long so you should copy and paste it somewhere!)
Block Non-encrypted Website Payment -> Off

Now create a button:
My new version (Feb 2006) use's Scott Rossi's PayPal button. So you probably won't need this.

Create a "success.html". It should have tags like these to be replaced later: _name, _email, _key and so on.

Pitfall This page will be manipulated and presented by the cgi. So the paths to all the images, links and css files will need to take that into account.
e.g. before:
<img src="img/my_logo.png">
after:
<img src="../img/my_logo.png"> --the "../" will move you up and over. See the next page for how we'll set up the folders.

>> next >>
more setup