src/Genesis/API/Notification.php
public function parseNotification($notification = [], $authenticate = true)
    {
        $notificationWalk = [];

        array_walk($notification, function ($val, $key) use (&$notificationWalk) {
            $key = trim(rawurldecode($key));
            $val = trim(rawurldecode($val));

            $notificationWalk[$key] = $val;
        });

        $notification = $notificationWalk;

        $this->notificationObj = \Genesis\Utils\Common::createArrayObject($notification);

        if ($this->isAPINotification()) {
            $this->unique_id = (string)$this->notificationObj->unique_id;
        }

        if ($this->isWPFNotification()) {
            $this->unique_id = (string)$this->notificationObj->wpf_unique_id;
        }

        if ($authenticate && !$this->isAuthentic()) {
            throw new \Genesis\Exceptions\InvalidArgument('Invalid Genesis Notification!');
        }
    }
public function parseNotification($notification = [], $authenticate = true)
    {
        $notificationWalk = [];

        array_walk($notification, function ($val, $key) use (&$notificationWalk) {
            $key = trim(rawurldecode($key));
            $val = trim(rawurldecode($val));

            $notificationWalk[$key] = $val;
        });

        $notification = $notificationWalk;

        $this->notificationObj = \Genesis\Utils\Common::createArrayObject($notification);

        if ($this->isAPINotification()) {
            $this->unique_id = (string)$this->notificationObj->unique_id;
        }

        if ($this->isWPFNotification()) {
            $this->unique_id = (string)$this->notificationObj->wpf_unique_id;
        }

        if ($authenticate && !$this->isAuthentic()) {
            throw new \Genesis\Exceptions\InvalidArgument('Invalid Genesis Notification!');
        }
    }
public function parseNotification ( $ notification = [ ] , $ authenticate = true ) { $ notificationWalk = [ ] ; array_walk ( $ notification , function ( $ val , $ key ) use ( & $ notificationWalk ) { $ key = trim ( rawurldecode ( $ key ) ) ; $ val = trim ( rawurldecode ( $ val ) ) ; $ notificationWalk [ $ key ] = $ val ; } ) ; $ notification = $ notificationWalk ; $ this -> notificationObj = \ Genesis \ Utils \ Common :: createArrayObject ( $ notification ) ; if ( $ this -> isAPINotification ( ) ) { $ this -> unique_id = ( string ) $ this -> notificationObj -> unique_id ; } if ( $ this -> isWPFNotification ( ) ) { $ this -> unique_id = ( string ) $ this -> notificationObj -> wpf_unique_id ; } if ( $ authenticate && ! $ this -> isAuthentic ( ) ) { throw new \ Genesis \ Exceptions \ InvalidArgument ( 'Invalid Genesis Notification!' ) ; } }
Parse and Authenticate the incoming notification from Genesis

@param array $notification - Incoming notification ($_POST)
@param bool  $authenticate - Set to true if you want to validate the notification

@throws \Genesis\Exceptions\InvalidArgument()
Parse and Authenticate the incoming notification from Genesis