Jump to content

[SOLVED] Paypal Error Code 10413 totals of cart items don't match total


Recommended Posts

Hi,

 

My website (www.paperbliss.com.au) has only been active for 6 days and I have experienced 3 cases of the following Paypal error:

 

A client has encountered a problem with the module PayPalAPI, see the report: PayPal response:

TIMESTAMP -> 2012-03-27T11:38:05Z

L_ERRORCODE0 -> 10413

L_SHORTMESSAGE0 -> Transaction refused because of an invalid argument. See additional error messages for details.

L_LONGMESSAGE0 -> The totals of the cart item amounts do not match order amounts.

L_SEVERITYCODE0 -> Error

 

I understand this has something to do with rounding to 2 decimal places. I am using Prestashop V 1.4.3 and Paypal module V2.4.

 

Could someone please advise how I resolve this issue?

Thanks in advance,

Nadine

Link to comment
Share on other sites

Thanks Mike,

 

How do I install this version? Sorry I am not a programmer.

 

I will be out for the next 2 hours but I will give it a go when I return if you could give me some guidance?

 

Many thanks

Nadine

Link to comment
Share on other sites

Hi Nadine,

In your Back Office, just go to the Modules tab, click "Uninstall" for your existing PayPal Module, and then use the "Add a module from my computer" option at the top of the page to upload the .zip file I attached above.

 

Alternatively, you can also unzip that file and replace the old version it in your /modules directory via FTP.

 

I hope this helps.

 

-Mike

Link to comment
Share on other sites

I have encountered the same error. The shop has worked fine for weeks with no issue of processing orders, but just got this message recently and with customer complaint about inability to check out.

 

 

 

A client has encountered a problem with the module PayPalAPI, see the report: PayPal response:

TIMESTAMP -> 2012-03-30T03:47:28Z

L_ERRORCODE0 -> 10413

L_SHORTMESSAGE0 -> Transaction refused because of an invalid argument. See additional error messages for details.

L_LONGMESSAGE0 -> The totals of the cart item amounts do not match order amounts.

L_SEVERITYCODE0 -> Error

PayPal returned error

 

I am using Prestashop 1.4.7.0

PayPal

v2.8.6

 

 

What can I do?

Link to comment
Share on other sites

exactly the same problem here. I also use Paypal v2.8.6 and Prestashop 1.4.7.0.

 

Previously everything runs fine. But today, got the same error message.

 

 

I have encountered the same error. The shop has worked fine for weeks with no issue of processing orders, but just got this message recently and with customer complaint about inability to check out.

 

 

 

A client has encountered a problem with the module PayPalAPI, see the report: PayPal response:

TIMESTAMP -> 2012-03-30T03:47:28Z

L_ERRORCODE0 -> 10413

L_SHORTMESSAGE0 -> Transaction refused because of an invalid argument. See additional error messages for details.

L_LONGMESSAGE0 -> The totals of the cart item amounts do not match order amounts.

L_SEVERITYCODE0 -> Error

PayPal returned error

 

I am using Prestashop 1.4.7.0

PayPal

v2.8.6

 

 

What can I do?

Link to comment
Share on other sites

  • 6 months later...
  • 4 weeks later...
  • 3 weeks later...

A fix to this is to not use the line items. Prestashop already sends the customer a receipt with the PayPal TRANSACTIONID so there's no confusion, but it is *definitely* better to have line items working because it obviously can be a cause of confusion for you and the customer.

 

To do this you need to change

 

if ($discounts == 0)

{

$products = $cart->getProducts();

$amt = 0;

for ($i = 0; $i < sizeof($products); $i++)

{

$request .= '&L_NAME'.$i.'='.substr(urlencode($products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ), 0, 127);

$request .= '&L_AMT'.$i.'='.urlencode($this->PayPalRound($products[$i]['price']));

$request .= '&L_QTY'.$i.'='.urlencode($products[$i]['cart_quantity']);

$amt += $this->PayPalRound($products[$i]['price'])*$products[$i]['cart_quantity'];

}

$shipping = $this->PayPalRound($cart->getOrderShippingCost($cart->id_carrier, false));

$request .= '&ITEMAMT='.urlencode($amt);

$request .= '&SHIPPINGAMT='.urlencode($shipping);

$request .= '&TAXAMT='.urlencode((float)max($this->PayPalRound($total - $amt - $shipping), 0));

}

 

