6.8 Проверка корзины
17 декабря 2024 г.
14:30
#If Not SCRIPTDEBUGGER Then
References NLog.Dll
#End If
''' \<summary>
''' _CCC_ShoppingCartOrder_Check
''' \</summary>
''' \<param name="UID_ShoppingCartOrder">\</param>
''' \<param name="configJson">\</param>
''' \<returns>\</returns>
Public Function _CCC_ShoppingCartOrder_Check(ByVal UID_ShoppingCartOrder As String, ByVal configJson As String) As String
' Variablen
Dim counterror As Integer = 0
Dim countwarning As Integer = 0
Dim culLang As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("de-DE")
VI.Base.LanguageManager.SetSystemCulture(culLang)
Dim log As NLog.LogSession = New NLog.LogSession(NameOf(_CCC_ShoppingCartOrder_Check),"")
' Erste Variante mit Submit
Dim check = New QER.CompositionApi.ITShop.ShoppingCartSubmit(UID_ShoppingCartOrder)
Dim ConfigJsonParm As String = check.GetConfigJson
check.Check.Config.CheckMode = QER.CompositionApi.ITShop.CheckMode.CheckOnly
Dim tCartItemCheckResult As QER.CompositionApi.ITShop.CartItemCheckResult
log.Info("Shopping Cart: " & UID_ShoppingCartOrder & " will be checked...")
Dim checkResult = check.CheckAsync(Session).Result
log.Info("Check Config: ")
log.Info(ConfigJsonParm )
' Für alle Bestellpositionen
Dim items = checkResult.Items()
For Each tCartItemCheckResult In items
' Bestellpositionen Prüfungen durchführen
log.Info(" > Cart Item " & tCartItemCheckResult.ToString & " check result...")
Dim itemsChecks = tCartItemCheckResult.checks()
' Für alle gefundenen Prüfungsresultate
For Each checks In itemsChecks
' Resulatat ausgeben
log.Info(" > ID : " + checks.id + ", Status :" + checks.Status.toString + ", Title :" + checks.title)
Select Case checks.Status.toString
Case "Warning"
countwarning += 1
Case "Error"
counterror += 1
Case Else
End Select
Next
Next
Return " In " & CStr(items.count) & " Cart Items, there are " & CStr(countwarning) & " warnings and " & CStr(counterror) & " errors."
End Function
ShoppingCartOrder Check Customization - Forum - Identity Manager Community - One Identity Community