3
When trying to create the payment, I get the following error. I am using the following package: https://www.nuget.org/packages/Uol.PagSeguro
Additional information: For security reasons, the DTD is prohibited in this XML document. To enable DTD processing, set the Dtdprocessing property in Xmlreadersettings as Parse and pass the settings for the Xmlreader.Create method.
I’m using a test code offered by Gypsy in this topic:
The exception is raised in the following line:
var paymentRedirectUri = payment.Register(credentials);
I’m also using the environment sandbox of Pagseguro, and I’ve checked the credentials and the sent URL (before was giving error 401).
I can get around the error described above by editing the API code in the following code block:
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
using (XmlReader reader = XmlReader.Create(response.GetResponseStream(), settings))
{
//Codigo pagseguro
}
However, when making this change, I get the following error when the API reads XML
Additional information: Invalid character in the provided encoding. Line 20, heading 48.
Give more information on how you are doing.
– Maniero
Updated question. Is there any other information I can give that is useful?
– Raphael Marques
I don’t know why I don’t understand the subject, but I know that showing only the error doesn’t help much. It’s always good to put what you’ve done.
– Maniero
What has been accomplished is exactly what is in the question answered by Gypsy. The code is even the same, only for testing the integration of the API. However, this error is emerging.
– Raphael Marques