Jump to content
thirty bees forum
  • 0

Paypal error occurred please try to contact the merchant: an unknown error occured


Question

Posted

Paypal: Error occurred please try to contact the merchant: an unknown error occured. The payment status is 'approved'

 

Hi,

we received a report of this error today from a customer in Germany; it has also happened twice in recent weeks with customers from Ireland.

The customer receives a 500 error, and the order is not created in the shop, though the open shopping cart remains saved in the back office.

We are running tb v1.6.0 and PHP 8.1.34, with the thirty bees PayPal module v5.6.2. We are, of course, in live mode (not sandbox), and everything had been running smoothly for weeks, but now these errors are occurring intermittently.

This is a problem, so we are asking for help or a solution—specifically if any changes need to be made to the module. This is a critical issue, as a PayPal module is not something we should ideally be modifying ourselves.

5 answers to this question

Recommended Posts

  • 0
Posted

The 500 appears at the customer's location, not in our shop 😞
Do you need any other details?

Exception
Message:
ThirtyBeesException: Property PayPalModule\PayPalCustomer->id_customer is empty

Location:
classes/ObjectModel.php line 1054

Stacktrace
#0  classes/ObjectModel.php(1054)
#1  classes/ObjectModel.php(333): ObjectModelCore->validateFields()
#2  classes/ObjectModel.php(361): ObjectModelCore->getFields()
#3  classes/ObjectModel.php(610): ObjectModelCore->getFieldsPrimary()
#4  modules/paypal/controllers/front/expresscheckout.php(151): ObjectModelCore->add()
#5  modules/paypal/controllers/front/expresscheckout.php(63): PayPalexpresscheckoutModuleFrontController->processPayment()
#6  classes/controller/Controller.php(209): PayPalexpresscheckoutModuleFrontController->initContent()
#7  classes/controller/FrontController.php(264): ControllerCore->run()
#8  classes/Dispatcher.php(858): FrontControllerCore->run()
#9  index.php(33): DispatcherCore->dispatch()

 

  • 0
Posted

The stacktrace suggests that, at the time customer is redirected back from paypal to your store, cookie no longer contains information about customer. And most likely cart (but we don't know that). 

This is very strange, because core definitely creates (or loads) customer record and set it to cookie before it redirects to paypal. 

Unless you have some third-party checkuot system / OPC etc, that may not do that?

Or maybe you have some module installed that handle cookies/consent/gdpr and similar crap? Such module could delete the cookie if customer didn't give consent to track their info, effectively blocking the entire checkout flow.

  • 0
Posted

The only module we have for cookies is  EU Cookie Consent v1.0.2  from thirty bees  (with an information for customer about session cookie) ,  no GeoIP,
and we really do not use any cookie except the standard session cookie for cart,
an no third-party checkout system or OPC.
As far as I know, therefore, there is nothing the customer could "refuse to consent to" that would then cause problems.

  • 0
Posted

Really hard to tell where the issue is. It may not even be within thirtybees installation.

This problem could also be caused by your customers using some browser with very strict privacy policy, or with some adblock extension that mistakingly considered tb cookie as a tracking one, and deleted it.

Or maybe you have incorrectly set up nginx reverse proxy in front of your php server, with too small cookie buffer. When cookie is bigger than the buffer size, nginx might drop the cookie completely.

And who knows what else can this cause.

Only thing that we know for sure is that cookie does not contain customer information.

Until you find the root cause and fix it, you can try this:

edit file 

  modules/paypal/controllers/front/expresscheckout.php

and change it like this commit:

https://github.com/thirtybees/paypal/commit/5578b7825301488872d758f7ecfdd770bb04e61c

With that fix, the system will survive this particular place, and *hopefully* create an order. Although the order will be associated with a brand new customer account (with the same email address), so it's more of an workaround that a permanent solution.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...