Script Location

Can someone tell where the script is that updates an order to PROCESSED, FAILED, etc… (using 1.3.5 version). Desperate to find this… will pay for the information if it is correct.