Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Dec 2003
    Posts
    145
    Plugin Contributions
    0

    bug php 5.4+ missing payment type in $_SESSION on checkout_process

    When placing an order, all is well until the final step. Everything is in the $_SESSION array, but $_SESSION['payment'] is null. This causes a redirect to the home page with no explanation. I've dug through the code to try to find why this is, but am empty handed. I'd really appreciate if someone could at least point me in the right direction for solving this. TIA.

    From the top of modules/pages/checkout_process/header_php.php:
    Code:
    array (size=28)   'customers_host_address' => string 'localhost' (length=9)   'SESSION_USER_AGENT' => string 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:29.0) Gecko/20100101 Firefox/29.0' (length=81)   'cartID' => string '95231' (length=5)   'cart' =>      object(shoppingCart)[13]       public 'contents' =>          array (size=1)           5965 =>              array (size=1)               ...       public 'total' => float 9.9       public 'weight' => float 0       public 'cartID' => string '95231' (length=5)       public 'content_type' => string 'physical' (length=8)       public 'free_shipping_item' => int 0       public 'free_shipping_weight' => int 0       public 'free_shipping_price' => int 0       private 'observers' (base) =>          array (size=0)           empty   'navigation' =>      object(navigationHistory)[14]       public 'path' =>          array (size=3)           0 =>              array (size=4)               ...           1 =>              array (size=4)               ...           2 =>              array (size=4)               ...       public 'snapshot' =>          array (size=0)           empty       private 'observers' (base) =>          array (size=0)           empty   'language' => string 'english' (length=7)   'languages_id' => string '1' (length=1)   'languages_code' => string 'en' (length=2)   'check_valid' => string 'true' (length=4)   'currency' => string 'USD' (length=3)   'new_products_id_in_cart' => string '5965' (length=4)   'updateExpirations' => boolean true   'session_counter' => boolean true   'customers_ip_address' => string '::1' (length=3)   'customer_id' => string '1' (length=1)   'customer_default_address_id' => string '1994' (length=4)   'customers_authorization' => string '0' (length=1)   'customer_first_name' => string 'George' (length=6)   'customer_country_id' => string '223' (length=3)   'customer_zone_id' => string '56' (length=2)   'valid_to_checkout' => boolean true   'messageToStack' => string '' (length=0)   'cc_id' => string '' (length=0)   'order_number_created' => int 1739   '' => string 'c_ot_coupon' (length=11)   'sendto' => string '1994' (length=4)   'payment' => null   'shipping' =>      array (size=3)       'id' => string 'table_table' (length=11)       'title' => string 'Best Way (Table Rate)' (length=21)       'cost' => float 6
    Note: can't get that var_dump to format properly here. Just scroll all the way to the right to see the 'payment' key.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,513
    Plugin Contributions
    126

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    What payment method are you using?
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Dec 2003
    Posts
    145
    Plugin Contributions
    0

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    Quote Originally Posted by swguy View Post
    What payment method are you using?
    Authorize.Net AIM

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

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    Can't replicate on fresh install of ZC v1.5.1 using PHP 5.5.7

    Steps taken:
    1. Install fresh clean v1.5.1, including demo data
    2. Enable Authorizenet-AIM module via Admin, including gateway credentials
    3. Back to storefront, add an item to the cart
    4. Click Checkout, supply customer info, choose auto-selected cheapest shipping method, enter card details into AIM module fields, submit
    5. Arrive at checkout_confirmation screen
    6. Submit, payment is processed successfully.
    7. Edited checkout_process.php to var_dump($_SESSION) and repeated steps 3-6 above. Got payment=> 'authorizenet_aim' as expected.

    Here's a print_r() version of the var_dump:
    Code:
    Array
    (
        [securityToken] => 1fc3e319e7b6725a681cfa756340a3e8
        [customers_host_address] => localhost
        [cartID] => 80667
        [cart] => shoppingCart Object
            (
                [contents] => Array
                    (
                        [2:580a6355c0e0ed74cdb093b81ef4b530] => Array
                            (
                                [qty] => 1
                                [attributes] => Array
                                    (
                                        [3] => 6
                                        [4] => 3
                                    )
    
                            )
    
                    )
    
                [total] => 489.99
                [weight] => 23
                [cartID] => 80667
                [content_type] => physical
                [free_shipping_item] => 0
                [free_shipping_weight] => 0
                [free_shipping_price] => 0
            )
    
        [check_valid] => true
        [language] => english
        [languages_id] => 1
        [languages_code] => en
        [currency] => USD
        [today_is] => 2014-06-09
        [updateExpirations] => 1
        [session_counter] => 1
        [customers_ip_address] => 127.0.0.1
        [customer_id] => 2
        [customer_default_address_id] => 2
        [customers_authorization] => 0
        [customer_first_name] => redacted
        [customer_last_name] => redacted
        [customer_country_id] => 223
        [customer_zone_id] => 12
        [valid_to_checkout] => 1
        [sendto] => 2
        [payment] => authorizenet_aim
        [shipping] => Array
            (
                [id] => item_item
                [title] => Per Item (Best Way)
                [cost] => 2.5
            )
    
        [billto] => 2
        [cot_gv] => 0
        [comments] => 
    )
    What's different about your environment compared to a fresh brand new install without any plugins/mods?
    .

    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. #5
    Join Date
    Dec 2003
    Posts
    145
    Plugin Contributions
    0

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    Thanks. But, please try again with multiple payment types enabled: AIM, cod, Paypal.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    My test did have additional modules (the defaults of freecharger and moneyorder) enabled.
    Which specific paypal module are you referring to?
    In what ways does your dev site differ from original ZC v1.5.1 code?
    .

    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.

  7. #7
    Join Date
    Dec 2003
    Posts
    145
    Plugin Contributions
    0

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    I don't have the freecharger or moneyorder modules enabled. PayPal EC & IPN are. What I'm getting at is this conditional, which only kicks in when one payment module is enabled.

    https://github.com/zencart/zencart/blob/v151/includes/classes/payment.php#L84-L89


    I have a custom template and a handful of overrides. It may very well be my mods, but I've already dug through them and none of it sets
    Code:
    $_SESSION['payment'] = NULL; // or an equivalent
    As stated originally, I'd really like a point in the right direction, not just "it works on my box."
    Last edited by texdc; 10 Jun 2014 at 04:08 AM.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    Quote Originally Posted by texdc View Post
    As stated originally, I'd really like a point in the right direction, not just "it works on my box."
    Sigh. You seem to always hate my replies. Doesn't make me want to help you. I wish we could get past that. The purpose of my reply was NOT to crassly say "it works on my box". It was to engage you in discussion to understand more about exactly how *you* are triggering the scenario because it does appear to be environment-specific.
    .

    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.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    Quote Originally Posted by texdc View Post
    Thanks. But, please try again with multiple payment types enabled: AIM, cod, Paypal.
    Your earlier post specifically said you were only using AIM.
    Then when I replied saying I couldn't recreate the problem (using the limited information about your environment), you said to use more payment modules.
    And then when I asked for clarification about *which* PayPal module (again because of limited information in your post), you said you're getting at a conditional related to using only one payment module:
    Quote Originally Posted by texdc View Post
    I don't have the freecharger or moneyorder modules enabled. PayPal EC & IPN are. What I'm getting at is this conditional, which only kicks in when one payment module is enabled.
    Further, you state "PayPal EC and IPN are [enabled]". But, Zen Cart is specifically coded to *prevent* you from having both EC and Standard enabled at the same time (IPN being commonly referred to as the colloquial name for PayPal Standard).

    Either way, if this is indeed related to the code that specifically fires when only one payment module is enabled, I'm having trouble correlating that to the subject of your post: "php 5.4+ missing payment type in $_SESSION on checkout_process". I spent quite a bit of time investigating which PHP 5.4 issues could be causing it, and came up dry. Hence my earlier post asking for more information about your environment.
    .

    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.

  10. #10
    Join Date
    Dec 2003
    Posts
    145
    Plugin Contributions
    0

    Default Re: php 5.4+ missing payment type in $_SESSION on checkout_process

    What we have is a failure to communicate. As I've said, my problem here could very well be my code, but I've combed through it to no avail and was looking for direction.

    Now, I've disabled IPN and left EC enabled to see if there's a conflict there (even though it's not used) but the result is the same. So, are you able to debug the ZC code efficiently? If so, I'd really like to know how. Unit tests go a long way to preventing bugs and proving that things work not just on the dev's box. But, I'm not here to complain - though complaint is certainly justified. I just need help fixing a severe problem. If the only places where
    Code:
    $_SESSION['payment'] =
    occurs is ZC core (not my mods), then how can I assume that it's my code and not yours?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Having problem with order.php and checkout_process.php with OLD Zen Cart v1.2.3
    By wolfbane01 in forum Managing Customers and Orders
    Replies: 0
    Last Post: 28 Jul 2010, 01:56 AM
  2. Replies: 3
    Last Post: 10 Apr 2009, 10:37 PM
  3. PHP / $_SESSION help please
    By Jeff G in forum General Questions
    Replies: 2
    Last Post: 6 Oct 2008, 06:17 AM
  4. Checkout_process.php never displayed
    By mdorsey in forum Managing Customers and Orders
    Replies: 2
    Last Post: 18 Aug 2006, 04:08 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