Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Gonçalo Assunção 39 posts 68 karma points
    Mar 23, 2015 @ 19:02
    Gonçalo Assunção
    1

    Language problem on Dibs

    Hello guys!

    I'm having a problem when I'm redirected  to the dibs website.

    Our site is in Danish, is defined in the umbraco hostname and culture section, but when I'm redirected to the Dibs website, the language of that site is English.
    On the other hand, If I choose the paypal payment mehtod, the language of the site is Danish.

    We have set the default language as Danish ("da-DK" ), in the .config for  Ucommerce.

    I tried to force a language parameter in DIBS.config file but that broke the integration. I have nothing else to go on right now and cannot explain why it worked when it was in the TEST DIBS version. At that point I assumed the problem was with DIBS itself, but I cannot check what is being posted because it is encrypted.

     

    What else can I do?

  • Keirran 14 posts 33 karma points
    Mar 24, 2015 @ 10:56
    Keirran
    0

    Hello, 

    Do you want to have a conf call just to discuss this more in detail, as the company i work offer these services ?

  • Thomas 30 posts 163 karma points
    Mar 24, 2015 @ 14:53
    Thomas
    1

    Hey Gonçalo

    Can you please tell me the full host name as used in Umbraco?

    Unfortunately you can't modify the dibs parameters by editing the dibs.config file.

    A way to force the lang parameter is to make a new DibsPageBuilder that inherits the existing DibsPageBuilder and overwrite the AddHiddenField method and force the lang parameter in there, when name equals lang.

    A guide on how to register a custom component in uCommerce

    Kind regards

    Thomas Arvidsen

  • Gonçalo Assunção 39 posts 68 karma points
    Mar 24, 2015 @ 18:28
    Gonçalo Assunção
    0

    Well our full domain is :

    www.Fonde.dk

    I am trying to override the AddHiddenField method:

    I am using the following code:

    public class customLanguage : DibsPageBuilder
        {


            public customLanguage(CommerceConfigurationProvider configProvider, IDomainService domainService, DibsMd5Computer dibsMd5Computer, IAbsoluteUrlService absoluteUrlService)
                : base(configProvider, domainService, dibsMd5Computer, absoluteUrlService)
            {
            }

            protected override void AddHiddenField(StringBuilder page, string name, string value)
            {
                base.AddHiddenField(page, "lang", "da");
            }

        }

     

     

    In the test solution, the values that were posted to Dibs were:

    submitBasket yes
    decorator default
    merchant merchantId
    accepturl acceptUrl
    cancelurl  
    orderGuid OrderGuid
    currency DKK
    lang pt
    callbackurl callbackurl
    test 1
    orderid Reference-214
    amount 125
    uniqueoid yes
    md5key Key

     

    In this case, our test solution domain ends with a ".pt".. I'm writting from Portugal. I've also tried to change the browser language, but it didn't work...

  • Martin 181 posts 740 karma points
    Mar 24, 2015 @ 18:50
    Martin
    0

    Hi Goncalo,

    A curious question, did you remember to register your custom dibs page builder? You have to use the same name as uCommerce's default DIBS page builder otherwise uCommerce will continue using the default implementation.

    Best regards Martin

    Edit: I just looked up what name your custom page builder should have. If you in custom.config register your page builder with id = DibsPageBuilder you should get the correct values for the form.

  • Gonçalo Assunção 39 posts 68 karma points
    Mar 24, 2015 @ 18:54
    Gonçalo Assunção
    0

    I'v added the dll to the bin folder, and added the following to the Custom.config:

      <component id="DibsPageBuilder"
               service="UCommerce.Transactions.Payments.Dibs.DibsPageBuilder, UCommerce.Transactions.Payments"
                 type= "dibsCustomLanguage.customLanguage, dibsCustomLanguage">
            </component>

     

    But now it posts "lang da" in all of the fields.

  • Martin 181 posts 740 karma points
    Mar 24, 2015 @ 18:56
    Martin
    0

    ahh. It's because you have overridden the wrong method. 2 sec and I get you the right one :)

  • Martin 181 posts 740 karma points
    Mar 24, 2015 @ 19:01
    Martin
    0

    Okay here are some Example code for inspiration:

    public class Test : DibsPageBuilder
    {
        public Test(IDomainService domainService, DibsMd5Computer dibsMd5Computer, IAbsoluteUrlService absoluteUrlService, ICallbackUrl callbackUrl) 
            : base(domainService, dibsMd5Computer, absoluteUrlService, callbackUrl)
        {
        }
    
        protected override IDictionary<string, string> GetParameters(PaymentRequest paymentRequest)
        {
            var test = base.GetParameters(paymentRequest);
    
            test["lang"] = "da";
    
            return test;
        }
    }
    

    I recommend that you override the GetParameters instead. That way you accidentally don't removes/forgets some of the standard fields required for DIBS.

    EDIT:

    There was supposed to be a "don't" in that sentence >.<

    EDIT 2: Remove useless line for this example.

    Edit 3: This applies / tested with version 6.6.2

  • Gonçalo Assunção 39 posts 68 karma points
    Mar 24, 2015 @ 19:06
    Gonçalo Assunção
    0

    Thank you Martin.

    I'm having some struggle with the "ICallbackUrl", and also the "GetParameters" method.

     

    and also with the:
    test.Add(new KeyValuePair<string, string>("lang", paymentRequest.PaymentMethod.DynamicProperty().PreAuth));
    "DynamicProperty()"

    It can't find the assemble.

     

    edit:

    The references that I have:
    using UCommerce.Content;
    using UCommerce.Infrastructure.Configuration;
    using UCommerce.Transactions.Payments;
    using UCommerce.Transactions.Payments.Dibs;
    using UCommerce.Web;

  • Martin 181 posts 740 karma points
    Mar 24, 2015 @ 19:08
    Martin
    0

    Which version of uCommerce do you use?

    Edit: I have removed a line from my example which was not needed (copy paste mistake).

  • Gonçalo Assunção 39 posts 68 karma points
    Mar 24, 2015 @ 19:26
    Gonçalo Assunção
    0

    I believe I have the Version 3.3.1.4000

  • Thomas 30 posts 163 karma points
    Mar 25, 2015 @ 15:04
    Thomas
    1

    Hey Gonçalo

    If you're using version 6.6.0 or newer then Martin's solution is the right way to do it.

    However since you're using an older version, the DibsPageBuilder you have doesn't have a GetParameters method and you will there for have to override the AddHiddenField method as you did in a previous post. The way you did it is wrong as you would replace all the fields with the language field, the solution should be something like this:

    public class Test : DibsPageBuilder
    {
        public Test(CommerceConfigurationProvider configProvider, IDomainService domainService, 
            DibsMd5Computer dibsMd5Computer, IAbsoluteUrlService absoluteUrlService) 
            : base(configProvider, domainService, dibsMd5Computer, absoluteUrlService)
        {
        }
    
        protected override void AddHiddenField(StringBuilder page, string name, string value)
        {
            if (name == "lang") { 
                base.AddHiddenField(page, name, "da");
                return;
            }
    
            base.AddHiddenField(page, name, value);
        }
    }
    

    And then register the component the way Martin said in a previous post.

    Kind regards

    Thomas Arvidsen

  • Gonçalo Assunção 39 posts 68 karma points
    Mar 25, 2015 @ 15:30
    Gonçalo Assunção
    0


    I was trying to do exactly that Thomas, but I wasn't including that last line:

    base.AddHiddenField(page, name, value);

    So I was only posting ""lang = da".

    Now it's in Danish, finally!


    Thank you Thomas and Martin for all the help and patience!

    Cheers from Portugal

     

  • Thomas 30 posts 163 karma points
    Mar 25, 2015 @ 15:46
    Thomas
    0

    No problem

    Would you be so kind and mark the post as solved?

    Kind regards

    Thomas Arvidsen.

Please Sign in or register to post replies

Write your reply to:

Draft