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.57k stars 9.32k forks source link

Checkout with PayPal throws a "Something went wrong ......" error #28092

Closed chequille closed 3 months ago

chequille commented 4 years ago

Preconditions (*)

  1. Magento Version 2.4 -develop
  2. Paypal Sandbox Configuration Enabled
  3. InContext Checkout Disabled

Steps to reproduce (*)

  1. Do a Checkout
  2. Click Paypal Radio and Click on "Continue to Paypal" button

Expected result (*)

  1. Of course not showing this error, because PayPal is still opened and the order is processed till the end

Actual result (*)

  1. Getting this error after Pay Button is pressed, but the change to the PayPal site is still happening. errormessagepaypalpayment

I just installed my backups from 2.3.4 version and there it does not happen. So something within the 2.3.5-p1 update must be the reason for this.

Ok, the order is still processed but sorry, I do not want to see this error message, even if it is disappearing after a few seconds and the page is moving to PayPal sites.

Unfortunately, nothing logged in the log directory or in the the report directory.

chequille commented 4 years ago

It seems nobody cares about bugs.

But guys, we will have soon a new version 2.4.x. You will see, there are all bugs fixed and a lot of new bugs will be there!!!!!

I am really thinking about changing the system. The only fact that I did not do it yet is, that I made a couple of changes in extensions to get the shop working as I want. I really fear about upgrading when 2.4.x is out. Currently my shop is up and running (so far ok), but what will be after uprgading?

As well since two weeks, the magento 2.4 instance stuff is not working and I can not try to reproduce some other bug (maybe not bug :-) ) Really strange.

Ok, enough for today. There are some more important things to do. It is weekend :-)

Regards to everybody and keep on fighting !!! Chequille

tushhan commented 4 years ago

I am using Magento 2.3.5-p2 and having the same problem, I don't know what is causing this but some customers facing the same issue while others not, and this makes me think whether Magento checkout page is compatible with all browsers or not.

It has been weeks now, no solution, and many customers think to move Shopify or similar platforms because of these bugs and problems while Magento fails many users and people can not sell their goods online. It is a shame and I wish there could be a more agile team resolving issues for Magento.

almr commented 4 years ago

tushhan, I am using Magento 2.3.5-p2 also and having the same problem. Any solution you found? No way to find the issue, still struggling, it looks like attacks from hackers which made checkout dis-functional.

LLudas commented 4 years ago

HELLO, everyone, the easiest way is to move to Magento 2.4 this bug is fixed there. Thank you everyone for solutions and answers.

chequille commented 4 years ago

Unfortunately, moving to 2.4.0 is not that easy as you say with all the new requirements like ElasticSearch !!!!

tushhan commented 4 years ago

Hi, just let you know. The problem we had was because of a wrong value for website_id (scope) assigned to products. Let’s say the default website has "1" as a value in product CSV, I have detected that the values were changed to 3 or 4 and some 0. I have corrected all by downloading inventory in CSV and changed values correctly and uploaded, after that, we didn’t have a problem.

I had this problem with one of my client’ website who migrated from M 1 to M 2. They also created a few new websites on the same Magento and I guess they messed up the default values of products.

If a product with the wrong website value added to the cart then at checkout website gives an error, as you can not buy a product that does not belong to the default (or whichever is chosen) website.

JoostWan commented 4 years ago

@tushhan you mean _websiteid inside catalog_product_website? Checked it but there a no record with website_id that doesn't exist.

tushhan commented 4 years ago

In my case, it is "website_id" as seen on the attached screenshot but it could be "catalog_product_website" on another Magento. You can download an existing SKU and check the CSV column to find the right column name. Also, make sure that you pick the correct number for the website, as you can see on the screenshot attached, the "website_id" column value is "0", whereas the correct value for our live website was "1" so I had to replace all values with "1" for that column. You can create a sample product (SKU) on Magento, download it, and copy default settings to replace all other existing SKUs. Please don't copy values from any other CSVs not downloaded from your website as every website may have different default values and attribute names.

Screenshot 2020-10-07 at 21 39 16

ghost commented 4 years ago

@magento I am working on this

chequille commented 4 years ago

What is the solution for that? Why closed? Getting angry now!!!

hostep commented 4 years ago

@chequille: there is some sort of automation problem happening for a while here which closes tickets for some reason. But @sdzhepa often manually leaves a comment a few days later to explain why it was closed. So @sdzhepa: if you could figure out why this one got closed, that would be appreciated! 🙂

