Änderungen Rechnungsnummernveragbe, Fiskalkunden, Creditsafe-API Fehlerausgabe verbessert, Gesamtsicherheitem (Feature für Refrerenzbetragänderungen)

This commit is contained in:
2023-07-05 13:48:53 +02:00
parent 08c6039246
commit 3926ec909f
7 changed files with 86 additions and 20 deletions

View File

@@ -124,7 +124,7 @@ Public Class cCreditSafeAPI
Return failureDesc
Else
If (rest.ResponseStatusCode <> 200) Then
For i = 0 To 4 'Versuche das PDF 5x abzufragen (funktioniert ab und zu nicht).
For i = 0 To 15 'Versuche das PDF 16x abzufragen (funktioniert ab und zu nicht).
responseJson = rest.FullRequestNoBodyBd(method, url, pdfData)
If rest.ResponseStatusCode = 200 Then Exit For
Thread.Sleep(500)
@@ -293,9 +293,12 @@ Public Class cCreditSafeAPI
'Abfragen für DE benötigen einen Reason-Code
myUrl &= "?customData=de_reason_code::3"
myUrl &= "&?language=DE"
Else
ElseIf company.country = "AT" Then
myUrl &= "?language=DE"
Else
myUrl &= "?language=EN"
End If
Dim acceptContentType = "application/json"
@@ -465,7 +468,16 @@ Public Class cCreditSafeAPI
Dim failureDesc As String = ""
Dim jsonRespString = SendGetRequestWithAuthHeader(myUrl, Nothing, acceptContentType, "GET", token, failureDesc)
If failureDesc <> "" Then Return Nothing
If failureDesc <> "" Then
Dim jsonFailure As New Chilkat.JsonObject
Dim success As Boolean = jsonFailure.Load(jsonRespString)
If (success <> True) Then
failure = jsonFailure.LastErrorText
Return Nothing
End If
failure = jsonFailure.StringOf("details")
Return Nothing
End If
If jsonRespString IsNot Nothing Then
Dim success = pdfData2.AppendEncoded(jsonRespString, "base64")