Forums / PayPal Express Checkout support / Checkout Error code 10413....

Checkout Error code 10413....

Locked

Views: 36,433

Results 41 to 60 of 82
This thread is locked. New replies are disabled.
14 Jun 2008, 4:33 AM
#41
crisand avatar

crisand

New Zenner

Join Date:
Feb 2008
Posts:
39
Plugin Contributions:
0

Checkout Error code 10413....

Hi again,
Sorry it is definitely to do with the tax, which by law we need to display, so this is not good. Any further ideas out there?

14 Jun 2008, 4:55 AM
#42
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,684
Plugin Contributions:
0

Re: Checkout Error code 10413....

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

4 Nov 2008, 10:07 AM
#43
paradisefun avatar

paradisefun

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: Checkout Error code 10413....

WORKS!!!!! :clap:

5 Nov 2008, 7:15 PM
#44
tropheus avatar

tropheus

New Zenner

Join Date:
Jun 2004
Posts:
25
Plugin Contributions:
0

Re: Checkout Error code 10413....

Hi ParadiseFun,

Please let us know what you did to make it work?

10 Nov 2008, 12:21 PM
#45
candleman avatar

candleman

Zen Follower

Join Date:
May 2008
Posts:
183
Plugin Contributions:
0

Re: Checkout Error code 10413....

I have tried making the same change and it messes up my Admin/payment page (all the right hand side goes missing).

The error I get seems to be linked with the handling amount.
I have 0 handling set in all my shipping but it still adds .15 to my handling amount as well as my Tax amount.

Request Parameters: {DoExpressCheckoutPayment} Array (
[ITEMAMT] => 1.00
[HANDLINGAMT] => 0.15
[SHIPPINGAMT] => 0.00
[TAXAMT] => 0.15
[AMT] => 1.00

The cost should be £1 including vat (0.85 plus 0.15)

https://www.candlewithcare.co.uk
Luxury Scented
Candles at great prices!

12 Nov 2008, 8:05 AM
#46
paradisefun avatar

paradisefun

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: Checkout Error code 10413....

Tropheus:

Hi ParadiseFun,

Please let us know what you did to make it work?

I did this:

Kim:

Try this thread - http://www.zen-cart.com/forum/showthread.php?t=97762

Update: To apply this patch without using the patch command, follow these steps:

  1. Backup your files, database, and everything else that matters
  2. Make a copy of includes/modules/payment/paypalwpp.php and call it includes/modules/payment/paypalwpp.php.orig
  3. Edit the file includes/modules/payment/paypalwpp.php
    at line 1446 add this code:
    if (DISPLAY_PRICE_WITH_TAX == true)
    $optionsST['ITEMAMT'] -= $optionsST['TAXAMT'];
    I've included a copy of just this code in the attached file, I recommend copying & pasting it from there, so the indentation is correct.
  4. Save the file, enjoy :)
    And works in my shop
18 Nov 2008, 11:37 AM
#47
hevvieevvie avatar

hevvieevvie

New Zenner

Join Date:
Sep 2008
Location:
Perth, Australia
Posts:
28
Plugin Contributions:
0

Re: Checkout Error code 10413....

Hi guys,

i have applied the patch as per http://www.zen-cart.com/forum/showthread.php?t=97762
and is working fine BUT. if i put any transactions though for $2000 or more it comes up with the 10413 error.

please help!!!!!

running on v1.3.8a, with no vouchers discounts etc.

logs attached.Attachment #4841

28 Nov 2008, 3:04 PM
#48
sbeynon avatar

sbeynon

New Zenner

Join Date:
Nov 2008
Posts:
2
Plugin Contributions:
0

Re: Checkout Error code 10413....

Hey Guys,

Not sure if you have found a solution yet but here is one that worked for me when all the others failed or created more problems.

http://www.zen-cart.com/forum/showpost.php?p=620111&postcount=22

Hope it works.

14 Jan 2009, 12:15 AM
#49
packet8bit avatar

packet8bit

New Zenner

Join Date:
Dec 2008
Posts:
1
Plugin Contributions:
0

Re: Checkout Error code 10413....

I believe the problem lies in this line in the file:
/includes/modules/payment/paypalwpp.php

  $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
                                                  $_SESSION['paypal_ec_payer_id'],
                                                  number_format((isset($options['AMT']) ? $options['AMT'] : $order_amount), 2),
                                                  $options);

