Re: Callback problem between Zen Cart and WorldPay (Workaround follows)
After extensive testing, a terrific friend has confirmed the issue IS DEFINITELY the ZC session not existing for the WP call back... (the final thankyou page is actually called by the WP web server itself and sent to the user/browser. Thus, the request comes from a machine that has no active session).
The following is a workaround to the problem that my friend has worked out for me. It’s not perfect (i.e. not 100% elegant) but does the job. If Alan and others who have their hands in the code would like extra (lengthy) observations/diagnostics that drove this workaround just let me know and I’ll forward my friends notes. Hopefully a more elegant solution will be incorporated into a future release.
WORKAROUND:
Create an "interim hack page" that echoes the callback info before it gets dropped. In the description below the hack page is called ‘wpcallbackhack.php’.
Step 1. Make one mod in the system... in the file includes\modules\payment\worldpay.php --
Line:
Code:
zen_draw_hidden_field('MC_callback', $worldpay_callback[1]);
Now reads:
Code:
zen_draw_hidden_field('MC_callback', 'www.domain.com/store/wpcallbackhack.php?main_page=wpcallback' );
Step 2,. Place the hack page in the referenced directory. Suggest the the page includes an appropriate text message explaining what is happening so users don't get alarmed. (comfortably addresses concerns about credit card info being passed.) Go to http://www.justkiddintheatre.com/sto...llbackhack.php to see mine.
WP now calls the hack page... which then rebuilds the hidden form fields that WP would have posted in the call back... but we need to make the user click submit, so the request comes from the user's browser - which has an active session. Thus it works.
I will leave my WP in test mode for a few days if you want to see how it works in a real situation. www.justkiddintheatre.com/store
Hope this helps others out there.
Andrie
PS: Using ZenCart 1.3.8 with PHP 4.4.8
Bookmarks