Installation of the Klarna osCommerce module

1. Download

Get osCommerce from Downloads and select "modules".

2. Move files

FMove files with FTP software where your osCommerce shop is situated. The Zip file is constructed so that the "includes" and "images" folders can be moved to the corresponding folders on the server and you can press replace all files to install the files in the correct destination. This procedure will not affect any others files except Klarna's files*. NB! If you have made any changes in the file structure of the osCommerce shop, it is not certain that the Move operation will have put all the files in their correct destinations according to the standard structure.

*If you already have any files from Klarna, they will be written over. Options will be saved, however, as they are located in the database.

3. Options

ou will find Klarna's payment modules in the admin section under Modules ? Payment. Note that each country has its own payment module.

4. Invoice

Invoice module contains the following options:
  • ”Merchant ID” is the Estore ID you received from Klarna and "Shared secret" is the shared secret furnished by Klarna.

  • "Product artno attribute" specifies what will appear in the article number column on the invoice. "Id" means a number will be visible and "Model" that the product model will be shown.

  • ”Enable Auto Activate” is a service that means Klarna will activate the invoice as soon as the purchase is made and will also post the invoice to the Customer. This service must be agreed with Klarna before it can be activated.

  • "Activate delay" is the number of days to wait before activating the invoice if Auto Activate has been approved.

  • ”Pre-populate personnumer field” specifies whether the module should attempt to retrieve a personal identity number from the database. If you haven't extended your shop with a personal identity number, it would be better not to enter a value here.

  • ”Credit limit” avgör för vilka ordrar Klarnas betaltjänst ska visas som ett alternativ. Om ordern inte överstiger den konfigurerade kreditgränsen visas Klarna som ett betalalternativ. Observera att det kan vara lite skevt eftersom jämförelsen görs baserad på värde av artiklarna i varukorgen utan att ta hänsyn till frakt och eventuell faktureringsavgift. Värdet anges i ören.

    ”Credit limit” determines for which orders Klarna's payment service is to be shown as an alternative. Unless the order exceeds the configured credit limit, Klarna will be shown as a payment alternative. Note that this function may be slightly misleading as the comparison is based on the value of the goods in the shopping cart without taking into account carriage and any invoicing fees. Specify the value in ören or cents (1/100)
    The credit limit is to be agreed with Klarna and Klarna will not accept any purchases that exceed this amount irrespective of what is configured as the shop credit limit. This option is used only to avoid the customer receiving an error message from Klarna if the purchase exceeds the credit limit.
  • ”Ignore table” is a list of modules in ”Order Total” that do not generate any new costs or discounts. These will not be shown on the invoice. Posts from ot_tax, ot_total and ot_subtotal are ignored by default since they are posts that do not carry any new costs/discounts.

  • ”Payment Zone” can be configured to limit the zone in which the service is available. Note that Klarna accepts only Swedish customers so even though the service is available to customers not registered in Sweden, purchases made be these customers will not be approved.

  • ”Tax Class” is the tax class used for these additional fees. It is not used to calculate the amount of tax to be added but rather how large a proportion of the fee that is tax.

    It would also be possible to have a list here showing the posts that do not include tax. Let us know if you have any such additional posts.

  • ”Sort order of Display” determines in which order the modules are to be displayed, 0 = first.

  • Note that Klarna accepts payment only in the currency of where the customer is from. The module verifies that the currency matches the country, so if your system does not set this correct, you may need to change the setting in modules/payment/kreditor.php. Note that the $currency check is made in two places in the code.

5. Part Payment - Klarna

The module for paying in parts is Part Payment - Klarna. The options are exactly the same as for invoicing. The only difference is that you must "Click here to update your pclasses" after you have saved your "Merchant ID" and "Shared secret". Your pclasses will be retrieved automatically from Klarna after clicking there.

6. How do you show monthly costs of products?

In order to show the monthly cost of products and in the shopping cart, you must make the following changes to your osCommerce shop.

1. Open \catalog\product_info.php and, as long as you are using the standard osCommerce theme, you will see the following code on lines 89-96.

      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
          </tr>
        </table></td>
      </tr>

Copy and paste the following code directly underneath:

<?php include DIR_WS_INCLUDES . 'display_klarna_price.php';?>

Save the file once this is done.

2. If you also want to show the information in the shopping cart, you must open the file \catalog\includes\boxes\shopping_cart.php and around lines 59-61 you'll see the following code.

  if ($cart->count_contents() > 0) {
    $info_box_contents[] = array('text' => tep_draw_separator());
    $info_box_contents[] = array('align' => 'right',
                                 'text' => $currencies->format($cart->show_total()));

Copy and paste the following code directly underneath:

include DIR_WS_INCLUDES . 'display_klarna_cart.php';

7. Testning

You can perform a test purchase by using our test persons. Make some purchases using an approved and a non-approved test person to see how the module works. You will then be able to see that Klarna has received the invoices by logging on to Klarna online and then search for the invoices. Remember that you must set "Show test invoices" to Yes.

Now you're ready to start using Klarna's services.

Don't forget to exit test mode in Klarna Online when you're finished!