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