code: public String responseToJson(HppResponse hppResponse) {
  
  		LOGGER.info("Converting HppResponse to JSON.");
  
  		String json = null;
  
  		//generate hash
  		LOGGER.debug("Generating hash.");
  		hppResponse.hash(secret);
  
  		//encode 
  		LOGGER.debug("Encoding object.");
  		try {
  			hppResponse = hppResponse.encode(ENCODING_CHARSET);
  		} catch (UnsupportedEncodingException ex) {
  			LOGGER.error("Exception encoding HPP response.", ex);
  			throw new RealexException("Exception encoding HPP response.", ex);
  		}
  
  		//convert to JSON
  		LOGGER.debug("Converting to JSON.");
  		json = JsonUtils.toJson(hppResponse);
  
  		return json;
  	}
docs: <p>
  Method produces JSON from <code>HppResponse</code> object.
  Carries out the following actions:
  <ul>
  <li>Generates security hash</li>
  <li>Base64 encodes inputs</li>
  <li>Serialises response object to JSON</li>
  </ul>
  </p>
  
  @param hppResponse
  @return String