You can certainly do this for payments using the Paypal IPN service which will send a message to a listener when a payment is completed. You could write the listener in PHP and use that to update a database dependent on the message received - which includes details of the transaction.
What I'm not certain of is whether the IPN service supports donations as opposed to payments.