Skip to content
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

Paypal express checkout displays Object Object instead of actual error messsage in checkout #39736

Open
2 of 5 tasks
xtremevision opened this issue Mar 12, 2025 · 8 comments
Open
2 of 5 tasks
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.6-p2 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@xtremevision
Copy link

xtremevision commented Mar 12, 2025

Preconditions and environment

  • Magento 2.4.6-p2
  • nginx
  • MariaDB 10.4.25
  • Opensearch
  • php 8.1
  • Paypal express checkout payment method enabled (Sandbox)
  • Flat rate shipping enabled

Steps to reproduce

  1. Create a customer account, don't add any addresses
  2. Add product to cart
  3. Go to checkout
  4. Select PayPal Express Checkout
  5. Click on PayPal yellow button

The PayPal pop-up will be shown for a few seconds, then closed automatically, and the top of the checkout page will show "Object Object" instead of "The shipping address is missing. Set the address and try again."

Image

Expected result

Display the proper error message:

Image

Actual result

Error shown as "Object Object"

Image

Additional information

I've come up with a patch which has fixed the error for me. Not sure if this is a theme related issue, or core Magento PayPal module issue.

index b6f2eb5..37dfce5 100644
--- a/view/frontend/web/js/view/payment/method-renderer/in-context/checkout-express.js
+++ b/view/frontend/web/js/view/payment/method-renderer/in-context/checkout-express.js
@@ -58,9 +58,16 @@
                     error = this.paymentActionError;
                 }
 
-                this.addError(error);
+                if(error.hasOwnProperty('message')) {
+                    var errorToThrow = error.message;
+                    this.addError();
+                }
+                else
+                    var errorToThrow = error;
+                
+                this.addError(errorToThrow);
 
-                return reject(new Error(error));
+                return reject(new Error(errorToThrow));
             }.bind(this));
 
             return promise;

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Mar 12, 2025

Hi @xtremevision. 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.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@xtremevision
Copy link
Author

@magento give me 2.4-develop instance

@xtremevision
Copy link
Author

@magento I am working on this

Copy link

m2-assistant bot commented Mar 12, 2025

Hi @xtremevision! 👋
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@engcom-Bravo engcom-Bravo self-assigned this Mar 14, 2025
Copy link

m2-assistant bot commented Mar 14, 2025

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.6-p2 Indicates original Magento version for the Issue report. label Mar 14, 2025
@engcom-Bravo
Copy link
Contributor

Hi @xtremevision,

Thanks for your reporting and collaboration.

We have tried to reproduce the issue in Latest 2.4-develop instance and we are not able to reproduce the issue.kindly refer the attached video.

Screen.Recording.2025-03-21.at.3.02.01.pm.mov

After adding an address only we are able to select payment method as paypal and we are able to place the order.Could you please let us know if we are missing anything.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Mar 21, 2025
@engcom-Bravo engcom-Bravo moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Mar 21, 2025
@github-project-automation github-project-automation bot moved this to Ready for Confirmation in Issue Confirmation and Triage Board Mar 21, 2025
@xtremevision
Copy link
Author

xtremevision commented Mar 21, 2025

You are testing with an address which is defeats the issue. The problem happens when there's no address for the customer. Look at my screenshots. You are using Magento Luma default checkout, I am using a theme based onepage checkout, and whilst my checkout differs from core, the error itself is coming from core.

The theme onepage checkout is relying on checkout-express.js from core. This is returning an object instead of a string with the error message.

@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Mar 26, 2025
Copy link

m2-assistant bot commented Mar 26, 2025

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

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.6-p2 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

3 participants