$order = Mage::getModel('sales/order')->load($orderId); $order->setLastTransId('12345'); $order->save();
$payment = $order->getPayment(); $payment->setLastTransId('12345'); $payment->save();This code gets the payment object associated with an order, sets the last transaction ID to 12345, and saves the payment object. In both examples, the setLastTransId() method is used to set the last transaction ID for an object. The package library used in this code is Magento.