include/dokument_export.class.php now checks the new signature server response structure

This commit is contained in:
Paolo
2022-05-24 12:22:30 +02:00
parent 7f2025c414
commit 8880e07bf2
+7 -6
View File
@@ -559,18 +559,19 @@ class dokument_export
curl_close($ch);
$resultdata = json_decode($result);
if (isset($resultdata->success) && $resultdata->success == 'true')
// If it is success
if (isset($resultdata->error) && $resultdata->error == 0)
{
$this->signed_filename = $this->temp_folder .'/signed.pdf';
file_put_contents($this->signed_filename, base64_decode($resultdata->document));
file_put_contents($this->signed_filename, base64_decode($resultdata->retval));
return true;
}
else
else // otherwise if it is an error
{
if(isset($resultdata->errormsg))
$this->errormsg = $resultdata->errormsg;
if(isset($resultdata->retval))
$this->errormsg = $resultdata->retval;
else
$this->errormsg = 'Unknown Error:'.print_r($resultdata,true);
$this->errormsg = 'Unknown Error:'.print_r($resultdata, true);
return false;
}
}