[FIXED] Preparing Paypal payment fails with error "A problem occured when performing an operation in PayPal"

Hi,
we’re having issues with Paypal payments in our web application.

The call to:
https://payment.snipcart.com/api/public/sessions/b6ae651d-a4530df8-3c09-4a32-ba8d-cbca6347c316

fails with a 422 error and these details:
{ code: “ApplicationErrors_PaypalError”
message: “A problem occured when performing an operation in PayPal.” }.

We’ve just enabled the live mode and generated the production API key.

Thanks for your help,
Andrea

1 Like

We’ve fixed the issue!
It seems that Paypal EC doesn’t accept product names and descriptions longer than 127 characters.

Could be useful if this third-party limitation was mentioned in the documentation so that other developers won’t go mad like me debugging this :rofl: :rofl: :rofl:.

Thanks,
Andrea

I am getting the same 422 “Unprocessable Entity” error from a PATCH request to https://payment.snipcart.com/api/public/sessions/8f328b38-60b6e96a-9960-40f7-a24f-c29b8bdf10ee even after limiting product names and descriptions to 120 characters length.

Here’s the response for that request:

{"errors":[{"code":"ApplicationErrors_PaypalError","message":"A problem occured when performing an operation in PayPal."}],"type":"","title":null,"status":422,"detail":"","instance":"","extensions":{}}

And the request body:

{"paymentMethod":"paypal"}

What else could be the reason for this?

Hi,
I had another problem with discounts which triggered a similar error.

Not sure if this can help you but I’ll try nonetheless, here is the thread:

Cheers,
Andrea

Thanks @azicchetti. We don’t have discounts applied. But I will note this down for future reference.