The value of $options['AMT'] may already contain a formatted string such as 1,050.99. In the line above, it is formatted again by the number_format function which may now result to a truncated value of 1. This causes a mismatch now with the original value which should still be 1050.99. This may not affect values less than 1000.

To fix, I changed the above code to:

  if (isset($options['AMT']))
  {
	  $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
													  $_SESSION['paypal_ec_payer_id'],
													  $options['AMT'],
													  $options);
  }
  else
  {		
	  $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
													  $_SESSION['paypal_ec_payer_id'],
													  number_format($order_amount, 2),
													  $options);
  }

Hope that helps!

packet8bit
:cool:

3 Jul 2009, 4:49 PM
#50
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Checkout Error code 10413....

My old store works perfectly with Zen Cart.

Setting up a new store zen cart 1.38a and ran into this problem with PayPal Express Checkout.

Fixed it without editing any files.

Basically i needed Shipping, Sub Total and Order Total all switched on in the admin/ order total section.

If even one was switched off i would get the PayPal error.

Now it's working perfectly.

So i would recommend people try switching the shipping - ot_shipping, sub total - ot_subtotal and the order total - ot_total all on and see if that helps with the problem as it fixed mine.

3 Jul 2009, 5:32 PM
#51
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Checkout Error code 10413....

need_help:

My old store works perfectly with Zen Cart.

Setting up a new store zen cart 1.38a and ran into this problem with PayPal Express Checkout.

Fixed it without editing any files.

Basically i needed Shipping, Sub Total and Order Total all switched on in the admin/ order total section.

If even one was switched off i would get the PayPal error.

Now it's working perfectly.

So i would recommend people try switching the shipping - ot_shipping, sub total - ot_subtotal and the order total - ot_total all on and see if that helps with the problem as it fixed mine.If you read through all of the threads related to this error you will see that this is not the issue at all.. If it was that simple, I think it would have been resolved LONG ago..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Jul 2009, 6:47 PM
#52
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Checkout Error code 10413....

DivaVocals:

If you read through all of the threads related to this error you will see that this is not the issue at all.. If it was that simple, I think it would have been resolved LONG ago..

Explain to me why i was getting the exact error message others have wrote about on this page and i tried EVERYTHING to fix the issue.

Nothing worked.

I switched on those modules ( one was already switched on but i switched other two on ) After switching those modules on everything is perfect.

Now it's no coincidence my other Zen Cart store which incidentally i set up a year and a half ago has always worked perfectly with PayPal and it has always had those 3 things switched on.

So perhaps it won't be a fix for other people's problems but don;t come here and tell me it isn't that simple.

Because it was that simple for me.

I have read the thread you know and spent about eight hours trying to fix the issue today before stumbling across a fix for myself so while you may not think it's simple it certainly seemed a simple fix for me.

3 Jul 2009, 9:18 PM
#53
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Checkout Error code 10413....

IMO, if you read through the other threads it's kind of clear when you read the posts that it's unlikely that anyone with the problem has any of the order total modules switched off.. If your are offering shipping it's only logical that you would turn on the shipping order total module, the subtotal order total module should be turned on if the final total the customer is paying includes other charges (shipping, taxes, low order fees, etc)

It's possible that turning on the order total modules you had turned off along with one of the posted fixes resolved your problem.. Hard to say since I can't see your code.. I can't tell you why turning on the order total modules solved your problem anymore than I can tell you why not everyone has this issue. (I only have ONE client with the error and his settings are NOT different than any other Zen Cart I have setup) I can tell you this.. My client still periodically gets the error, and we have all but one order total module inactive (COD Fee), and one of the fixes in place.

My point was the answer is likely NOT as simple as you state since there are NUMEROUS threads on this topic, and I haven't yet seen a SIMPLE solution to the problem..

need_help:

Explain to me why i was getting the exact error message others have wrote about on this page and i tried EVERYTHING to fix the issue.

Nothing worked.

I switched on those modules ( one was already switched on but i switched other two on ) After switching those modules on everything is perfect.

Now it's no coincidence my other Zen Cart store which incidentally i set up a year and a half ago has always worked perfectly with PayPal and it has always had those 3 things switched on.

So perhaps it won't be a fix for other people's problems but don;t come here and tell me it isn't that simple.

Because it was that simple for me.

