Litium 8 CartContext problems

Hi, if for some reason, a payment fails and the cart dose not get fully cleared. The cart, checkout and all its actions start to return 500 error. I think this is a problem with:

var cartContext = HttpContext.GetCartContext();
But am not sure how to handle it when this state happends.

Edit: (atleast sometimes) calling: await cartContext.CalculatePaymentsAsync(); with an empty cart causes the samer error

Mapping types:
PaymentFlowResult -> PaymentFlowResult
Litium.Connect.Payments.PaymentFlowResult -> Litium.Sales.Payments.PaymentFlowResult

Type Map configuration:
PaymentFlowResult -> PaymentFlowResult
Litium.Connect.Payments.PaymentFlowResult -> Litium.Sales.Payments.PaymentFlowResult

Destination Member:
PaymentFlowAction

 ---> System.InvalidOperationException: There is no result(CreateOrUpdateIframeCheckoutPaymentResult=null).
   at Litium.Connect.Application.Payments.AutoMapperProfiles.Converters.PaymentFlowActionConverter.Convert(PaymentFlowResult sourceMember, ResolutionContext context)
   at lambda_method11554(Closure , PaymentFlowResult , PaymentFlowResult , ResolutionContext )
   --- End of inner exception stack trace ---
   at lambda_method11554(Closure , PaymentFlowResult , PaymentFlowResult , ResolutionContext )
   at lambda_method11555(Closure , Object , Object , ResolutionContext )
   at Litium.Runtime.AutoMapper.AutoMapperExtensions.MapTo[TResult](Object source)
   at Litium.Connect.Application.Payments.PaymentServiceBase.InitializePaymentAsync(Guid paymentSystemId, CartContextSession cartContext, InitializePaymentArgs args)
   at Litium.Application.Sales.Checkout.CheckoutServiceImpl.BuildPaymentFlowResults(CartContextSession cartContext)
   at Litium.Application.Sales.Checkout.CheckoutServiceImpl.InitializePaymentsAsync(CartContextSession cartContext, InitializePaymentsArgs args)
   at Litium.Application.Sales.CartContextSessionServiceImpl.CalculatePaymentsAsync(CartContextSession cartContextSession)
   at Litium.Application.Sales.CartContextSessionServiceImpl.CalculatePaymentsAsync(Guid systemId)
   at Litium.Application.Sales.CartContextImpl.CalculatePaymentsAsync(CancellationToken cancellationToken)
   at Litium.Accelerator.Mvc.Controllers.Api.CartController.Update(AddToCartViewModel model) in D:\a\1\s\Src\Litium.Accelerator.Mvc\Controllers\Api\CartController.cs:line 109

Litium version: 8

1 Like

We’ve experienced this as well. After it occurs the cartcontext gets “corrupt” preventing users from going to the checkout.

Don’t have much to add in regards to recreating the issue.
We are using Svea Checkout. Litium version 8.2.3.

1 Like

@NilsN NÄgon ide om hur vi kan komma ut detta state nÀr det hÀnder?

This happens from Qliro checkout, as well.
It seems, this happens when ‘cart-context’ is expired/invalid/corrupted. May be, we need to reset ‘cart-context’ cookie when this happens, if no other way. Ofcourse cart items will be lost
Qliro app throws error as well, when this happens and can’t load checkout page.
Should we reset this cookie, in that case or what is the best solution?

@patric.forsgard any ides?

We have the same issue using Klarna and Litium 8.2.3.

We have it both production site and locally. Cant successfully reproduce it in production.
We can reproduce it locally to get the same log error by cutting off the communication between the app and the local site.

1 Like

There is a confirmed bug that possibly is related to this issue Login

It have been found 2 other bugs that will be included in up-coming release,

We cant say that this bugs will fix the issue that is experience, we are working on this to capture more logs to get better insight in the underlaying problem.

If you have an active case where we can see this, please send me a message and I can see if that logs have more or other information.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.