fix(medusa-payment-klarna): get correct country

This commit is contained in:
Sebastian Rindom
2020-08-31 11:08:09 +02:00
parent 08332efc12
commit daa425de16

View File

@@ -136,7 +136,8 @@ class KlarnaProviderService extends PaymentService {
// TODO: Check if country matches ISO
if (!_.isEmpty(cart.billing_address) && cart.billing_address.country) {
order.purchase_country = cart.billing_address.country
order.purchase_country =
cart.shipping_address.country_code || cart.billing_address.country_code
} else {
// Defaults to Sweden
order.purchase_country = "SE"