brianrootways commented 4 years ago

I am getting an error (Something went wrong with your request. Please try again later.) while doing PayPal express checkout in firefox especially and redirect to PayPal website. In chrome, edge etc. working fine. Here I give you a screenshot for better understanding.

Can you please help me to fix this issue?

paypal-express

cengizcoskun commented 3 years ago

Did you find any solution? I have same problem.

ghost commented 3 years ago

Well this error comes because of Magento_Csp extension , it creates some problem for paypal so disable the Magento_Csp extension, set all paypal configurations for paypal payment method from magento admin and try again,

I hope error will gone.

chequille commented 3 years ago

@Amit-Hariyani Hi, unfortunately this did not solve the problem in my setup. As well I do not know if it is a good idea to disable this, because maybe some other extensions depend on it.

brianrootways commented 3 years ago

@Amit-Hariyani Hi, I did disable CSP module but we are getting an error while doing PayPal express checkout. @chequille

image

Maybe its causes because of customer-data.js error (line number: 95) throw in the console.

image

brianrootways commented 3 years ago

@chequille Let me know if you find any solution regarding to error: PayPal express checkout error something went wrong with your request.

chequille commented 3 years ago

Hi All, still have this problem as well on Magento 2.4.2 Can somebody let us know if this will be fixed sometimes???????

arunkumar247 commented 3 years ago

@magento-engcom-team I am also facing the issue in 2.4.1-p1 . Is there any steps taken to fix the issue? Why the ticket status is closed? Please consider re-opening this issue and find the cause.

5m-solutions commented 3 years ago

We resolved this by removing the 'Email Associated with PayPal Merchant Account' and leaving it blank. A capital in this was the issue and on another client account they got their email mixed up. As the API is used anyway you don't need this filled in on the new Magento versions we believe. Works fine without it.

magento-engcom-team commented 3 years ago

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

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

chequille commented 3 years ago

@5m-solutions Hi, it does not work on my test shop using 2.3.5p2 version. I still get the error message "something went wrong ......." Which version do you use? Regards, Chequille

engcom-Oscar commented 3 years ago

I could reproduce this issue on latest 2.4-develop branch using Firefox browser.

chequille commented 3 years ago

I confirm this on 2.4.2 I cannot test develop branch. But I do not wonder that it is still an issue, because it seems that nobody cares !!!!!!! As it is with other things. I am not happy, because I cannot switch to 2.4.x version. We rented a V-Server 6 months ago to get 2.4.x requirements and to be aible to switch but I am still online with 2.3.5 on a hosting server. It is a shame, sorry guys but it is as I said.

Looking forward to find some solved issues here Regards, Chequille

muxmix commented 3 years ago

We resolved this by removing the 'Email Associated with PayPal Merchant Account' and leaving it blank. A capital in this was the issue and on another client account they got their email mixed up. As the API is used anyway you don't need this filled in on the new Magento versions we believe. Works fine without it.

This solution worked for me too! Thanks 5m

plastikschnitzer commented 3 years ago

Thank you @5m-solutions for the idea, I removed the email and the issue was still there.

Then checked all my paypal settings and disabled the method "Website Payment Standard" and enabled "PayPal Express" and the issue was gone! Not sure what Website Payment Standard is doing there because its handled by PayPal Express anyway as far as I can see.

So anyone who cannot solve it by simply removing the email address, check if you use website payment standard or PayPal Express and switch to express. Maybe this will solve it for you as well.

chequille commented 3 years ago

Unbelievable, still happens in version 2.4.3 What are you going to do with this?

MTheProgrammer commented 3 years ago

We had a similar issue in Firefox and Safari only and no error message appeared in Chrome.

This SO answer explains the cause: https://stackoverflow.com/questions/4807572/jquery-ajax-error-handling-to-ignore-aborted/15141116#15141116

Firefox navigates to another page (paypal express checkout) and aborts all pending XHR requests. PayPal catches exception with .fail() method, but it does not verify failure cause. Second argument (textStatus) fail() defines failure reason. Callback should verify whether textStatus !== 'abort'. However, Firefox always returns 'error' so there must be another condition (e.g. check if there was no redirect initiated).

Message is defined here:

# vendor/magento/module-paypal/view/frontend/web/js/in-context/express-checkout-wrapper.js
paymentActionError: $t('Something went wrong with your request. Please try again later.'),

It is used then in .fail() callbacks of these scripts:

