I think the main problem is that I’m using the custom gateway (we’re using the special tokens instead of money).
I implemented the process_payment method in my custom gateway where I send all requests. But this method runs after the process_checkout method from the standard WooCommerce functionality. So, the process_checkout creates the order, and only after that my custom gateway checks whether the user has enough tokens or not.