Hello, if you want to execute the code when you create the order you can use the 'paymentReturn' hook.
If you want to execute a code when you change the status of the order you can use the hook "actionPaymentConfirmation"
If you have a custom order State u should check if the option "Turn order as Paid" is true.