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.5k stars 9.3k forks source link

Wrong Guest Customer email when placing an order by graphql using payment "paypal_express" #37882

Closed zexperto closed 11 months ago

zexperto commented 1 year ago

Preconditions and environment

Steps to reproduce

using Graphql

Expected result

the Order email should be Customer Email "paypal@magento.com"

Actual result

the Customer email in the order and in the addresses is the buyer email which is not correct

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @zexperto. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. 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:

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://2ad3c28fd6c4f46878e9fffe6eb11bed.instances-prod.magento-community.engineering Admin access: https://2ad3c28fd6c4f46878e9fffe6eb11bed.instances-prod.magento-community.engineering/admin_8853 Login: 995dc35f Password: b7b7517a4ee3

engcom-Bravo commented 1 year ago

Hi @zexperto,

Thank you for reporting and collaboration.

We have tried to reproduce the issue on Magento 2.4-develop instance.

Steps to reproduce

using Graphql

We are able to set the Payment methods

Screenshot 2023-09-12 at 1 04 56 PM

We are not able to proceed further with placeOrder mutation could you please let us know we are missing anything.

Screenshot 2023-09-12 at 1 03 43 PM

We are getting error Unable to place order: A server error stopped your order from being placed. Please try to place your order again.

As per this document https://developer.adobe.com/commerce/webapi/graphql/schema/cart/mutations/place-order/ we will get this error when we don't have products in cart but we have products in cart.

Screenshot 2023-09-12 at 1 12 40 PM

Could you please help us to proceed further.

Thanks.

sheyandckap commented 11 months ago

Hi, I also face the same issue and my magento version is Magento ver. 2.4.5-p1. These are the steps to reproduce the issue

01.Create an Empty Cart mutation { createEmptyCart }

  1. setGuestEmailOnCart

mutation { setGuestEmailOnCart(input: { cart_id: "test" email: "test@gmail.com" }) { cart { email } } }

03.Add products

mutation { addConfigurableProductsToCart( input: { cart_id: "test" cart_items: [ { parent_sku: "2018-test" data: { quantity: 1 sku: "100-test-AI" } } ] } ) { cart { items { uid quantity product { name sku } ... on ConfigurableCartItem { configurable_options { option_label } } } } } }

  1. Cart Query

{ cart(cart_id: "test") { email items { id product { name sku } quantity errors { code message } } } }

05.setShippingAddressesOnCart

mutation { setShippingAddressesOnCart( input: { cart_id: "test" shipping_addresses: [ { address: { firstname: "ss" lastname: "sst" company: "Company Name" street: ["test"] city: "Los Angeles" region: "CA" region_id: 12 postcode: "90210" country_code: "US" telephone: "123-456-0000" save_in_address_book: false } } ] } ) { cart { shipping_addresses { firstname lastname company street city region { code label } postcode telephone country { code label } available_shipping_methods{ carrier_code carrier_title method_code method_title } } } } }

  1. setBillingAddressOnCart

mutation { setBillingAddressOnCart( input: { cart_id: "test" billing_address: { address: { firstname: "ss" lastname: "sst" company: "Company Name" street: ["64 Strawberry Dr", "Beverly Hills"] city: "Los Angeles" region: "CA" region_id: 12 postcode: "90210" country_code: "US" telephone: "123-456-0000" save_in_address_book: true } } } ) { cart { billing_address { firstname lastname company street city region{ code label } postcode telephone country { code label } } } } }

07.setShippingMethodsOnCart

mutation { setShippingMethodsOnCart(input: { cart_id: "test" shipping_methods: [ { carrier_code: "custom-1" method_code: "custom" } ] }) { cart { shipping_addresses { selected_shipping_method { carrier_code method_code carrier_title method_title } } } } }

08.createPaypalExpressToken

mutation { createPaypalExpressToken( input: { cart_id: "test" code: "paypal_express" express_button: true urls: { return_url: "paypal-return" cancel_url: "paypal-cancel" } } ) { token paypal_urls { start edit } } }

09.setPaymentMethodOnCart

mutation { setPaymentMethodOnCart(input: { cart_id: "test" payment_method: { code: "paypal_express" paypal_express: { payer_id: "test123" token: "VB-test" } } }) { cart { selected_payment_method { code title } } } }

  1. Place order

mutation { placeOrder( input: { cart_id: "test" } ) { order { order_number } } }

Order is able to place using these process but Order email is taken as the Paypal account email address which was used to sign in.

sheyandckap commented 11 months ago

Found the solution and I hope this will help for all. There is a patch for this already. https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/support-tools/patches/v1-1-29/acsd-49849-customer-email-was-replaced-with-paypal-email.html?lang=en

engcom-Bravo commented 11 months ago

@sheyandckap Thanks for your contribution & collaboration over here

Hi @zexperto,

Kindly refer this document https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/support-tools/patches/v1-1-29/acsd-49849-customer-email-was-replaced-with-paypal-email.html?lang=en there is a patch already released.

Similar issue has been confirmed here https://github.com/magento/magento2/issues/37824

Hence we are closing this issue.

Thanks.