Developer forum

Forum » Development » Dibs payment window language

Dibs payment window language

Dmitrij Jazel
Reply

Hej Guys,

 

I wanted to know if anyone knows how to change dibs payment window language?

At the moment it is English, and in DW payment method there is no way to change the language.

Any suggestions on this one?


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Dmitrij

The Dibs Payment window provider supports these languages: "da_DK", "sv_SE", "no_NO", "en_UK", "en_GB", "fi_FI". The language is matched with the regional settings on the website properties. If there is no match, english will be used.

You can overrule this behavior by setting "Post mode" to render template, and in the "Post template" choose the payment window template. In there you have this field:

<input type="hidden" name="language" value="<!--@Dibs.language-->" />

And you can overrule the language in there.

Nicolai

 
Dmitrij Jazel
Reply

Hej Nicolai,

 

Allright, well this is what I did:

1) Select a template for "Post template" in the mayment method settings.

Where I added norwegian as language.

http://screencast.com/t/IAxWJJgKbL

(And it did the trick, but just wait...)

 

2) I setup Post mode: Render template

 

As a result I got this:

http://screencast.com/t/1AIIkAJ1Flx

 

As I understood that is the template that I have to post!?

Wasn't it supposed to autopost just like the other one? I know that there are only 2 options (autopost one and render template) but if previous template could autopost, why this one can't? That was one weared discovery for me. Now I have post button that I am supposed to press manually, or make some kind of "js autopost hack" that is not really a good way to solve it IMHO.

 

As soon as I change it to autopost(do not render post template) it immediately avoids it, and with that avoids language change that I just applied.

 

 
Dmitrij Jazel
Reply

Talking about webpage locale:

In website settings, all is setup towards the language shop supposed to use.

Shop language is setup, cart is linked to a correct shop... but why would it miss the language locale during autopost in the first place?

 
Nicolai Høeg Pedersen
Reply

Hi Dmitrij

Check what the autopost template writes in the language field... Using browsers dev toolbar, fiddler or something.

Nicolai

 
Dmitrij Jazel
Reply

Hi Nicolai,

Wouldn't it be easyer to just to tell me where is that original autopost template that DW uses by default is located?

I did the lookup as you suggested, and from what I could see, it didn't send any language value.

Any place I can edit the original autopost template?

 
Nicolai Høeg Pedersen
Reply

Hi Dmitrij

It is not a template as such. The DibsPaymentWindow addin derives from CheckoutHandlerWithStatusPage base class which has a SubmitForm method that takes a form action along with a dictionary of key/values for the post. This key value collection is then rendered and posted by /Admin/Public/Gateways/CheckoutHandler/FormSubmit.aspx without using a template.

In the template you set in your example, it showed a button. You can just make that form autopost. We do it like this:

	if (document.getElementById('DoSubmit').value != 'false') {
            var form = document.getElementById('CheckoutForm');
            var vs = document.getElementById("__VIEWSTATE");
            if (vs)
                vs.parentNode.removeChild(vs);

            form.submit();
        }

Otherwise we need a URL to debug it for you.

BR Nicolai

 
Dmitrij Jazel
Reply

Allright, I will try to see what I can do...

Thanks for so far Nicolai :-)

 

/Dmitrij

 
Dmitrij Jazel
Reply

Hi Nicolai,

Recently found this in DW source code:

http://screencast.com/t/3XSYQ6KC

http://screencast.com/t/0ptUx88NA2i

Could that explain why Norwegian website is unable to load Norsk DIBS "as default DIBS language"?

 

/Dmitrij

 
Merethe Vrå Andersen
Reply

Hi, 

There was a bug with Norwegian language due to the 2 language codes for bokmål (nb-NO) and nynorsk (nn-NO). Bug 19844.

The language code for bokmål (nb-NO) is fixed with 8.7.1.4 and the language code for nynorsk (nn-NO) is fixed in upcoming 8.8.

Dynamicweb finds the the language code from the  Regional settings of the website and posts the corresponding language code to DIBS (Flexwin / DIBS Payment Window) which renders the payment window in the language - if supported. If not supported, it falls back to english (Nicolai has listed the supported languages).

Kind regards,
Merethe

 

 

You must be logged in to post in the forum