public static function convertSumupObjectToArray($object)
    {
        $results = [];
        foreach ($object->_keys as $property) {
            $v = $object->{$property};
            if ($v instanceof SumupObject) {
                $results[$property] = $v->__toArray();
            } elseif (is_array($v)) {
                $results[$property] = self::convertSumupObjectToArray($v);
            } else {
                $results[$property] = $v;
            }
        }
        return $results;
    }
public static function convertSumupObjectToArray($object)
    {
        $results = [];
        foreach ($object->_keys as $property) {
            $v = $object->{$property};
            if ($v instanceof SumupObject) {
                $results[$property] = $v->__toArray();
            } elseif (is_array($v)) {
                $results[$property] = self::convertSumupObjectToArray($v);
            } else {
                $results[$property] = $v;
            }
        }
        return $results;
    }
public static function convertSumupObjectToArray ( $ object ) { $ results = [ ] ; foreach ( $ object -> _keys as $ property ) { $ v = $ object -> { $ property } ; if ( $ v instanceof SumupObject ) { $ results [ $ property ] = $ v -> __toArray ( ) ; } elseif ( is_array ( $ v ) ) { $ results [ $ property ] = self :: convertSumupObjectToArray ( $ v ) ; } else { $ results [ $ property ] = $ v ; } } return $ results ; }
Recursively converts the PHP Sumup object to an array.

@param array $values The PHP Sumup object to convert.
@return array
Recursively converts the PHP Sumup object to an array .