public static function objectToArray($values)
    {
        $results = array();
        foreach ($values as $key => $val) {
            if ($val instanceof RpayLiteObject) {
                $results[$key] = $val->__toArray(true);
            } elseif (is_array($val)) {
                $results[$key] = self::objectToArray($val);
            } else {
                $results[$key] = $val;
            }
        }
        return $results;
    }