integer-net/magento2-shippingpreselection

Handling of native PayPal Express checkout (button)

Opened this issue · 0 comments

We're talking about the PayPal Express process, which can be launched from the product detail page or the mini shopping cart. (/paypal/express/start/button/1/)

Problem 1: In the current state, the mocked shipping address is transferred to PayPal. (@see vendor/magento/module-paypal/Model/Express/Checkout.php:551)

Solution to problem 1: Extend your configuration (integernet/shipping_preselection/mock_unset_urls) with the entry "paypal_express_start" to trigger an "isAddressResetRequest" for this FullActionName. This will then delete the mocked shipping address.

Problem 2: Now when we start the PayPalExpress checkout, the current quote is saved again. @see vendor/magento/module-paypal/Model/Express/Checkout.php:503

This finally fails at the following location:

vendor/magento/module-quote/Model/ShippingMethodManagement.php:222

The reason is that when you do an "isAddressResetRequest" you only delete the shipping address but do not reset the shipping method.

My understanding is that this should happen combined.