/** * Creates self::$JohnsHook * @return \MangoPay\Hook */ protected function getJohnHook() { if (self::$JohnsHook === null) { $pagination = new \MangoPay\Pagination(1, 1); $list = $this->_api->Hooks->GetAll($pagination); if (isset($list[0])) { self::$JohnsHook = $list[0]; } else { $hook = new \MangoPay\Hook(); $hook->EventType = \MangoPay\EventType::PayinNormalCreated; $hook->Url = "http://test.com"; self::$JohnsHook = $this->_api->Hooks->Create($hook); } } return self::$JohnsHook; }