Page 6 of 8 FirstFirst ... 45678 LastLast
Results 51 to 60 of 80
  1. #51
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

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

    Quote Originally Posted by need_help View Post
    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.

  2. #52
    Join Date
    Feb 2009
    Posts
    210
    Plugin Contributions
    0

    Default Re: Checkout Error code 10413....

    Quote Originally Posted by DivaVocals View Post
    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.

  3. #53
    Join Date
    Dec 2007
    Posts
    10
    Plugin Contributions
    0

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

  4. #54

    Default Re: Checkout Error code 10413....

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

    Code:
        // 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.


    Quote Originally Posted by packet8bit View Post
    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

  5. #55

    Default 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:
    Code:
    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...
    Last edited by jabbah; 27 Aug 2009 at 11:31 AM.

  6. #56

    Default 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
    PHP Code:
    //// 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!

  7. #57

    Default Re: Checkout Error code 10413....

    So the quick and dirty fix replace around line 536

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

    PHP Code:
    //// 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:

    Code:
    Description: 
    Unit price: 60.70 EUR
    Qty: 1
    Amount: 60.70 EUR
    
    
    Subtotal : 60.70 EUR
    
    Total: 60.70 EUR
    
    Payment: 60.70 EUR

  8. #58
    Join Date
    Jan 2005
    Posts
    20
    Plugin Contributions
    0

    Default Re: Checkout Error code 10413....

    Duplicate post removed by moderator.

    See here: http://www.zen-cart.com/forum/showth...125#post778125
    Levi Senft

  9. #59
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Checkout Error code 10413....

    Quote Originally Posted by lsenft View Post
    Duplicate post removed by moderator.

    See here: http://www.zen-cart.com/forum/showth...125#post778125
    So this fix applies to the PayPal Express module only correct?? (paypalwpp.php)
    Last edited by DivaVocals; 6 Sep 2009 at 02:30 AM.

  10. #60
    Join Date
    Nov 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Checkout Error code 10413....

    At the risk of saying "me, too!", but wanting to make as many comments with an answer I think is correct, I will agree with what is said below. Looking at the logs in detail shows that the AMT was being set correctly for orders over $1,000, but then was not being sent correctly to DoExpressCheckoutPayment (there the AMT was set to 1.0, which caused the 10413 error of totals not matching). Changing the code like below worked for me. I took a quicker, dirtier route since according to the PayPal documentation the comma separator is optional, I just removed the number_format alltogether from the DoExpressCheckoutPayment parameters.

    Line 535 of paypalwpp.php:

    Code:
          $response = $doPayPal->DoExpressCheckoutPayment($_SESSION['paypal_ec_token'],
                                                          $_SESSION['paypal_ec_payer_id'],
                                                          (isset($options['AMT']) ? $options['AMT'] : $order_amount),
                                                          $options);
    Good luck,
    Todd

    Quote Originally Posted by packet8bit View Post
    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

 

 
Page 6 of 8 FirstFirst ... 45678 LastLast

Similar Threads

  1. v153 PayPal 10413 failure code but order is completed
    By RixStix in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 20 Aug 2014, 12:30 AM
  2. [Done v1.5.0] Payment Error Code 10413
    By Aziph in forum Bug Reports
    Replies: 0
    Last Post: 10 Feb 2011, 01:07 PM
  3. Replies: 32
    Last Post: 2 Oct 2010, 10:23 PM
  4. PayPal Express Checkout Error (10413)‏
    By Easyp in forum PayPal Express Checkout support
    Replies: 2
    Last Post: 14 Feb 2010, 06:12 AM
  5. Checkout error code
    By NicholeAnn in forum Managing Customers and Orders
    Replies: 10
    Last Post: 10 Sep 2007, 06:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR