I'm using a payment gateway module (Oitoo, that contacts the service from Cielo - in Brazil) to capture and approve credit card transactions during checkout. When a card is approved, everything goes smooth and fast, the module talks to Cielo via webservice, gets the ok and the order is finalized.
When the card is rejected, the response comes quickly from Cielo (I've logged it), but Magento gets stuck waiting for over 2 minutes before showing a dialog with the message telling us the transaction failed.
It all runs fast until a line that thwrows an exception with the message that will be shown to the user later on:
Mage::throwException(Mage::helper('payment')->__('Error Message goes here...'));
This exception is quickly logged to exception.log.
After that, Magento goes who knows where and only returns 2 minutes later. The whole session halts. Even opening a new tab on the store domain on the same browser will keep you waiting. The website works fine on another browser, so it's not a server freeze.
For backend orders everything works fine, no delays.
I've tried to contact the module developer but had no response so far. But it's known to work.
What could possibly be going on? Could it be that some SQL transactions have to be rolled back and that is what takes so long?