an earlier version has it in
app/code/core/Mage/Sales/Model/Order/Payment.php on approximately line ~1325 in the function
_generateTransactionId which should be called during capture while doing the invoicing.
just fyi, if you have a transaction id equal to
0 this means you have your
authorizenet payment method settings set to
yes, just turn it off and you should be fine assuming it is a test account. You don't need test mode on a test account. If this is not the issue then I am not certain what the issue is as Magento should do this on it's own.
the following stack trace is a result of when the transaction id is zero when capturing a pre authorized transaction...
#0 .../app/code/local/Mage/Paygate/Model/Authorizenet.php(535): Mage->throwException('Gateway error: The ccnumber field is required REFID:...')
#1 .../app/code/local/Mage/Paygate/Model/Authorizenet.php(345): Mage_Paygate_Model_Authorizenet->_place(Mage_Sales_Model_Order_Payment, '5060.98', 'AUTH_CAPTURE')
#2 .../app/code/core/Mage/Sales/Model/Order/Payment.php(290): Mage_Paygate_Model_Authorizenet->capture(Mage_Sales_Model_Order_Payment, '5060.98')
#3 .../app/code/core/Mage/Sales/Model/Order/Invoice.php(268): Mage_Sales_Model_Order_Payment->capture(Mage_Sales_Model_Order_Invoice)
#4 .../app/code/core/Mage/Sales/Model/Order/Invoice/Api.php(236): Mage_Sales_Model_Order_Invoice->capture()