-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix inability to place PayPal guest order when Automatic Assignment to Customer Group is enabled #25405
Fix inability to place PayPal guest order when Automatic Assignment to Customer Group is enabled #25405
Conversation
This change sets an e-mail address on the customer model assigned to the guest quote prepared for further processing by PayPal module. It circumvents inability to place a guest order with PayPal Express when Automatic Asignment to Customer Group is enabled. Fixes magento#25399
Hi @xylodev. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@magento give me test instance |
Hi @xylodev. Thank you for your request. I'm working on Magento instance for you |
Hi @xylodev, here is your new Magento instance. |
I can confirm that the issue is resolved on the provided test instance |
Hello @xylodev thank you for your contribution! Due to Magento Definition of Done all code must be covered by tests. For this specific case, you should cover your fix by automated tests with the scenario which leads to an issue. Tests should fail on the mainline and pass with your fix. A starting point could be extending the Thank you again! |
I was having the same issue and I don't think the proposed solution is the way to go. This only solves it for Paypal but this issue exists when using other payment methods as a guest. A better solution needs to be done in the Magento Core. My fix for it was to set "Enable Automatic Assignment to Customer Group" to "Yes" at the website level as that is where my customer is created and set it to "No" at the store level which is what is checked when placing a guest order. |
@xylodev do you have plans to cover another checkout scenario? Looks like the issue is fixed for PayPal only. |
@sidolov I will review this issue next week and, depending on the review outcome, I will try to provide more general fix with the test coverage |
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.
Waiting for additional coverage of all scenarios.
@magento run all tests |
Hi @gabrieldagama, thank you for the review. |
@magento give me test instance |
Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Alfa, here is your Magento Instance: https://b801cb7a66756698c11b87bf4cae4b72.instances.magento-community.engineering |
✔️ QA Passed Manual testing scenario:
Before: ✖️ The payment is processed successfully on PayPal gateway, but the order is not created in Magento because of "Failed address validation: %1" error After: ✔️ The payment correctly processed by PayPal and the order is successfully created Also, was tested with disabled Automatic Assignment to Customer Group, placing an order from payment method step, from the cart page and everything works as expected. |
… Assignment to Customer Group is enabled #25405
Hi @xylodev, thank you for your contribution! |
One of our shops reported that customers are unable to place a guest orders using the PayPal Express payment method. After some investigation it found out that this issue is caused by wiping out the customer email address from the quote model during the automatic assignment to the customer group. Moreover, the inability of placing the order is the case only when the PayPal is triggered from the cart by clicking "Checkout with PayPal" button. When one tries to make a guest order using PayPal in the payment method step in the checkout, the order is placed correctly due to the obvious reason, the e-mail address is explicitly set by the buyer during the 1st step of the checkout and thus it is correctly propagated to the corresponding customer object. This isn't the case when PayPal is started from the cart level.
Description (*)
This PR implements setting an e-mail address on the customer object assigned to quote, which is prepared for the furthr processing by PayPal module when the checkout is recognized as a guest one. The e-mail address is set only when the corresponding customer object doesn't have it set yet.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)