/** * * @param array $data * @throws IfirmaException */ private function _checkResponseBeforePopulatinginvoice($data) { if (!isset($data[Response::KEY_RESPONSE_CONTAINER])) { throw new IfirmaException(sprintf("Unable to create object. Missing \"%s\" container in json response.", Response::KEY_RESPONSE_CONTAINER)); } if (isset($data[Response::KEY_RESPONSE_CONTAINER]) && isset($data[Response::KEY_RESPONSE_CONTAINER][Response::KEY_CODE]) && !Response::isResponseCodeOk($data[Response::KEY_RESPONSE_CONTAINER][Response::KEY_CODE])) { throw new IfirmaException(isset($data[Response::KEY_RESPONSE_CONTAINER][Response::KEY_INFORMATION]) ? $data[Response::KEY_RESPONSE_CONTAINER][Response::KEY_INFORMATION] : "Invalid response."); } }