Wenn Daten von Creditsafe nicht ausreichend für einen Creditreport, wird im Aviso abgebrochen und darauf hingewiesen (um unnötige Abfragen abzufangen)! Weitere Hinweise bei NonActive/Pending/Other-Kunden.

This commit is contained in:
2023-05-03 14:53:10 +02:00
parent 1949d67f54
commit d17485be1a
5 changed files with 193 additions and 111 deletions

View File

@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Diagnostics.Eventing.Reader
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Web.UI.WebControls
@@ -270,6 +271,27 @@ Public Class cCreditSafeAPI
Dim reportObj As Chilkat.JsonObject = json.ObjectOf("report")
If (json.LastMethodSuccess = True) Then
If company.country = "DE" Then ' nur bei DE ausführen!
Dim companyAddInformObj As Chilkat.JsonObject = reportObj.ObjectOf("additionalInformation")
If (reportObj.LastMethodSuccess = True) Then
Dim companyMiscObj As Chilkat.JsonObject = companyAddInformObj.ObjectOf("misc")
If (companyAddInformObj.LastMethodSuccess = True) Then
Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating")
If (companyAddInformObj.LastMethodSuccess = True) Then
If (deCurrentRatingObj.LastMethodSuccess = True) Then
company.csIndex = deCurrentRatingObj.StringOf("value")
Else
Debug.WriteLine("deCurrentRatingObj object not found.")
End If
Debug.WriteLine("companyMiscObj object not found.")
End If
Debug.WriteLine("companyAddInformObj object not found.")
End If
Debug.WriteLine("reportObj object not found.")
End If
End If
Dim companyIDObj As Chilkat.JsonObject = reportObj.ObjectOf("companyIdentification")
If (reportObj.LastMethodSuccess = True) Then
@@ -310,7 +332,7 @@ Public Class cCreditSafeAPI
Dim providerValueObj As Chilkat.JsonObject = creditRatingObj.ObjectOf("providerValue")
If (creditRatingObj.LastMethodSuccess = True) Then
company.csIndex = providerValueObj.StringOf("value")
company.csScore = providerValueObj.StringOf("value")
Else
Debug.WriteLine("providerValue object not found.")
@@ -331,19 +353,6 @@ Public Class cCreditSafeAPI
company.csFailure = json.StringOf("details")
End If
'If withPDF Then
' Dim sb As New Chilkat.StringBuilder
' json.StringOfSb("pdfReportStream", sb)
' Dim bd As New Chilkat.BinData
' bd.AppendEncodedSb(sb, "base64")
' bytes = Convert.FromBase64String(sb.ToString)
' Return "mitPDF"
'End If
Return "ohnePDF"
End Function
@@ -354,10 +363,10 @@ Public Class cCreditSafeAPI
If company.country = "DE" Then
'Abfragen für DE benötigen einen Reason-Code
myUrl &= "?customData=de_reason_code::2"
myUrl &= "&?language=DE"
myUrl &= "&?language=DE&?template=full"
Else
myUrl &= "?language=DE"
myUrl &= "?language=DE&?template=full"
End If
Dim acceptContentType = "application/pdf"
@@ -393,19 +402,21 @@ Public Class cCreditSafeAPI
If company.creditsafeNo <> "" Then
rest.AddQueryParam("safeNo", company.creditsafeNo)
rest.AddQueryParam("safeNo", company.creditsafeNo)
Else
If company.vatNo <> "" Then
rest.AddQueryParam("vatNo", company.vatNo)
Else
If company.name <> "" Then
rest.AddQueryParam("name", company.name)
End If
End If
End If
If company.vatNo <> "" Then
rest.AddQueryParam("vatNo", company.vatNo)
Else
If company.name <> "" Then
rest.AddQueryParam("name", company.name)
End If
End If
End If
End Sub
@@ -462,6 +473,7 @@ Public Class cCreditSafeAPI
Public Property creditsafeNo As String
Public Property lastChecked As Date
Public Property csIndex As String
Public Property csScore As String
Public Property csRiskclass As String
Public Property csMaxCreditAmount As String
Public Property csDFoundingDate As Date