update: v2 of the script includes the section on payouts.
Read writeup here: tutorial
This is an simple web.py application written to handle paypal transactions using the Paypal REST SDK.
This is a simple framework on which you can build upon, using information from the Paypal REST API documentation, or the code repository here.