Payee reference too long


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:


Ok, I had to add this in Accelerator.Mvc, it works now, thanks. I tested that before but from other project.

But I wonder how does it work? I don’t see any attribute on SwedbankPayPayeeReferenceCreator, ISwedbankPayPayeeReferenceCreator.

What is the reason it must be in specific project? How I can make it to works from other projects (I would like to keep custom stuff separated)?

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.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.