src/main/php/com-realexpayments-hpp-sdk/utils/JsonUtils.php
public static function toJson($hppObject)
    {
        self::Initialise();

        $mapper = self::$mappers[get_class($hppObject)];
        return $mapper->WriteValueAsString($hppObject);

    }
public static function toJson($hppObject)
    {
        self::Initialise();

        $mapper = self::$mappers[get_class($hppObject)];
        return $mapper->WriteValueAsString($hppObject);

    }
Method serialises <code>HppRequest</code> or  <code>HppResponse</code>  to JSON.

@param $hppObject
@return string