public static function buildJsonFromArray($data, $rootElement = '')
    {
        if (!is_array($data)) {
            return null;
        }

        if (!empty($rootElement)) {
            $data = array($rootElement => $data);
        }

        $data = self::setSenderProperty($data);

        return json_encode($data);
    }
public static function buildJsonFromArray($data, $rootElement = '')
    {
        if (!is_array($data)) {
            return null;
        }

        if (!empty($rootElement)) {
            $data = array($rootElement => $data);
        }

        $data = self::setSenderProperty($data);

        return json_encode($data);
    }
public static function buildJsonFromArray ( $ data , $ rootElement = '' ) { if ( ! is_array ( $ data ) ) { return null ; } if ( ! empty ( $ rootElement ) ) { $ data = array ( $ rootElement => $ data ) ; } $ data = self :: setSenderProperty ( $ data ) ; return json_encode ( $ data ) ; }
Function builds OpenPayU Json Document

@param string $data
@param string $rootElement

@return null|string
Function builds OpenPayU Json Document