Thank you for this. One last thing,
When a user creates an order, proceeds to the payment option and is about to pay but aborts the transaction all together. An order gets created on my side saying awaiting payment but after a time limit woocommerce auto cancells it due to it not being cancelled. Your software creates an invoice for that order.
I dont want an invoice created for an order which the user abandoned. How can I work around this?