I would like to enable vipps payments in store, but payee reference hit string size limit, which is 30.
Store have 12 character long external order number, and SwedbankPayPayeeReferenceCreator is adding timestamp T637431057563670182 which results in 31 characters long reference.
How I can adjust how works SwedbankPayPayeeReferenceCreator? I don’t see any attribute that suggest I can inject/decorate this service.
You can try with this, create a new class in the Accelerator:
using Litium.AddOns.SwedbankPay;
using Litium.Foundation.Modules.ECommerce.Payments;
using Litium.Runtime.DependencyInjection;
using System;
namespace Litium.Accelerator.Mvc.App_Start
{
[Service(ServiceType = typeof(ISwedbankPayPayeeReferenceCreator))]
public class CustomSwedbankPayPayeeReferenceCreator : ISwedbankPayPayeeReferenceCreator
{
public string CreatePayeeReference(PaymentInfo paymentInfo)
{
return $"T{DateTime.Now:yyMMddHHmmss}";
}
}
}
And then Payee reference will be applied with the new logic:
I am not sure if you wrote correctly but it inherits from ISwedbankPayPayeeReferenceCreator
so moving the file in any project that has Litium Dependency Injection context should work.