I want to put some code when an order change from new to processing.
I found the changeState and setState method but it is not the right place for me.
I want a code (used in admin and front) thaht will be executed after payment success (if Card payment is used), or after admin click on invoice button in admin (in the other case)
The aim of this code is to ckeck vi SOAP a databse and cancel invoice or not ?
I hope someone know where exactly is the best place for that.
I found some files but was not able to cancel invoice generation.
Thanks in advance.