Correção de bug para faturas com "," no nome do arquivo
This commit is contained in:
parent
6254d9fec8
commit
58dc1924ba
@ -47,7 +47,7 @@ public class Program
|
|||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var iD = JsonDocument.Parse(response.Content.ReadAsStringAsync().Result).RootElement.GetProperty("requestId");
|
var iD = JsonDocument.Parse(response.Content.ReadAsStringAsync().Result).RootElement.GetProperty("requestId");
|
||||||
fatura.MoveTo(fatura.Directory?.Parent?.FullName + $@"\3 - PROCESSANDO\ID {iD} - " + fatura.Name);
|
fatura.MoveTo(fatura.Directory?.Parent?.FullName + $@"\3 - PROCESSANDO\ID {iD} - " + fatura.Name.Replace(",", string.Empty));
|
||||||
sw.Write(iD);
|
sw.Write(iD);
|
||||||
sw.Write(",");
|
sw.Write(",");
|
||||||
sw.Write(",");
|
sw.Write(",");
|
||||||
@ -90,9 +90,7 @@ public class Program
|
|||||||
multipartContent.Add(new ByteArrayContent(File.ReadAllBytes(fatura)), @"""file""", @$"""{Path.GetFileName(fatura)}""");
|
multipartContent.Add(new ByteArrayContent(File.ReadAllBytes(fatura)), @"""file""", @$"""{Path.GetFileName(fatura)}""");
|
||||||
multipartContent.ElementAt(0).Headers.Add("Content-Type", "application/pdf");
|
multipartContent.ElementAt(0).Headers.Add("Content-Type", "application/pdf");
|
||||||
|
|
||||||
string newPath = fatura.Substring(0, fatura.Length - 4) + " Finalizado.pdf";
|
multipartContent.Add(new StringContent($"{{\"callbackUrl\":\"https://api.4docs.cloud/v2/null\",\"pipelineName\":\"energy\",\"multiple\":{agrupada.ToString().ToLower()},\"clientData\":{{\"fatura_PATH\":\"{fatura.Replace(",", string.Empty)}\"}}}}"), "json");
|
||||||
|
|
||||||
multipartContent.Add(new StringContent($"{{\"callbackUrl\":\"https://api.4docs.cloud/v2/null\",\"pipelineName\":\"energy\",\"multiple\":{agrupada.ToString().ToLower()},\"clientData\":{{\"fatura_PATH\":\"{newPath}\"}}}}"), "json");
|
|
||||||
|
|
||||||
request.Content = multipartContent;
|
request.Content = multipartContent;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user