I have read the thread you know and spent about eight hours trying to fix the issue today before stumbling across a fix for myself so while you may not think it's simple it certainly seemed a simple fix for me.

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Jul 2009, 9:42 PM
#54
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Checkout Error code 10413....

DivaVocals:

IMO, if you read through the other threads it's kind of clear when you read the posts that it's unlikely that anyone with the problem has any of the order total modules switched off.. If your are offering shipping it's only logical that you would turn on the shipping order total module, the subtotal order total module should be turned on if the final total the customer is paying includes other charges (shipping, taxes, low order fees, etc)

It's possible that turning on the order total modules you had turned off along with one of the posted fixes resolved your problem.. Hard to say since I can't see your code.. I can't tell you why turning on the order total modules solved your problem anymore than I can tell you why not everyone has this issue. (I only have ONE client with the error and his settings are NOT different than any other Zen Cart I have setup) I can tell you this.. My client still periodically gets the error, and we have all but one order total module inactive (COD Fee), and one of the fixes in place.

My point was the answer is likely NOT as simple as you state since there are NUMEROUS threads on this topic, and I haven't yet seen a SIMPLE solution to the problem..

All i can really say is i never applied any html fixes.

I tested about 8 times and it failed each time.

I read this thread and was going to try the html fix suggested in it but before i did that i decided to have a look at my shipping module section and changed a few settings which should have been on to begin with.

Now i don't get the issue.

Just keeping my fingers crossed and will test it a lot more over the next few weeks.

I do still have to upgrade my PayPal and alter the two lines of code for the changes this year which DrByte has printed somewhere in the forum.

Is it at all possible these changes are causing some issues ?

I just ask because i haven't changed and updated the PayPal module and changed the two snippets of code just yet but will soon.

It's possible my issue was just the shipping order total or sub total being accidentally switched off as i'm just building the store and testing at the moment.

Anyways it certainly is a problem and i wasn't trying to make light of it - Just saying i got the exact same error message but now it seems fine.

24 Jul 2009, 12:20 AM
#55
jim_cushman avatar

jim_cushman

New Zenner

Join Date:
Dec 2007
Posts:
10
Plugin Contributions:
0

Re: Checkout Error code 10413....

Still coming up with this error. Store seemed to work flawless for months upon end...now i'm getting the error for a majority of the orders...and haven't changed a thing in the store. :(

27 Aug 2009, 10:20 AM
#56
jabbah avatar

jabbah

New Zenner

Join Date:
Aug 2009
Posts:
12
Plugin Contributions:
0

Re: Checkout Error code 10413....

Indeed its correct that all values in $options have already been run through number_format:

    // tidy up all values so that they comply with proper format (number_format(xxxx,2) for PayPal US use )
    if (!defined('PAYPALWPP_SKIP_LINE_ITEM_DETAIL_FORMATTING') || PAYPALWPP_SKIP_LINE_ITEM_DETAIL_FORMATTING != 'true') {
      if (is_array($optionsST)) foreach ($optionsST as $key=>$value) {
        $optionsST[$key] = number_format(abs($value), 2);
      }
      if (is_array($optionsLI)) foreach ($optionsLI as $key=>$value) {
        if (strstr($key, 'AMT')) $optionsLI[$key] = number_format(abs($value), 2);
      }
    }

You can also see that all values are set to positive with abs. This doesn't make any sense because the totals just dont add up this way hence the code 10413.

packet8bit:

I believe the problem lies in this line in the file:
/includes/modules/payment/paypalwpp.php

  $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
                                                  $_SESSION['paypal_ec_payer_id'],
                                                  number_format((isset($options['AMT']) ? $options['AMT'] : $order_amount), 2),
                                                  $options);

The value of $options['AMT'] may already contain a formatted string such as 1,050.99. In the line above, it is formatted again by the number_format function which may now result to a truncated value of 1. This causes a mismatch now with the original value which should still be 1050.99. This may not affect values less than 1000.

To fix, I changed the above code to:

  if (isset($options['AMT']))
{
    $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
  												  $_SESSION['paypal_ec_payer_id'],
  												  $options['AMT'],
  												  $options);
}
else
{		
    $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
  												  $_SESSION['paypal_ec_payer_id'],
  												  number_format($order_amount, 2),
  												  $options);
}

Hope that helps!

packet8bit
:cool:

