Well, i will continue my monolog and hope somebody is listening:
I have made the following test:
I have email logged zen_session_id() and $_SESSION['customer_id'] to see where the session information is lost.
It seems that the session id is always correct, however $_SESSION['customer_id'] is lost/changed somewhere along the way.
The customer id is correct last in the payment module's process_button() function. After here there is a browser redirect to the payment gateway address as it is given by form_action_url.
Now, upon return from the payment gateway (and some intermediate files which are isolated from Zen-store) posnet_merchant_return.php is called. As i mentioned earlier this is cloned and modified from ipn_main_handler.php.
In almost beginning of posnet_merchant_return.php application_top is included:
PHP Code:
/**
* Include custom application_top.php
*/
$show_all_errors = true;
$current_page_base = 'posnetoos';
$loaderPrefix = 'posnet_oos';
require('includes/application_top.php');
So, $_SESSION['customer_id'] is changed/lost right after that.
Is it possible to mess up logged in customer with application_top initalization?!
(There is also a posnet_oos.core.php file present in the auto_loaders folder, which only loads some extra functions in breakpoint 60!)
PHP Code:
/**
* Breakpoint 60.
*
* require('includes/init_includes/init_general_funcs.php');
* require('includes/init_includes/init_tlds.php');
*
*/
$autoLoadConfig[60][] = array('autoType'=>'init_script',
'loadFile'=> 'init_general_funcs.php');
$autoLoadConfig[60][] = array('autoType'=>'init_script',
'loadFile'=> 'init_tlds.php');
/**
* Include Posnet-specific functions
* require('includes/modules/payment/posnet/posnet_functions.php');
*/
$autoLoadConfig[60][] = array('autoType'=>'include',
'loadFile'=> DIR_WS_MODULES . 'payment/posnet/posnet_functions.php');
Bookmarks