Checkout validation redirect not working
Klarna checkout validation redirect will not work if the URL isn't properly encoded.
If the user account is changed on the checkout page, Klarna will call Litium to try to verify the change. The validation callback is described here. When that happens, the ILitiumKcoApi.ValidateKcoOrder() method is called, which has a function that returns ValidationResult as its first parameter.
This function has the typical implementation shown below. The RedirectToUrlOnValidationFailure appears because Klarna's redirect will not work if the URL is not properly encoded. If you have a query string In this URL, use parameters that do not need URL encoding or apply proper URL encoding.
public ValidationResult ValidateCheckoutOrder(ILitiumKcoOrder order)
{
//Do your validation here:
//following result is used by Klarna AddOn to send the validation result back to Klarna.
// ReSharper disable once ConvertToLambdaExpression
return new ValidationResult
{
IsOrderValid = true,
RedirectToUrlOnValidationFailure = urlToRedirectToShowValidationFailure,
};
}