code: public HppResponse responseFromJson(String json, boolean encoded) {
  
  		LOGGER.info("Converting JSON to HppResponse.");
  
  		//convert to HppResponse from JSON
  		HppResponse hppResponse = JsonUtils.fromJsonHppResponse(json);
  
  		//decode if necessary
  		if (encoded) {
  			LOGGER.debug("Decoding object.");
  			try {
  				hppResponse = hppResponse.decode(ENCODING_CHARSET);
  			} catch (UnsupportedEncodingException ex) {
  				LOGGER.error("Exception decoding HPP response.", ex);
  				throw new RealexException("Exception decoding HPP response.", ex);
  			}
  		}
  
  		//validate HPP response hash 
  		LOGGER.debug("Validating response hash.");
  		ValidationUtils.validate(hppResponse, secret);
  
  		return hppResponse;
  	}
docs: <p>
  Method produces <code>HppResponse</code> object from JSON.
  Carries out the following actions:
  <ul>
  <li>Deserialises JSON to response object</li>
  <li>Decodes Base64 inputs</li>
  <li>Validates hash</li>
  </ul>
  </p>
  
  @param json
  @param encoded <code>true</code> if the JSON values have been encoded.
  @return HppRequest