Our client requested that we would implement the "Klarna Payment Module for EPiServer Commerce" (http://world.episerver.com/Articles/Items/Klarna-Payment-Module-for-EPiServer-Commerce/) in their Commerce solution. But in this module the customers had to enter their own address and it had to match the exact address that is registered at Klarna. We quickly realized that this solution was not very user friendly since several customers had problems with typing in an address that exactly matched the registered address. Especially companies who had several addresses registered at Klarna were having problems, the customer support had to assist several customers.
We decided to look for a solution and found the “get_addresses” method in the Klarna API. The “get_addresses” function is used to fetch the customers address. The address is then presented to the customer on the checkout page and is submitted as the delivery address. It should be noted that Klarna only allows this function to be used for Swedish persons/companies.
We choose to create a new class that would use the “get_addresses” method to get the customers address and submit it to the Klarna module instead of modifying the module. This was done partly because the Klarna module implemented an older version of the Klarna API and partly to minimize the risk of introducing errors in the working module.
The address is then used as the customers purchase address when the purchase is processed through the Klarna Payment Module. There is a great example of how to implement the “get_addresses” method among the Klarna api examples: https://integration.klarna.com/en/api/download-api
Note that when this method is implemented the parameter for the Klarna payment method "Allow different address:" has to be marked as true to disable the validation of the address. If this flag is marked as true, the EPiServer Commerce system will not verify the customer entered address. It will depend totally on Klarna to verity the address.
Also note that Klarna has a set of rules for the use of this service, which can be found at this address https://integration.klarna.com/en/api/advanced-integration/functions/getaddresses.
The get_addresses function is ONLY allowed to be used for Swedish persons with the following conditions:
Hope that this can help someone who is having similar issues.