In a recent post Matt Williams shares how to integrate your application with the PayPal IPN payment gateway service.
PayPal has a huge API reference to integrate it's services into any website. But from personal experience I found that the theory is far more simple than the practice. There are various methods to implement PayPal's services including Soap webservices with 'Express Checkout' and 'Website Payment Pro'. This tutorial will focus on 'Website Payment Pro' and the 'IPN' event listener.
He shows how to send the information as a POST request in one of two ways - as a standard form submission kind of POST and from a script opening a direct socket to the PayPal server and sending over a well-formed request.