Use the following code to get the Magento PayPal transaction ID from an order object:
$transactionId = $order->getPayment()->getLastTransId();
Getting the PayPal transaction ID
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.