Magento: Send åäö (and other international characters) to DIBS

If your store uses DIBS to manage payments, then the risk is that you have to worry about characters like åäö.

What we had to do is to make the form post the data as ISO-8859-1.
We did this by adding accept-charset=”iso-8859-1″ to the forms that we send to DIBS.

In “/app/design/frontend/default/blank/template/dibs/standard/redirect_paymentwindow.phtml”

56
<form action="https://payment.architrade.com/paymentweb/start.action" method="post" name="dibs" id="dibs" accept-charset="iso-8859-1">

Once we had done this then the order details were shown correctly on the DIBS page (yes, the Chinese chars are just a test, I have no idea what it might say)
Details on DIBS including åäö

Magento admin, make it possible to enter DIBS login information on a per store basis

If you are using the DIBS module from MagentoConnect it is possible to set up DIBS accounts as default configuration (all sites & stores) and website (and all stores under that).

If you would like to be able to set up one DIBS account per store, then you should edit the app/code/local/Mage/Dibs/etc/system.xml
Find the lines that look like

                        <active translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>

and alter them to

                        <active translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>

This should be done in several locations (this is controlled for each option in the plugin so make sure you edit it for all the options you wish to alter on a store level).

Magento: Problem with DIBS module

Using the DIBS module (from Magento connect); we had the “slight” problem that if the order was payed using the test visa card (from DIBS 10 steps) viewing the order was not possible.
The page only partially rendered but most of it was not shown.

We “fixed” this by adding two things to app/code/local/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php

We figured out the problem lied in the “switch($paytype)” statement in the “function printLogo($paytype)”

We started by editing the “default:” statement to read

$res = 'no image for ' . $paytype;

instead of the old statement of

$res = '<img src="' . $paytype;

was what broke the page rendering as that img tag was not ended.

We also added an extra case for the card that didn’t exist in the old switch:

case 'VISA,V-DK':  {
                $res = '<img alt="" />getSkinUrl('images/dibs/visa.gif') . '" border="0" />';  break;
            }