We are having an issue in one of our projects when the customers are placing an order in the checkout and they have several windows open in different channels, then they get a validation error message: “Validation error, Cart: ‘The selected payment method is no longer supported, please review your order’”.
I checked in our logs and the error happens in the method: Litium.Accelerator.Mvc.Controllers.Api.CheckoutController.PlaceOrder(CheckoutViewModel model).
And it looks like it is caused by the fact that “OrderPaymentLinks”:[ ] is empty.
We had the same issue in Litium version 8.5.1, so we have been in contact with Litium before about it. We got the information that the issue should be solved in Litium version 8.7.0 in this bug https://docs.litium.com/support/bugs/bug_details?id=62246. But the issue is still there after the update to Litium version 8.7.2.
Hi,
“the customers are placing an order in the checkout and they have several windows open in different channels”. This one is a new information about this issue.
There are not different carts for each channel. Information in the cart is updated when you visit the channel. So if you are at the checkout page and you visit another channel before you place the order it is not strange that you get the error since the cart is updated with the payment methods of the newly visited channel.
But the customer has only one payment method on all channels. Should the payment method information be the same?
And why is “OrderPaymentLinks”:[ ] empty?
We have a method that checks that the right channel and countries are set in the cart context when we place the order
var routeRequestLookupInto = _routeRequestLookupInfoAccessor.RouteRequestLookupInfo;
var channel = routeRequestLookupInto.Channel;
if (cartContext.ChannelSystemId != channel.SystemId)
{
await cartContext.SelectChannelAsync(new SelectChannelArgs
{
ChannelSystemId = channel.SystemId
});
//if cart has no country then using the first country link of request lookup channel
if (string.IsNullOrEmpty(cartContext.CountryCode))
{
var countryId = channel.CountryLinks.FirstOrDefault()?.CountrySystemId;
if (countryId.HasValue)
{
var countryCode = _countryService.Get(countryId.Value)?.Id;
if (countryCode is object)
{
await cartContext.SelectCountryAsync(new SelectCountryArgs
{
CountryCode = countryCode
});
}
}
}
cartContext = HttpContext.GetCartContext();
And as I said before, all channels use the same payment method.
Should the payment method information be the same in that case?
Why is “OrderPaymentLinks”:[ ] empty?
Do we net to reset the payment method again when "OrderPaymentLinks”=[ ] ?
If using klarna you essentially need a new session if you want to switch country. there should be code in the accelerator to essentially clear the cart and then add the items you had before into a new cart.
It looks like changing country and customertype (person/Organization) is not allowed if done from litium.
But if this i related to your issue I not sure. Working with different channels on same domain in litium is lots of work.
The customer is only using Direct Pay as a payment, so no Klarna there.
I do not think that is the issue. The cart is missing the OrderPaymentLinks (read only).
I am also having similar issues at the moment… same message… don’t understand why… its only direct payment inline…
All my problems seem to be related to multiple channels on same domain. Our checkout is quite… customized. I’ve added code that resets the channel and resets the payments on checkout page load, and it seems to solve my issues. There is always only one payment method available so resetting to the only one available seems to solve it.
We only have one channel, but multiple domains for that channel, that redirects to the main domain. Sometimes OrderPaymentLinks aren’t empty or null, and we still get this message. It always works after refreshing the page.