src/main/php/com-realexpayments-hpp-sdk/RealexHpp.php
public function  requestFromJson($json, $encoded = true)
    {
        $this->logger->info("Converting JSON to HppRequest.");

        //convert to HppRequest from JSON
        $hppRequest = JsonUtils::fromJsonHppRequest($json);

        //decode if necessary
        if ($encoded) {
            $this->logger->debug("Decoding object.");
            try {
                $hppRequest = $hppRequest->decode(self::ENCODING_CHARSET);
            } catch (Exception $e) {
                $this->logger->error("Exception encoding HPP request.", $e);
                throw new RealexException("Exception decoding HPP request.", $e);
            }
        }

        //validate HPP request
        $this->logger->debug("Validating request.");
        ValidationUtils::validate($hppRequest);

        return $hppRequest;
    }
public function  requestFromJson($json, $encoded = true)
    {
        $this->logger->info("Converting JSON to HppRequest.");

        //convert to HppRequest from JSON
        $hppRequest = JsonUtils::fromJsonHppRequest($json);

        //decode if necessary
        if ($encoded) {
            $this->logger->debug("Decoding object.");
            try {
                $hppRequest = $hppRequest->decode(self::ENCODING_CHARSET);
            } catch (Exception $e) {
                $this->logger->error("Exception encoding HPP request.", $e);
                throw new RealexException("Exception decoding HPP request.", $e);
            }
        }

        //validate HPP request
        $this->logger->debug("Validating request.");
        ValidationUtils::validate($hppRequest);

        return $hppRequest;
    }
<p>
Method produces <code>HppRequest</code> object from JSON.
Carries out the following actions:
<ul>
<li>Deserialises JSON to request object</li>
<li>Decodes Base64 inputs</li>
<li>Validates inputs</li>
</ul>
</p>

@param string $json
@param bool $encoded <code>true</code> if the JSON values have been encoded.
@return HppRequest