Hi,
I want to save the order confirmation snippet from klarna on the order itself so it won’t stop working suddenly.
I have tried using both the documentation way and the way suggested in the thread: Klarna Order confirmation in Accelerator - #3 by Ericsj11
Issue with doc version is that refresh clears the cart and thus also clears the confirmation page. The latter by fetching the order each time from Klarna sometimes it fails with something went wrong / not supported page error or unauthorized
For this reason i want to store the snippet on AdditionalPaymentInfo, AdditionalOrderInfo, or anywere that will make it work through fetching it in Litium.
I have tried with in PaymentWidgetService.cs
public void PlaceOrder([NotNull] IPaymentWidgetOrder paymentWidgetOrder, bool isConfirmation)
...
... //Stock Litium code
...
var paymentInfo = order.PaymentInfo
.FirstOrDefault(x => x.PaymentProviderName == paymentWidgetOrder.PaymentProviderName);
if (paymentInfo != null)
{
....
.... // Stock Litium code
....
var klarnaHtmlSnippetInfo = paymentInfo.AdditionalPaymentInfo
.FirstOrDefault(x =>
x.AdditionalPaymentInfoKey ==
AdditionalPaymentInfoConstants.KlarnaHtmlSnippet);
if (klarnaHtmlSnippetInfo == null)
{
paymentInfo.AdditionalPaymentInfo
.Create(new AdditionalPaymentInfoCarrier(
AdditionalPaymentInfoConstants.KlarnaHtmlSnippet,
paymentInfo.ID,
paymentWidgetOrder.HtmlSnippet),
_securityToken);
}
}
Then in OrderController instead of using checkoutFlow using the PaymentInfo
Though the stored snippet looks like this:
Is it because it’s trying to fetch it too early?
Litium version: 7.6.1