magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Unable to place a guest order with PayPal Express when Enable Automatic Assignment to Customer Group is enabled #25399

Closed xylodev closed 4 years ago

xylodev commented 5 years ago

Preconditions (*)

  1. Magento 2.4-develop
  2. PayPal Express payment method is enabled and configured
  3. Option "Enable Automatic Assignment to Customer Group" is set to "Yes" in the Customers > Customer configuration settings section

Steps to reproduce (*)

  1. Make sure you are logged off from your Magento customer account
  2. Put anything to the cart
  3. Go to the cart and click "Checkout with PayPal" button
  4. Login to your PayPal account, choose the payment instrument and other options if applicable
  5. After being redirected back to the order review page, choose shipping method and click "Place order" button

Expected result (*)

The payment is processed on PayPal gateway, the order is created in Magento, customer sees order thank-you page

Actual result (*)

The payment is processed succesfully on PayPal gateway, but the order is not created in Magento because of "Failed address validation: %1" error, which is shown to the customer on the order review page, which the buyer is redirected to instead of the thank-you page

paypal_place_order_error

m2-assistant[bot] commented 5 years ago

Hi @xylodev. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@xylodev do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


xylodev commented 5 years ago

@magento give me 2.3-develop instance

magento-engcom-team commented 5 years ago

Hi @xylodev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

magento-engcom-team commented 5 years ago

Hi @xylodev, here is your Magento instance. Admin access: https://i-25399-2-3-develop.instances.magento-community.engineering/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.

m2-assistant[bot] commented 5 years ago

Hi @engcom-Charlie. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

xylodev commented 5 years ago

Reproduced on 2.3.x

paypal_error_on_magento_test_instance
m2-assistant[bot] commented 5 years ago

Hi @webkul-ratnesh. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


webkul-ratnesh commented 5 years ago

Not able to replicate this issue, I think the issue you are facing is with the address saved in your paypal account.

xylodev commented 5 years ago

@webkul-ratnesh thanks for your insights, but I cannot agree that it's related to the Paypal account address. It's actually a huge issue for one of our shops, it's not possible to place a guest order with PayPal, I was also able to reproduce it on vanilla Magento 2.3-develop instance with different PayPal accounts.

Did you follow all the steps carefully? Especially, were you logged off from your Magento customer account, did you use the PayPal button in the cart (please note, this issue is not valid when choosing PayPal Express in the checkout's payment methods step), did you enable "Automatic Assignment to Customer Group"? I'd love to see how you're completing the checkout following all the steps described.

Please check it once again, because I identified the root cause and have even a solution ready. The e-mail address is wiped out during the automatic group assignment, so it doesn't pass the final validation and the order creation fails.

m2-assistant[bot] commented 5 years ago

Hi @xylodev. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


ghost commented 5 years ago

:white_check_mark: Confirmed by @xylodev Thank you for verifying the issue! :+1: Your confirmation will help us to acknowledge and process this report.

askmikeyd commented 4 years ago

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.

TonyRutherford1 commented 4 years ago

Any update here?

ryanpalmerweb commented 4 years ago

Just to confirm we have had the same issue, manifesting as the following error appearing in the checkout against all payment methods (not just PayPal)

Failed address validation: Email has a wrong format

This was triggered by clicking the payment button in the checkout, which caused a 400 API response from the following endpoint

rest/default/V1/guest-carts/{{cartId}}/payment-information

The $address object in vendor/magento/module-sales/Model/Order/Address/Validator.php::validate() was the type "shipping" and appeared to contain all of the address info except for the email, causing the above error

Disabling the Automatic Assignment to Customer Group immediately resolved the bug for us

0franco commented 4 years ago

Same here, disabling Assignment to Customer Group solve the issue. Is someone working with that? @magento-engcom-team it have assigned enough priority?

magento-engcom-team commented 4 years ago

:white_check_mark: Confirmed by @engcom-Charlie Thank you for verifying the issue. Based on the provided information internal tickets MC-36916 were created

Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

magento-engcom-team commented 4 years ago

Hi @xylodev. Thank you for your report. The issue has been fixed in magento/magento2#25405 by @xylodev in 2.4-develop branch Related commit(s):

The fix will be available with the upcoming 2.4.2 release.

shoaibgits commented 3 years ago

I am Having the same issue with Magento 2.3.6, when the Automatic Customer Group Assignment is Set to YES and trying checkout with the Paypal Express Checkout.

I cant disable the Customer Group Assignment because i need this for the Some VAT validation process, So how to resolve this with the current setup.

shoaibgits commented 3 years ago

For the Older Version I have created a patch to fix this issue please refer to this Repository:

jrson83 commented 3 years ago

Thank you @shoaibgits your patch fixed the issue in Magento 2.3.6!

kamzata commented 2 months ago

Still present for me in Magento 2.4.7-p1.

This seems to solve the issue.