Stacktrace:
[ERROR] Litium.IWebLog - IWebLog exception ‘Objektreferensen har inte angetts till en instans av ett objekt.’: b2161dc3-5424-477a-a1da-d113911a3711 System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt.
vid Litium.Studio.AddOns.Klarna.Configuration.PluginSettings…ctor()
vid Litium.Studio.AddOns.Klarna.Configuration.PluginSettings.get_Instance()
vid Litium.Studio.AddOns.Klarna.StudioKlarnaCheckoutApi.CreateFrom(String paymentAccId, Action`2 updateDataSentToKlarnaAction)
vid Litium.Accelerator.Mvc.Controllers.Checkout.KlarnaPaymentController.CreateKlarnaCheckoutApi(String merchantId) i …\Src\Litium.Accelerator.Mvc\Controllers\Checkout\KlarnaPaymentController.cs:rad 168
vid Litium.Accelerator.Mvc.Controllers.Checkout.KlarnaPaymentController.Confirmation(String accountId, String transactionNumber) i …\Src\Litium.Accelerator.Mvc\Controllers\Checkout\KlarnaPaymentController.cs:rad 56
which the result is that no order will be placed.
What am I missing? What is causing this exception? I have double chacked the config file and everything seems good. Is there anything specific that I should look at?
One thing that they not mention to in the this link is this part of code in: AddCashOnDeliveryExternalPaymentMethod`
var cashOnDeliveryExternalPayment = new ExternalPaymentMethod
{
Name = "Cash on delivery",
RedirectUri = new Uri(urlHelper.Action("ChangePaymentMethod", "KlarnaPayment", routeValues, Uri.UriSchemeHttps)),
Fee = 0
};
klarnaCheckoutOrder.ExternalPaymentMethods = new List<ExternalPaymentMethod>
{
cashOnDeliveryExternalPayment
};
It doesn’t seem to get List<ExternalPaymentMethod> anymore so I tried to change it to List<PaymentProvider> I get error. How should this code sniippet looks like?
Now is everything changed according to the guide. But I still get the same error:
[ERROR] Litium.Studio.AddOns.Klarna.KlarnaProvider payment provider initialization failed. Please check whether config file contain correct information. - Objektreferensen har inte angetts till en instans av ett objekt. System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt. vid Litium.Studio.AddOns.Klarna.Configuration.PluginSettings..ctor() vid Litium.Studio.AddOns.Klarna.Configuration.PluginSettings.get_Instance() vid Litium.Studio.AddOns.Klarna.KlarnaProvider.GetPaymentMethodsSupported() vid Litium.Foundation.Modules.ECommerce.Plugins.Payments.PaymentProviderFactory..ctor() [ERROR] Litium.IWebLog - IWebLog exception 'Objektreferensen har inte angetts till en instans av ett objekt.': c1eb917d-7d9a-4a4b-ae69-8754e766c083 System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt. vid Litium.Studio.AddOns.Klarna.Configuration.PluginSettings..ctor() vid Litium.Studio.AddOns.Klarna.Configuration.PluginSettings.get_Instance() vid Litium.Studio.AddOns.Klarna.StudioKlarnaCheckoutApi.CreateFrom(String paymentAccId, Action2 updateDataSentToKlarnaAction)
vid Litium.Accelerator.Mvc.Controllers.Checkout.KlarnaPaymentController.CreateKlarnaCheckoutApi(String merchantId) i …\Src\Litium.Accelerator.Mvc\Controllers\Checkout\KlarnaPaymentController.cs:rad 168
vid Litium.Accelerator.Mvc.Controllers.Checkout.KlarnaPaymentController.Confirmation(String accountId, String transactionNumber) i …\Src\Litium.Accelerator.Mvc\Controllers\Checkout\KlarnaPaymentController.cs:rad 56`