From 5bf500fe2be8b0d86a5b4256099a541b65d3dc67 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Thu, 9 Nov 2023 11:12:35 +0100 Subject: [PATCH] =?UTF-8?q?Creditsafe=20API=20f=C3=BCr=20GB-Kunden=20Bugfi?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Creditsafe/cCreditSafeAPI.vb | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb index 55f9d559..9797d9a5 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb @@ -315,22 +315,6 @@ Public Class cCreditSafeAPI Dim success As Boolean = json.Load(jsonRespString) If (success <> True) Then Return "Verbindungsfehler" - 'Aubbau JSON Object - - ' "report" { - ' "companyIdentification" : { - ' "basicInformation" : { - ' "companyRegistrationDate" : "01.01.2022", - ' "creditScore" : { - ' "currentCreditRating" : { - ' "commonValue" : "A", - ' "providerValue" : { - ' "value" : "350", - '....} - ' "pdfReportStream": "base64" - '}, - - Dim reportObj As Chilkat.JsonObject = json.ObjectOf("report") If (json.LastMethodSuccess = True) Then @@ -345,28 +329,32 @@ Public Class cCreditSafeAPI Dim turnover As Chilkat.JsonObject = turnoverArray.ObjectAt(0) company.csTurnover = turnover.StringOf("range") & " (" & turnover.StringOf("year") & ")" Else - Debug.WriteLine("otherInformationObject object not found.") + Debug.WriteLine("additionalInformationObject object not found.") End If End If If (reportObj.LastMethodSuccess = True) And companyAddInformObj IsNot Nothing Then Dim companyMiscObj As Chilkat.JsonObject = companyAddInformObj.ObjectOf("misc") - company.csBusinessPurpose = companyMiscObj.StringOf("businessPurpose") - If (companyAddInformObj.LastMethodSuccess = True) Then - Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating") - If (companyAddInformObj.LastMethodSuccess = True) And deCurrentRatingObj IsNot Nothing Then - If (deCurrentRatingObj.LastMethodSuccess = True) Then - company.csIndex = deCurrentRatingObj.StringOf("value") - Else + If companyMiscObj IsNot Nothing AndAlso companyMiscObj.LastMethodSuccess = True Then + company.csBusinessPurpose = companyMiscObj.StringOf("businessPurpose") + If (companyAddInformObj.LastMethodSuccess = True) Then + Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating") + If (companyAddInformObj.LastMethodSuccess = True) And deCurrentRatingObj IsNot Nothing Then + If (deCurrentRatingObj.LastMethodSuccess = True) Then + company.csIndex = deCurrentRatingObj.StringOf("value") + Else + Debug.WriteLine("deCurrentRatingObj.value not found.") + End If Debug.WriteLine("deCurrentRatingObj object not found.") End If - Debug.WriteLine("companyMiscObj object not found.") + Debug.WriteLine("businessPurpose object not found.") End If - Debug.WriteLine("companyAddInformObj object not found.") + Debug.WriteLine("companyMiscObj object not found.") End If Debug.WriteLine("reportObj object not found.") End If + 'End If