magento2: Email address has a wrong format error, on paypal express checkout Magento 2.3.2
Preconditions (*)
- Issue appears when pacing order with Paypal express checkout
Steps to reproduce (*)
- Goto checkout and try order using Paypal express checkout
Expected result (*)
- [Screenshots, logs or description]
- Checkout should completed and order created in Magento
Actual result (*)
- [Screenshots, logs or description]
- Checkout error
Exception message: We can't save the address: Email has a wrong format Trace: <pre>#1 Magento\Framework\Model\ResourceModel\Db\AbstractDb->save() called at [vendor/magento/framework/Model/AbstractModel.php:655]
However payment is clearing and paypal email also received, but Magento order not created (Because of email validation error)
I checked in this file vendor/magento/module-sales/Model/Order/Address/Validator.php and $address->getEmail() is coming NULL/empty
https://i.stack.imgur.com/6yjfR.png $address->getEmail() is returning null, that’s why validation is failing
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 18 (2 by maintainers)
Yes, Issue appears when we click on paypal express checkout from product/cart/mini-cart pages, didn’t tried from checkout page. The site redirects to paypal, then from paypal to magento again for order placement/review. On this page error appeared of “Wrong email address format”.
But issue is resolved from the patch I have uploaded above. Express checkout works fine now.
Hello everyone,
why is this issue closed. This can be clearly reproduced. I have done so in one of our shops. The fix seems ok.
Do you need an pull request?
Thanks!
For anyone to come across this issue, here is the quick code to copy. Thanks to @Arsalanulhaq