Update to all interested in the broken callback issue.
I was personally satisfied with the workaround I previously posted for my purposes but my friend has since produced a more elegant solution that I'm extremely pleased with (and works beautifully on my site). I'm forwarding below his note to me that describes what he did. Again, I will leave my worldpay part in test mode for a day or so for others to look at if they like.
=======Notes from Steve==========
-
I am sort of understanding the ISP PHP session issue thing a bit... while the ZC settings are to store sessions in the db... this does not store the ENTIRE session in the db, ZC still stores some values in memory. PHP has the capability to allow "transient" sessions... if your browser passes in a valid session id, you can have your program "connect" you back to your current in-memory session.... In my mind, quite a serious security issue -- but none-the-less, the functionality is there. It may be the case the some ISPs disable the functionality in PHP through the runtime config.
-
That said, there is no reason why a session can't be reconstituted on the fly... if you know what the session vars&vals were before, just re instantiate them... Fortunately, there is a method in PHP to allow this to occur fairly easily. So this is what i did - knowing that transient sessions were not possible on your server.... the real effective changes meant only adding one line to worldpay.php and one line to tpl_wpcallback_default.php. I changed just one more line in tpl_wpcallback_default.php to clean up a "Continue" button issue.
In worldpay.php, I inserted the line "zen_draw_hidden_field('MC_zcsession', session_encode()) ." in the code block that write the final confirm form before sending you off to world pay.
From this:
```
$process_button_string .=
zen_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_TEST_MODE) .
zen_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .
zen_draw_hidden_field('address', $address) .
zen_draw_hidden_field('postcode', $order->customer['postcode']) .
zen_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
zen_draw_hidden_field('tel', $order->customer['telephone']) .
zen_draw_hidden_field('myvar', 'Y') .
zen_draw_hidden_field('fax', $order->customer['fax']) .
zen_draw_hidden_field('email', $order->customer['email_address']) .
zen_draw_hidden_field('lang', $_SESSION['languages_code']) .
zen_draw_hidden_field('MC_callback', $worldpay_callback[1]);
To this:
$process_button_string .=
zen_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_TEST_MODE) .
zen_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .
zen_draw_hidden_field('address', $address) .
zen_draw_hidden_field('postcode', $order->customer['postcode']) .
zen_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
zen_draw_hidden_field('tel', $order->customer['telephone']) .
zen_draw_hidden_field('myvar', 'Y') .
zen_draw_hidden_field('fax', $order->customer['fax']) .
zen_draw_hidden_field('email', $order->customer['email_address']) .
zen_draw_hidden_field('lang', $_SESSION['languages_code']) .
zen_draw_hidden_field('MC_zcsession', session_encode()) .
zen_draw_hidden_field('MC_callback', $worldpay_callback[1]);
This converts the current session vars&vals to a string, and sends them over to WP in a custom field which WP will send back in it connection back to ZC.
Then in tpl_wpcallback_default.php, I had to grab that session string, and reconstitute the session manually before additional processing by the server. My code is added before any other code in the file, right after the comment:
// get values from WorldPay response - see <http://support.worldpay.com/kb/customising3/paymentpageeditor.html>
Inserted code:
if(isset($_POST['MC_zcsession'])) {session_decode(str_replace('"', '"', $_POST['MC_zcsession']));}
Now, there is a slight side effect in this fix, and that is upon WPs call back to ZC, you end up getting logged out. I suspect that this is because I am attempting to reconstitute the session AFTER the native ZC session init code runs. Since the session init code runs before my code, it results in ZC thinking that the user is not logged in... This results in odd behaviour if the user clicks "My Account" link or the "Continue" button from the confirmation page....they see "Ooops, session timed out, please log in"....
I resolved two issues with the Continue button on the final confirmation page... first, I converted it to a simple link, instead of a form submit -- this got rid of the "Warning:..." message given to the user since in this case they are submitting from a secure page at WP to a non-secure one on your site. The second issue was the re-login issue... to fix that, I just repointed the Continue link to the top of the store site... where you do not need to be logged in. If the user then wants to buy more, or check their account... they would have to log in again, but i would say that this will be far fewer users... and it won't seem so bad since they are now fully out of the purchase stream.
The fix for the continue link changes code from:
<?php
echo zen_image_submit(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT);
?>
To:
<?php
echo '<a href="' . zen_href_link('/', '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>';
?>
So... while this is not 100% PERFECT... it alleviates that nasty interim "Click to Continue" page....and I think is nearly perfect enough to satisfy your needs.