Yii2/php - Invalid signed properties hashing (xadesSignedProperties)

@eCloud Thank you for sharing your code on GitHub.
It was very helpful, and it indeed pointed to some very important details that ZATCA did not mention anywhere.

Finally we managed to fix the issue, and here is what we struggled about for weeks!

Hope someone will find this useful:

When you do hashing for SignedProperties, IT MUST follow specific format and could not be changed in any way.

Also, the xml template must follow the same format.
The best way is to use Zatca SDK and sign any invoice, or use their provided sample, and build on it WITHOUT changing formatting of the ext:UBLExtension part, that whole part of xml must stay in same formatting.
it MUST stay as is, or you will never get SignedProperties hash correctly.

Note: xades:SignedProperties must contain namespace declarations (xmlns:) or prefixes, while Invoice XML template must NOT contain those namespaces.

Also, canonicalizeing xml (C14N) as mentioned in updated ZATCA guide, did NOT WORK in our case.

Hope this helped.
Good luck!