I am having a serious issue here. When a customer places an order in the one page check out area, He gets redirected to the payment gateway. Now the issue is , Only when the customer clicks the cancel button in the payment gateway that the order is cancelled. But if the customer clicks the go back button on the browser it shows that the cart is empty, but in the backend the order is still under processing. The same goes when I just close the payment gateway window , the order will be still in processing mode.This shouldnt be like that as its a serious loop hole
If this payment gateway works as such that you must hit complete order in magento to get to it (like paypal standard), there is no way out of the box to make it go from pending to canceled. Unless it is programmed to do so after some time.
I believe your best option is to cancel pending orders after some time programmatically.