27 Aug 2009, 10:27 AM
#57
jabbah avatar

jabbah

New Zenner

Join Date:
Aug 2009
Posts:
12
Plugin Contributions:
0

Re: Checkout Error code 10413....

I think this particular beast has many aspects. It surprises me that the code for just putting in the sums is very complicated. Can we not just rely on the Order Totals modules?

Here is the log output for my particular order:

Aug-27-2009 02:58:17
getLineItemDetails 1
Order Subtotal does not match sum of line-item prices. Line-item-details skipped.
24.81 20.8491
=================================

Aug-27-2009 02:58:17
getLineItemDetails 2
Tax Subtotal does not match sum of taxes for line-items. Line-item-details skipped.
3.4 3.96
=================================

Aug-27-2009 02:58:17
getLineItemDetails 3
LineItemDetails: 
Details:Array
(
    [ITEMAMT] => 24.81
    [HANDLINGAMT] => -6.91
    [SHIPPINGAMT] => 21.96
    [TAXAMT] => 3.4
    [AMT] => 43.26
)

I have Display Tax set to true so you can see here that the module is getting confused. Tax rate is 19%. Also it is adding tax to the shipping, but the shipping value already includes tax! I'm not sure where the TAXAMT 3.4 comes from. This should be 3.9 as the module calculates correctly itself. The -6.91 is actually my tax value! Somewhere before 'getLineItemDetails 3' we have to reconsider the code I beleive...

27 Aug 2009, 3:23 PM
#58
jabbah avatar

jabbah

New Zenner

Join Date:
Aug 2009
Posts:
12
Plugin Contributions:
0

Re: Checkout Error code 10413....

I have been working all day on some workarounds. The order does go through now, but when examingen the logs things are not yet in order.

I have figured though that to do this correctly you need to calculate all values excluding tax and put all the tax in TAXAMT.
If DISPLAY_PRICE_WITH_TAX=true then you need to remove the tax from the amount of the items, shipping and other order_totals modules.
Next to that you need to handle the credits properly. For instance by substracting it first from the items, if that is gone to 0, substract the rest from shipping, handling, etc. Till all credits are used. The key here is to not have anything go negative. But wat about credits and tax?

I am running out of time to do this correctly so I am going with just putting the total amount into paypal (thats all that shows in the express checkout anyway!) by unsetting all but $options['AMT']

For those who would like to continue the work that I have done, I have attached the paypal express module.

I have put the comments

//// bof --> 10413 fix 2008-08-27 jabbah.co.cc

around my changes
HANDLINGAMT should never be negative!

PS rename your old file to paypalwpp.orig.php or something and keep it as a local backup copy. You probably will need to remove it from your server and put this file in its place.

Good luck!

27 Aug 2009, 3:41 PM
#59
jabbah avatar

jabbah

New Zenner

Join Date:
Aug 2009
Posts:
12
Plugin Contributions:
0

Re: Checkout Error code 10413....

So the quick and dirty fix replace around line 536

$response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
                                                      $_SESSION['paypal_ec_payer_id'],
                                                      number_format((isset($options['AMT']) ? $options['AMT'] : $order_amount), 2),
                                                      $options);

with

//// bof --> 10413 fix 2008-08-27 jabbah.co.cc - do not put $options['AMT'] through format
      if (!defined('PAYPALWPP_SKIP_LINE_ITEM_DETAIL_FORMATTING') || PAYPALWPP_SKIP_LINE_ITEM_DETAIL_FORMATTING != 'true'){
        $order_amount_fmt = number_format($order_amount,2);
      }
      else{
        $order_amount_fmt = $order_amount;
      }

      $total = isset($options['AMT']) ? $options['AMT'] : $order_amount_fmt;
      
      //// forget about it! just put in the total!
      unset($options['TAXAMT']);
      unset($options['SHIPPINGAMT']);
      unset($options['HANDLINGAMT']);
      $options['ITEMAMT'] = $total;

      $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
                                                      $_SESSION['paypal_ec_payer_id'],
                                                      $total,
                                                      $options);
//// eof --> 10413 fix 2008-08-27 jabbah.co.cc

Your PayPal receipt will look like this even though the order was made with multiple items:

Description: 
Unit price: 60.70 EUR
Qty: 1
Amount: 60.70 EUR


Subtotal : 60.70 EUR

Total: 60.70 EUR

Payment: 60.70 EUR