Update gateway.class.php

should fix redirect issue