I am developing a fraud prevention plugin which sends a flag whether to accept or reject the order based on several parameters.
If the flag is set to reject I need to,
- Cancel the order
- Refund
- Restock
I see a cancel method in WC_Order
but it is for before payment. But I need to do this after payment.