This article provides a fix for errors received during order placement when selecting a region in PayPal Express Checkout. The issue is caused by changes made in the Adobe Commerce v2.3.4 release and is related to how PayPal Express Checkout address fields are parsed.
An error occurs when entering the country and region during order placement in PayPal Express Checkout. The issue is reproducible for any country where the region field in the address section is a text field (as opposed to a drop-down menu).
Steps to reproduce :
The order is placed successfully.
When the order button is clicked on, an error displays:
Error 500: NOTICE: PHP message: PHP Fatal error: Uncaught Error: Call to a member function getId() on null in httpdocs/vendor/magento/module-paypal/Model/Api/Nvp.php:1527
For Adobe Commerce on cloud infrastructure merchants: Adobe has included the fix in the Cloud Patches for Commerce v1.0.2. Please refer to Cloud Patches for Commerce release notes in our developer documentation to find instructions on applying the latest package.
For instructions, see How to apply a composer patch provided by Adobe in our support knowledge base.