davide.cucurnia@vola.it
2024-02-05 ca6434daa9ea96df47c3197391a75a06466ebfc0
app/Vola/Services/VolaFakeHTTPResponder/VolaFakeHTTPResponder.php
@@ -51,7 +51,7 @@
            if (!isset($this->sso_XML[$testUser]["picasso"])) {
                return 'this picasso user doesnt exist. check your SSOSESSIONID value';
            }
            $sampleResponseString = Arr::first($this->sso_XML[$testUser]["picasso"]["getWebcustomerInformation"]["parametri"]["t"] );
            $sampleResponseString = Arr::first($this->sso_XML[$testUser]["picasso"]["getWebcustomerInformation"]["parametri"]["k"] );
            $sampleResponseObject = Utils::convertXMLStrToArray($sampleResponseString);
            $resp = [
                'logged' => (string) 1,
@@ -76,7 +76,7 @@
            if (!isset($this->sso_XML[$testUser]["sso"])) {
                return 'this user doesnt exist. check your CAuthCookie value';
            }
            $sampleResponseString = Arr::first($this->sso_XML[$testUser]["sso"]["getWebcustomerInformation"]["parametri"]["t"] );
            $sampleResponseString = Arr::first($this->sso_XML[$testUser]["sso"]["getWebcustomerInformation"]["parametri"]["k"] );
            $sampleResponseObject = Utils::convertXMLStrToArray($sampleResponseString);
            $resp = [
                'logged' => (string) 1,
@@ -103,7 +103,7 @@
        //assumo che se la richiesta sia arrivata fin qui abbia tutti i mandatory nel url
        foreach ($reqParams as $key => $value) {
            //verifico se il metodo dell' utente ha la chiave che sto cercando
            if ($key != "t" && isset($params[$key])) {
            if ($key != "k" && isset($params[$key])) {
                if (array_key_exists($value, $params[$key])) {
                    \Log::channel('requests')->debug("[VolaFakeHTTPResponder] Inserisco xml specifico per key:$key ,params: " . print_r($params, 1) . " key: $key, value: $value, xml: " . print_r($params[$key][$value], 1));
                    return $params[$key][$value];
@@ -111,7 +111,7 @@
            }
        }
        //xml di default (se richiede parametri di default conterrĂ  errori)
        $defaultResponse = Arr::first($params["t"]);
        $defaultResponse = Arr::first($params["k"]);
        \Log::channel('requests')->debug("[VolaFakeHTTPResponder] Inserisco xml di default $defaultResponse per method: $methodUri");
        return $defaultResponse;
    }