How do I receive and record Paypal transaction variables from POST?
Look at the uc_paypal module included with Ubercart for a fantastic example of this. Look at uc_paypal_menu() (in uc_paypal.module) and uc_paypal_ipn() (in uc_paypal.pages.inc).