public function testWithArrayParams() { $data = ['notificationCode' => '012345678901234567890123456789012345678', 'notificationType' => 'transaction']; $o = new Notification($data); $this->assertEquals($data, $o->toArray()); $this->assertEquals($data['notificationCode'], $o->getNotificationCode()); $this->assertEquals($data['notificationType'], $o->getNotificationType()); }
/** * 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); }