public function setInput($input, $isDecoded = false) {
		if(!$isDecoded)
			$input = json_decode($input, true);
		if(!$input) {
			if($this->logger) $this->logger->error('Could not decode input', array('input' => $input));
			throw new WebHookHandlerException('Could not decode input', WebHookHandlerException::INPUT_DECODE_FAILED);
		}
		if(empty($input['payload'])) {
			if($this->logger)
				$this->logger->error('No payload in input data');
			throw new WebHookHandlerException('No payload in input data', WebHookHandlerException::NO_PAYLOAD);
		}
		if(empty($input['payloadEncrypted']))
			$input['payloadEncrypted'] = false;
		
		if($input['payloadEncrypted']) {
			if(empty($this->privateKey)) {
				if($this->logger)
					$this->logger->error('No private key supplied for encrypted payload.  Please pass the private key in the constructor');
				throw new WebHookHandlerException('No private key supplied for encrypted payload.  Please pass the private key in the constructor', WebHookHandlerException::NO_PRIVATE_KEY);
			}
			if(empty($input['envKey'])) {
				if($this->logger)
					$this->logger->error('No envelope key in input payload');
				throw new WebHookHandlerException('No envelope key in input payload', WebHookHandlerException::NO_ENVELOPE_KEY);
			}
		}
		$this->input = $input;
		return $this;
	}
public function setInput($input, $isDecoded = false) {
		if(!$isDecoded)
			$input = json_decode($input, true);
		if(!$input) {
			if($this->logger) $this->logger->error('Could not decode input', array('input' => $input));
			throw new WebHookHandlerException('Could not decode input', WebHookHandlerException::INPUT_DECODE_FAILED);
		}
		if(empty($input['payload'])) {
			if($this->logger)
				$this->logger->error('No payload in input data');
			throw new WebHookHandlerException('No payload in input data', WebHookHandlerException::NO_PAYLOAD);
		}
		if(empty($input['payloadEncrypted']))
			$input['payloadEncrypted'] = false;
		
		if($input['payloadEncrypted']) {
			if(empty($this->privateKey)) {
				if($this->logger)
					$this->logger->error('No private key supplied for encrypted payload.  Please pass the private key in the constructor');
				throw new WebHookHandlerException('No private key supplied for encrypted payload.  Please pass the private key in the constructor', WebHookHandlerException::NO_PRIVATE_KEY);
			}
			if(empty($input['envKey'])) {
				if($this->logger)
					$this->logger->error('No envelope key in input payload');
				throw new WebHookHandlerException('No envelope key in input payload', WebHookHandlerException::NO_ENVELOPE_KEY);
			}
		}
		$this->input = $input;
		return $this;
	}
public function setInput ( $ input , $ isDecoded = false ) { if ( ! $ isDecoded ) $ input = json_decode ( $ input , true ) ; if ( ! $ input ) { if ( $ this -> logger ) $ this -> logger -> error ( 'Could not decode input' , array ( 'input' => $ input ) ) ; throw new WebHookHandlerException ( 'Could not decode input' , WebHookHandlerException :: INPUT_DECODE_FAILED ) ; } if ( empty ( $ input [ 'payload' ] ) ) { if ( $ this -> logger ) $ this -> logger -> error ( 'No payload in input data' ) ; throw new WebHookHandlerException ( 'No payload in input data' , WebHookHandlerException :: NO_PAYLOAD ) ; } if ( empty ( $ input [ 'payloadEncrypted' ] ) ) $ input [ 'payloadEncrypted' ] = false ; if ( $ input [ 'payloadEncrypted' ] ) { if ( empty ( $ this -> privateKey ) ) { if ( $ this -> logger ) $ this -> logger -> error ( 'No private key supplied for encrypted payload.  Please pass the private key in the constructor' ) ; throw new WebHookHandlerException ( 'No private key supplied for encrypted payload.  Please pass the private key in the constructor' , WebHookHandlerException :: NO_PRIVATE_KEY ) ; } if ( empty ( $ input [ 'envKey' ] ) ) { if ( $ this -> logger ) $ this -> logger -> error ( 'No envelope key in input payload' ) ; throw new WebHookHandlerException ( 'No envelope key in input payload' , WebHookHandlerException :: NO_ENVELOPE_KEY ) ; } } $ this -> input = $ input ; return $ this ; }
Set the WebHook input

You can use the class to process an input after the fact by setting it here.  Otherwise it is automatically fetched from the HTTP request body

@param string|array $input
@param boolean $isDecoded
@throws WebHookHandlerException
@return static
Set the WebHook input