Jump to content
pbliss

[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

Share this post


Link to post
Share on other sites
I am using Prestashop V 1.4.3 and Paypal module V2.4.

 

That could explain it. The older versions of the PayPal module can have some rounding issues. Can you please try using this version instead and let me know if that works any better for you?

 

paypal.zip

 

-Mike

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Brilliant, thanks Mike. I have installed the new version and I replicated the problem order and it worked without errors.

 

Thanks for your great service!

 

Cheers

Nadine

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Hi,

We also have the same error here... PrestaShop™ 1.4.3 & Paypal version v2.4

 

All of a sudden its stopped working ?

 

Is it best to install the new version of the module?

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Hello Mike,

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

Domain: mkehome.com

 

Thanks in advance.

Mo Bility

Share this post


Link to post
Share on other sites

Hi,

I had the same problem. The reason is because I do the test with a product with product's price under 1 € (0,01 €)

when I change the product's price to 1 € the problem is solved

 

Matteo

Share this post


Link to post
Share on other sites

I have the same problem witn Prestashop 1.6.09 and module 1.3.8 . I already uninstall and re install everything but nothing. THe problem still there and the sales drop. No solution yet.

Share this post


Link to post
Share on other sites

Very dissapointed. Today another client flew after claim for the same error. He used my promoted "Christmas Discount" but got error 10413 paying with Paypal.

 

In my other site running Zencart it works like a chime. 

Share this post


Link to post
Share on other sites

Hi all,

I have the newest version of Prestashop running 1.6 I belive?   I am getting this same problem.    Just wandering if in 2015 there is a fix yet?


Thanks
 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest locen

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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??

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

How to fix this issue with the latest version of the Paypal module ? The file "expresscheckout.php" doesn't exist in my version.

Thank you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More