The fast workaround is to enable In context checkout for PayPal. This way the customer is completing payment without being redirected to the gateway website.

chequille commented 3 years ago

Hi @MTheProgrammer , the fast workaround is no option for my shop, as I must have the button "order now" because of legal rights. Therefore I cannot use InContext PayPal Regarding Chrome I am not sure at the moment if it does not happen on my site. Have to test this again. But anyway there must be a solution for Firefox as well.

MTheProgrammer commented 3 years ago

Yes, that is just a partial solution. Module should work for both cases. I think that you can add mixins or override those methods which I mentioned above and verify somehow whether there was a redirect.

chequille commented 3 years ago

Little bit confused now!!!! Just made a few orders on my site with firefox and did not get the error anymore. My firefox is version 93.0 Could it be tht firefox changed something?

MTheProgrammer commented 3 years ago

It depends on how fast is the request processing. Just verify request timing in dev tools whether it was finished before Navigating to PayPal express checkout. Please verify it on Safari. Although our clients were redirected to PayPal website they were confused with that error message and always contacted the support to explain this issue.

convenient commented 2 years ago

We're seeing this issue as well on an enterprise client. Replicable on safari and firefox when you quickly click the paypal button after selecting the payment method.

plastikschnitzer commented 2 years ago

@convenient did you enter the paypal email address in the backend? Try to remove it and see if it still appears, this field is not mandatory and solved the issue for me.

LLudas commented 2 years ago

What we did: We've updated magento to newer version (actually reinstalled freshly everything) and problem was solved. Probably there was a fix in newer version. This is the best and easiest solution to upgrade. Another solution to disable Paypal payment. This should solve this problem too. BR

plastikschnitzer commented 2 years ago

I updated to Magento 2.4.3-p1 and now the issue is back …

I got the advice to look at this issue: https://github.com/magento/magento2/issues/33741 But unfortunately, it was not the solution for me :-/

plastikschnitzer commented 2 years ago

According to the release notes of Magento 2.4.4, the issue is fixed there! Maybe someone can test and confirm?

https://devdocs.magento.com/guides/v2.4/release-notes/open-source-2-4-4.html

hostep commented 2 years ago

The following is just FYI, no confirmation from my end.

@plastikschnitzer probably means this entry from the release notes of Magento 2.4.4:

Magento Open Source no longer displays an error during checkout with the PayPal Express payment method. Previously, although the checkout process completed, Magento Open Source displayed this error: Something went wrong.

This is linked to internal ticket number MC-42154 of which I can only find this commit: https://github.com/magento/magento2/commit/d2666309e925856c9854b3c65af0bdb4730b0c43

Again, no confirmation if this is a fix for this issue, this is just information I gathered from the release notes.

plastikschnitzer commented 2 years ago

I could not check with Magento 2.4.4 yet, but I used the chance now to apply the commit @hostep mentioned to Magento 2.4.3-p1 and it solves the issue for me. Thank you @hostep for doing the research for the commit!

Give it a try ;-)

Xuanmoi commented 2 years ago

I also encountered this problem. From the network point of view, the safari browser, using paypal to place an order, will repeatedly send the request, send 4 set-payment-information requests, (normally 2 times), and thus send 2 get-total requests (normally 1 time) times), the second get-total request fails, resulting in the display of an error message. Temporary solution: The set-payment-information request sent when placing an order with paypal does not send a get-total request. Hopefully there will be a better solution later.

m2-assistant[bot] commented 3 months ago

Hi @engcom-Delta. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


engcom-Delta commented 3 months ago

Hi @chequille ,

Thanks for your reporting and collaboration. We have verified the issue in latest 2.4-develop instance, but we are unable to reproduce the issue. Kindly refer the screenshots.

Steps to reproduce.

  1. Enable PayPal Sandbox Configuration.
  2. Disable InContext Checkout. paypal config
  3. Add items to cart.
  4. Navigate to checkout.
  5. Enter shipping address and select shipping method.
  6. Select PayPal as Payment method.
  7. Click on "Continue to PayPal"

https://github.com/user-attachments/assets/d34cd9cb-8b8d-4ca6-859c-9fd52ab45923

Please let us know if any other steps are needed to be performed.

Thanks.

engcom-Delta commented 3 months ago

Hi @chequille,

We have noticed that this issue has not been updated since long time. Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.

engcom-Delta commented 3 months ago

Hi @chequille,

We have noticed that this issue has not been updated since long time. Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.