PayPal IPN (Instant Payment Notification) script. _xclick
Script which you may download below realizes functionality for quick single good purchase from your site via PayPal payment system. How does it work? Here is an extract from PayPal documentation:

So step 1 in the offered script is accomplished in such a way:
A user clicks Bye button on index.php. Redirect.php starts working. According to the obtained post request in redirect.php form with hidden elements is formed in correspondence with PayPal specification which is sent to PayPal with post request. Besides that an entry is created within data base with payment. Name (here it is recommended to replace item field with field containing the good’s ID), full amount and number are indicated. Now we have our unique payment identifier (payment_id) which we also indicate in the post form.
Notice: You may look up function of post form fields in the PayPal specifications. (https://www.paypal.com/IntegrationCenter/ic_home.html)
Steps 2 and 3:
If user pays an account in PayPal steps 2 and 3 begin their work. From PayPal server data cross as post request to notify.php. Incoming variables are data concerning payment, payer, transaction number and so on. We compare them with values from the data base and in case of success we send these very data with post request to PayPal server for verification. If "VERIFIED" is returned in reply, it means that such payment has really been done.



