public static function treat($requestBody, $authentication = null)
    {
        $postArray = json_decode($requestBody, true);

        if ($postArray === null) {
            throw new Exception\UnknownAPIResourceException('Request body is not valid JSON.');
        }

        $unsafeAPIResource = Resource\APIResource::factory($postArray);
        return $unsafeAPIResource->getConsistentResource($authentication);
    }
public static function treat($requestBody, $authentication = null)
    {
        $postArray = json_decode($requestBody, true);

        if ($postArray === null) {
            throw new Exception\UnknownAPIResourceException('Request body is not valid JSON.');
        }

        $unsafeAPIResource = Resource\APIResource::factory($postArray);
        return $unsafeAPIResource->getConsistentResource($authentication);
    }
public static function treat ( $ requestBody , $ authentication = null ) { $ postArray = json_decode ( $ requestBody , true ) ; if ( $ postArray === null ) { throw new Exception \ UnknownAPIResourceException ( 'Request body is not valid JSON.' ) ; } $ unsafeAPIResource = Resource \ APIResource :: factory ( $ postArray ) ; return $ unsafeAPIResource -> getConsistentResource ( $ authentication ) ; }
This function treats a notification and verifies its authenticity.

@param   string  $requestBody     JSON Data sent by the notifier.
@param   Payplug $authentication  The client configuration.

@return  Resource\IVerifiableAPIResource  A safe API Resource.

@throws  Exception\UnknownAPIResourceException
This function treats a notification and verifies its authenticity .