# Address fields not populated in Klarna widget

**URL:** <https://forum.litium.com/t/address-fields-not-populated-in-klarna-widget/1027>\
**Category:** Questions\
**Created:** [August 14, 2019, 12:59pm UTC](https://forum.litium.com/t/address-fields-not-populated-in-klarna-widget/1027 "2019-08-14T12:59:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel.helmner](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@samuel.helmner](https://forum.litium.com/u/samuel.helmner)\
**Post date:** [August 14, 2019, 12:59pm UTC](https://forum.litium.com/t/address-fields-not-populated-in-klarna-widget/1027/1 "2019-08-14T12:59:59Z")

</div>

When Klarna widget is loaded the delivery address is populated with the Litium customers address but the address for the customer information (Dina uppgifter) is not. Only the email address, names and the phone number is populated.  
Looks like the delivery address is loaded from the Address property of Cart.OrderCarrier.Deliveries and the customer information (Dina uppgifter) address is loaded from the BillingAddress property of Cart.OrderCarrier.PaymentInfo.

Can’t find where the Cart.OrderCarrier.PaymentInfo BillingAddress is populated.  
Where would be the correct place to complement it with the customers address information? And how?

![image](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/ee9d944a0611e84428ef37b668976bf6e3087e00.png)

Note that this is all the time and not only for newly created customers like in this topic: [Klarna checkout v3 autofill address problem](https://forum.litium.com/t/klarna-checkout-v3-autofill-address-problem/787)

Litium version: 7.2.0  
Klarna version: 4.7.103

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [August 15, 2019, 2:36pm UTC](https://forum.litium.com/t/address-fields-not-populated-in-klarna-widget/1027/2 "2019-08-15T14:36:51Z")

</div>

Maybe you could try changing `ChangePaymentMethod` in `CheckoutServiceImpl` to something like this:

```auto
public override void ChangePaymentMethod(string paymentMethodId)
{
	var currentLanguage = _languageService.Get(_requestModelAccessor.RequestModel.ChannelModel.Channel.WebsiteLanguageSystemId.Value);
	var checkoutFlowInfo = _requestModelAccessor.RequestModel.Cart.CheckoutFlowInfo;
	checkoutFlowInfo.SetValue(CheckoutConstants.ClientLanguage, currentLanguage.CultureInfo.Name);
	checkoutFlowInfo.SetValue(CheckoutConstants.ClientTwoLetterISOLanguageName, currentLanguage.CultureInfo.TwoLetterISOLanguageName);

	var currentOrderCarrier = _requestModelAccessor.RequestModel.Cart.OrderCarrier;
	var paymentMethodParts = paymentMethodId.Split(':');
	var paymentMethod = _moduleECommerce.PaymentMethods.Get(paymentMethodParts[1], paymentMethodParts[0], SecurityToken.CurrentSecurityToken);

	// populate address carrier if user is logged in
	var billingAddress = new AddressCarrier();

	if (!SecurityToken.CurrentSecurityToken.IsAnonymousUser)
	{
		var person = _personService.Get(SecurityToken.CurrentSecurityToken.UserID);
		var addressType = _addressTypeService.Get(AddressTypeNameConstants.Address);
		var address = person.Addresses.FirstOrDefault(x => x.AddressTypeSystemId == addressType.SystemId);
		billingAddress = address.MapTo<AddressViewModel>().MapTo<AddressCarrier>();
	}

	_moduleECommerce.CheckoutFlow.AddPaymentInfo(currentOrderCarrier, paymentMethod.PaymentProviderName, paymentMethod.Name, billingAddress, SecurityToken.CurrentSecurityToken);
	_moduleECommerce.Orders.CalculateOrderTotals(currentOrderCarrier, SecurityToken.CurrentSecurityToken);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [September 12, 2019, 2:41pm UTC](https://forum.litium.com/t/address-fields-not-populated-in-klarna-widget/1027/3 "2019-09-12T14:41:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
