-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix: paypal is not giving lastname in express checkout #23799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @bradleybrecher. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
| $this->_applyStreetAndRegionWorkarounds($shippingAddress); | ||
| // PayPal doesn't provide detailed shipping name fields, so the name will be overwritten | ||
| $shippingAddress->addData(['firstname' => $data['SHIPTONAME']]); | ||
| $_arraydata = explode(' ', $data['SHIPTONAME'], 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can SHIPTONAME contain more than two names? If so splitting and grabbing the second will result in inaccurate data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navarr PayPal send the data for the SHIPTONAME as one string(separated by spaces). PayPal requires a first and last name on express checkout so there must be at least 2 names in the string. So what I propose (in my most recent commit) is in the case where there are more than one first and/or last name, make an assumption that it is a first name. In the small chance where there are 2 last names, the admin can edit orders manually rather than always editing the database to insert the name(the initial issue). This issue is discussed further on Adam Wilson's blog.
pmclain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few syntax requests while the CI builds are still pending.
|
@bradleybrecher Please review failing checks. |
sidolov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, fix the code style issues, you need just to revert a lot of code styles changes made in the previous commits.
|
@bradleybrecher I am closing this PR now due to inactivity. |
|
Hi @bradleybrecher, thank you for your contribution! |
|
Hmm, still the same problem in M2.4.4 !?! |
Description (*)
Fixed Express checkout to show lastname in the the db for billing and shipping in guest mode. Two files were changed in the Magento\Paypal\Model, Checkout.php and Api\Nvp.php. For Checkout.php, had to comment out the lines that were setting the sipping details to NULL. In Api\Nvp.php , had to change the SHIPTONAME to split up the first and last name so each field can be saved respectively instead of the whole name in firstname.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)