I was going to suggest IPN here, but don't think you'll need it. IPN is needed **only** if you want to update something on your site after the payment has cleared. I'll mention both methods in case you decide to rethink how you're automating the registration process. The way IPN works is . . .
Scenario: purchase a download. On your site is:
- order form, non secure as we won't be collecting CC info.
- A "listener" script that listens for the IPN token.
- In payPal, you enable IPN and set the URL to the "listener" script which will receive input for Instant Payment Notification.
Customer places order. On submit, you perform two actions.
1. Enter data into the database, but there is a field, let's call it "completed", that is set to 0 (zero) at this time. All orders with "zero" are not available for download. You also generate some unique ID as a "handle" on the order, this is passed to payPal as "trans_id." This will be passed back to your site to the listener script.
2. You pass all of the available info to payPal for payment.
Normally, on completion you rely on the customer to click the "return to Merchant" link. This is where regular payments fall down; if the customer fails to do this, it fails to update your site. However, with IPN, payPal sends a token that includes "trans_id" to the listener script on completion of payment. The beauty of this is you can accept eChecks, which may not send the token for up to three days. With credit cards, it's relatively instant.
- When the payment is complete, payPal sends the token to your "listener" script. After some validation postbacks, your script locates the placed order via the "trans_id" value, updates the database setting "completed" to 1, sends email to the customer with the unique (and expiring) URL for the download.
You can probably see why you don't need IPN - it doesn't appear your site needs updating after the sale/registration.
See my reply to the first quote above. All that needs to happen is
- Customer fills out form
- Receiving script updates database, emails you the info, whatever.
- The tail end of the script compiles a form of hidden fields using the submitted info and posts those to payPal.
- Customer lands on payPal site with info pre-populated, all they need to do is enter CC info.
The return to merchant link is optional.
As for how to do it - log into your payPal account and hit the documentation, there are tons of examples in multiple server side languages.