Processes the response from the gateway