/** * Notification Action */ public function notification() { \App::make('pagseguro'); // Register PagSeguro $platform = Config::getPlatform(); $params = array_merge(['notificationCode' => null, 'notificationType' => null], $platform->getUrlParameters()); $code = $params['notificationCode']; $type = $params['notificationType']; if (empty($code) || empty($type)) { $platform->abort(); return; } $credential = $this->getCredentialsTo($code); $notification = new Notification($code, $type); $info = $notification->check($credential); $this->notify($info); }
/** * Route URL * @param array $routeConfig [route-name: string] * @return string */ private function getRouterURL($routeConfig) { $platform = Config::getPlatform(); if (!$platform->hasRouter()) { throw new \RuntimeException('Undefined platform router'); } if (!array_key_exists('route-name', $routeConfig)) { throw new \RuntimeException('Undefined key route-name'); } $routeName = $routeConfig['route-name']; if (empty($routeName)) { return null; } return $platform->getUrlByRoute($routeName); }