I got to this same issue today and the problem happens at vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
The bug here is that the extension attribute can not be converted to a string when comparing shipping address and billing address.
In my case, the extension attribute is only added to billing address and won't matter in the shipping vs billing address comparison.
This seems to be an unexpected case not covered by Adobe/Magento team.
I was not able to find any official patches fixing this, so I created this one that just removes the extension_attributes
key from $billingData
before it compares with shipping data.
diff --git a/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php b/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
index 7f0de541..c8444df2 100644
--- a/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
+++ b/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
@@ -117,7 +117,7 @@ class PaymentInformationManagementPlugin
$billingData = $this->convertAddressValueToFlatArray($billingAddressData);
$billingKeys = array_flip(array_keys($billingData));
$shippingData = array_intersect_key($quoteShippingAddressData, $billingKeys);
- $removeKeys = ['region_code', 'save_in_address_book'];
+ $removeKeys = ['region_code', 'save_in_address_book', 'extension_attributes'];
$billingData = array_diff_key($billingData, array_flip($removeKeys));
$difference = array_diff($billingData, $shippingData);
$sameAsBillingFlag = empty($difference);
EDIT:
Same bug happens to guest at vendor/magento/module-checkout-staging/Plugin/GuestPaymentInformationManagementPlugin.php
Same solution, single patch for both:
diff --git a/vendor/magento/module-checkout-staging/Plugin/GuestPaymentInformationManagementPlugin.php b/vendor/magento/module-checkout-staging/Plugin/GuestPaymentInformationManagementPlugin.php
index 2728b160..ee8afacd 100644
--- a/vendor/magento/module-checkout-staging/Plugin/GuestPaymentInformationManagementPlugin.php
+++ b/vendor/magento/module-checkout-staging/Plugin/GuestPaymentInformationManagementPlugin.php
@@ -101,7 +101,7 @@ class GuestPaymentInformationManagementPlugin
$billingData = $this->convertAddressValueToFlatArray($billingAddress->getData());
$billingKeys = array_flip(array_keys($billingData));
$shippingData = array_intersect_key($quoteShippingAddressData, $billingKeys);
- $removeKeys = ['region_code', 'save_in_address_book'];
+ $removeKeys = ['region_code', 'save_in_address_book', 'extension_attributes'];
$billingData = array_diff_key($billingData, array_flip($removeKeys));
$difference = array_diff($billingData,$shippingData);
return empty($difference);
diff --git a/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php b/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
index 7f0de541..c8444df2 100644
--- a/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
+++ b/vendor/magento/module-checkout-staging/Plugin/PaymentInformationManagementPlugin.php
@@ -117,7 +117,7 @@ class PaymentInformationManagementPlugin
$billingData = $this->convertAddressValueToFlatArray($billingAddressData);
$billingKeys = array_flip(array_keys($billingData));
$shippingData = array_intersect_key($quoteShippingAddressData, $billingKeys);
- $removeKeys = ['region_code', 'save_in_address_book'];
+ $removeKeys = ['region_code', 'save_in_address_book', 'extension_attributes'];
$billingData = array_diff_key($billingData, array_flip($removeKeys));
$difference = array_diff($billingData, $shippingData);
$sameAsBillingFlag = empty($difference);