else

{

$products = $cart->getProducts();

$description = 0;

for ($i = 0; $i < sizeof($products); $i++)

$description .= ($description == ''?'':', ').$products[$i]['cart_quantity']." x ".$products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ;

$request .= '&ORDERDESCRIPTION='.urlencode(substr($description, 0, 120));

}

 

to

 

 

$products = $cart->getProducts();

$description = 0;

for ($i = 0; $i < sizeof($products); $i++)

$description .= ($description == ''?'':', ').$products[$i]['cart_quantity']." x ".$products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ;

$request .= '&ORDERDESCRIPTION='.urlencode(substr($description, 0, 120));

 

 

They probably differ from version to version, but essentially eliminate the whole if ($discounts == 0)

block and only use the "else" block code instead.

Edited by rkinfo (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Bonjour,

 

Tout fonctionnais bien depuis quelques mois et là d'un coup !! 10413

 

PayPal response:

TIMESTAMP -> 2012-12-26T20:38:26Z

L_ERRORCODE0 -> 10413

L_SHORTMESSAGE0 -> Transaction refused because of an invalid argument. See additional error messages for details.

L_LONGMESSAGE0 -> The totals of the cart item amounts do not match order amounts.

L_SEVERITYCODE0 -> Error

PayPal a retourné une erreur

Que faire je suis en version Paypal 2.8.7 et Presta 1.4.6.2

 

Merci de votre aide.

Link to comment
Share on other sites

  • 3 months later...

The PayPal module that comes pre-installed on Prestashop is old and out of date. It will not work.

 

You will have to delete this from the Modules section and also in the public_html/store/modules/PayPal area of the file manager.

 

Then you will need to download the updated FREE PayPal module here:

http://addons.prestashop.com/en/search?search_query=paypal

 

 

Then go back to the Prestashop Back Office Modules and then click “Add New” then upload the PayPal module .zip file.

 

This should solve the PayPal problem.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi Nadine,

In your Back Office, just go to the Modules tab, click "Uninstall" for your existing PayPal Module, and then use the "Add a module from my computer" option at the top of the page to upload the .zip file I attached above.

 

Alternatively, you can also unzip that file and replace the old version it in your /modules directory via FTP.

 

I hope this helps.

 

-Mike

Hello Mike,

I'm having problems with paypal express checkout - Please help  !

Domain: mkehome.com

 

Thanks in advance.

Mo Bility

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
  • 4 weeks later...
  • 4 months later...
  • 1 month later...

Hello.

 

I have the same problem testing my new PrestaShop commerce. PayPal support team referred me to this forum but I see no solution. I will have to avoid giving discounts?

 

Thank you if someone has any suggestion.

 

Regards.

 

Sergio

Link to comment
Share on other sites

  • 4 months later...
  • 4 weeks later...

Hi, I have 1.0.6.9 of prestashop and this form has always worked but today I received these emails whit this text:


Error reporting from your PayPalAPI module

A client has encountered a problem with the module PayPalAPI, see the report:

PayPal response: 
TIMESTAMP -> 2015-11-30T08:24:23Z 
L_ERRORCODE0 -> 10401 
L_ERRORCODE1 -> 10427 
L_ERRORCODE2 -> 10413 
L_SHORTMESSAGE0 -> Transaction refused because of an invalid argument. See additional error messages for details. 
L_SHORTMESSAGE1 -> Transaction refused because of an invalid argument. See additional error for details. 

L_SHORTMESSAGE2 -> Transaction refused because of an invalid argument. See additional error messages for details. 
L_LONGMESSAGE0 -> Order total is invalid. 
L_LONGMESSAGE1 -> Shipping total is invalid. 
L_LONGMESSAGE2 -> The totals of the cart item amounts do not match order amounts. 
L_SEVERITYCODE0 -> Error 
L_SEVERITYCODE1 -> Error 
L_SEVERITYCODE2 -> Error

post-1119372-0-96920100-1448874506_thumb.pngmessages

anyone can help me?

Link to comment
Share on other sites

  • 3 weeks later...

Are you guys all using PayPal Pro or PayPal standard? It seems the problem is related only to PayPal Pro account users.

 

And problems are just not there. For example the manual capture won't work with any PayPal Pro account.

 

This was confirmed by the PayPal module developers, in one of our open ticket.

 

Same thing for discounted carts. We had the same problem,  the total paid doesn't match the total of the cart.

 

The developer of another module we bought, during his tests, confirmed that all works fine with PayPal Standard, but won't work with a PayPal Pro account.

Link to comment
Share on other sites

  • 3 months later...

Hi,
 
I ran into the same problem with my Prestashop 1.6 using Paypal USA&Canada v1.3.9 and using the Express Checkout mode.
I found the solution which fixed the issue :
 

The totals of the cart item amounts do not match order amounts.

 
Dh42 wrote the solution in another post thread:
 
In the Paypal folder, open the file controllers/front/expresscheckout.php find line 120 and remove .$nvp_request from the line,
It should be almost at the end of the line.

 

Source: https://www.prestashop.com/forums/topic/445960-paypal-error-code-10413/?p=2074417

 

This fixed the issue for me.

  • Like 2
Link to comment
Share on other sites

Actually, related to my previous post, i have to say that i tested simultaneously 2 Paypal modules.

- One was proposed by Prestashop 1.6 : it's "Paypal USA, Canada" in version 1.3.9.

- The other one is "Paypal v.3.5.7"

 

The second one, i don't know if it's older or not... it seems to be... because i used to use it on Prestashop 1.4.10, and actually the result on the website is actually almost the same.

The difference is that on Paypal v3.5.7, when i arrive on the Paypal interface, i got the new Paypal interface and it displays the amount of the transaction (you have to click on the total of the order which is summed up in the top right of the left block of the Paypal Interface.

 

With "Paypal USA, Canada" in version 1.3.9, i have 2 different interface according to if i use "Express checkout" or "Standard".

If i use standard, i have the old Paypal interface, which doesn't detail properly the order according to if i use discounts or not, and also depends of the number of discounts. If i use over than 1 discount, the whole order details will be summed up into 1 amount "item amount". Which is very bad, because it includes the different items amount + the different discounts + shipping fees + tax. So i used the "Express checkout" mode, and i finally got the new Paypal interface. Though, i noticed that the order amount actually doesn't display at all !!! And it will create a new customer account on your Prestashop website if the name of the Paypal customer is different from the name used to proceed the purchase on the Prestashop website. So i don't recommand "Paypal USA, Canada" in version 1.3.9.

 

I would recommand Paypal v3.5.7 which seems to work fine.

Link to comment
Share on other sites

  • 11 months later...

A customer of me had the "item total invalid" error and - inspired by forum posts that it has to do with rounding - I decided to replicate his order. And indeed: that gave me the same error. When I added a product of just 5 cent the error was gone. 

 

This had to with Paypal with Fee but such workarounds might work elsewhere too.

Link to comment
Share on other sites

Hi,when I uploaded the zip file I got this error:

 

[PrestaShop] Fatal error in module file :/home3/disennior/public_html/saludwellness.net/modules/paypal/paypal.php:
Cannot make non static method ModuleCore::display() static in class PayPal

 

Now, every time I go the the modules section I receive the same error. Somebody knows how to solve this??

Link to comment
Share on other sites

I found this solution in a post and it works for me.

 

If you are using the latest version of the module and using express checkout try this, it should fix your issue. Goto Modules/paypalusa/controllers/front/expresscheckout.php find line 120 and remove this from the line,

.$nvp_request

It should be at the end of the line almost

Link to comment
Share on other sites

  • 2 years later...

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...