krokedil / klarna-checkout-for-woocommerce

Klarna Checkout for WooCommerce plugin
15 stars 23 forks source link

Billing city does not match Klarna order. #605

Open aramayisd opened 1 month ago

aramayisd commented 1 month ago

Description of the issue

Hello @mntzrr — I am the developer of AraratButik.com (which has the same issue). When we updated the plugin version from 2.12.5 till 2.12.9 in mobilfastfix.se — the checkout page stops working and we receiving the following error.

Billing address 1 does not match Klarna order. 
Billing city does not match Klarna order.

It looks like something break between that releases, no all users has this issue, but a couple websites already have this bug. I commented the following line in plugin source code, and it help. (so now 2.12.9 works)

File: classes/class-kco-gateway.php

// add_action( 'woocommerce_after_checkout_validation', array( $this, 'validate_checkout' ), 10, 2 );

It looks like it's a recently change. Could you please check?

We tried to set "Defaults to the customer's billing address" and "Force delivery to the customer's billing address" but it doesn't help.


Expected behavior

After click on Betala köp the checkout pop up should open and then Bekräfta och betala.


Actual behavior

When we click on Betala köp it opens a window and say the following

Billing address 1 does not match Klarna order. 
Billing city does not match Klarna order.

Steps to reproduce the behavior

  1. Add an item in basket
  2. Go to checkout page
  3. Fill all fields and click Betala köp

Klarna plugin version

2.12.19


WordPress version

6.5.2


WooCommerce version

8.5.2

Screenshots

image image image

mntzrr commented 1 month ago

Hello @aramayisd !

Thanks for reporting this issue.

We introduced in 2.12.6 additional controls where we compare and check that the billing fields in both Klarna and Woo matches. However, as you've reported, we did notice that some merchant has opted to remove these standard Woo fields. I've confirmed that this is also the case for your store (please see attachment). As you can see, the "billing_city" and "billing_address_1" fields are missing.

While disabling the validate_checkout callback will solve the issue for you, I highly discourage doing so since we introduced it to prevent fraud. I suggest that you enable these standard Woo fields again, while we're working on a general solution to adjust for missing standard fields.

aramayisd commented 1 month ago

Hey @mntzrr, thank you for your reply.

However, as you've reported, we did notice that some merchant has opted to remove these standard Woo fields. I've confirmed that this is also the case for your store (please see attachment). As you can see, the "billing_city" and "billing_address_1" fields are missing.

Do you know how we can enable this fields billing_city and billing_address_1 — until general solution to adjust for missing standard fields will be ready.

Thank you.

mntzrr commented 1 month ago

The fields must be unset manually. This is not something you can do in WooCommerce without either using a third-party plugin or the woocommerce_checkout_fields filter hook. That is, someone must have disabled them.

From my experience, I've found people disabling them from their theme's functions.php file. The most common plugin for unsetting these fields is "Checkout Field Editor" by ThemeHigh. I suggest checking for these. If that still fails, try disabling all the plugins, and enable them by one. Examine the checkout every time to see if the fields have been restored. Finally, try switching theme. If the fields are restored, then most likely it is disabled through the theme's functions.php.

aramayisd commented 1 month ago

I understand, ok thank you.

mntzrr commented 1 month ago

No problem! I'll keep this issue open for a while, while we decide on how we should proceed from here. I'll post an update once we've reached a conclusion or refer to a fix.

wezzou1 commented 2 weeks ago

I have the same problem in Klarna Checkout, the customers having trouble to checkout, it worked before update.

"Shipping method have been changed during the checkout process"