Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Mar 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: HTTP 500 error on PayPal site

    Finally I find the error . It was a sentence in functions_taxes.php that is wrong and I still don't no why. If somebody have an idea it will be appreciate. The last sentence give me an error.( $tax is the value that cause the error. Strange because it was tested > then 0 before calling the las functions)
    Thanks.


    ////
    // Add tax to a products price based on whether we are displaying tax "in" the price
    function zen_add_tax($price, $tax) {
    global $currencies;

    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
    return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($price, $tax);
    } else {
    return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    }
    }

    // Calculates Tax rounding the result
    function zen_calculate_tax($price, $tax) {
    global $currencies;
    // $result = bcmul($price, $tax, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    // $result = bcdiv($result, 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    // return $result;
    return zen_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    }

  2. #12
    Join Date
    Feb 2010
    Posts
    13
    Plugin Contributions
    0

    Default Re: HTTP 500 error on PayPal site

    You have found that error since Feb 21st and still no fix ... I have the same for the last couple of days ...

    I hope someone figures this out ...

  3. #13
    Join Date
    Mar 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: HTTP 500 error on PayPal site

    The error was happening in the function_taxes.php and here is the change I made:

    Here what I change in function_taxes.php around line 170 (in bold)


    // Calculates Tax rounding the result
    function zen_calculate_tax($price, $tax) {
    global $currencies;
    // $result = bcmul($price, $tax, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    // $result = bcdiv($result, 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    // return $result;
    if ( (is_numeric($tax) == 'true') && ($tax > 0) ) {

    return zen_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    }
    }

  4. #14
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: HTTP 500 error on PayPal site

    I submit that the approach you've taken there will result in further problems if the $tax value is not numeric. Namely, what you've done there prevents *any* value from being returned, which means whatever asked for a tax calculation is going to get no results, thus resulting in incorrect calculations, and possibly even mismatched transaction/order amounts.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #15
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: HTTP 500 error on PayPal site

    Upon further investigation, the only reason for $tax not being numeric would be if you had entered non-numeric data for the tax rate when you set up your tax rates in your admin area.

    .. which begs the question. How exactly are your tax zones and tax rates set up?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #16
    Join Date
    Mar 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: HTTP 500 error on PayPal site

    Here are my taxe rate:

    Priority Tax Class Zone Tax Rate Action
    1 Taxable Goods Canada GST zone 5.0%
    1 Taxable Goods HST tax zone 13.0%
    2 Taxable Goods Quebec PST zone 7.5%
    1 Shipping Canada GST zone 5.0%
    2 Shipping Quebec PST zone 7.5%
    1 Shipping HST tax zone 13.0%
    Displaying 1 to 6 (of 6 tax rates)


    Taxe zone
    GEND: : Taxes & Zones Defined : Zones Defined but not Taxes : Not Configured
    Zone Name Zone Description Status Action
    Canada GST zone GST (except: NS,NB,NL)
    Florida Florida local sales tax zone
    HST tax zone NS,NB,NL
    Quebec PST zone PST( only when shipping to Quebec)
    Displaying 1 to 4 (of 4 tax zones) Page 1 of 1

    Notice that I had the problems only when returning from paypal. All taxes seams correct.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 PayPal iPN intermittant failure HTTP error 500
    By d0ugparker in forum General Questions
    Replies: 15
    Last Post: 18 Sep 2014, 07:59 AM
  2. v139f Shopping Cart error: HTTP Error 500 (Internal Server Error)
    By Tulameen in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2012, 01:48 AM
  3. HTTP Error 500
    By ABC123eef in forum General Questions
    Replies: 7
    Last Post: 14 May 2011, 06:29 PM
  4. HTTP 500 Error
    By Jace in forum General Questions
    Replies: 3
    Last Post: 6 Dec 2010, 02:33 AM
  5. HTTP 500 errors in Paypal IPN checkout??
    By BDCreations in forum Built-in Shipping and Payment Modules
    Replies: 45
    Last Post: 5 Jan 2008, 01:25 AM

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