Wow - this has been a busy thread.! Glad to see that some are taking note of this module. My apologies for any errors.
I'll try to cover the various points in order:
- MD5 coding error.
Oooops! Sorry - so that's why I couldn't get it to work. And here was me thinking my host hadn't set up the MD5 functions correctly.
I do apologise - but I did say in the installation notes that I had not tested it. And until now neither had anyone else!
- To 'SSL' or 'NONSSL'
The following is a quote from the installation notes included with the beta fileset:
- In the WorldPay admin screen click 'Configuration Options' for the installation i.d. (usually bottom of screen). Enter the Callback URL exactly as follows (including case):
https://<wpdisplay item="MC_callback">
N.B. If SSL is not enabled on your website the Callback URL should be:
http://<wpdisplay item="MC_callback">
Also in /includes/modules/payment/worldpay.php:
Un-comment out lines 134 & 135
Comment out lines 136 & 137
Since these notes were written WorldPay changed the way it handles test and live transaction - they are now directed to separate URLs rather than just relying on the 'Test Mode' value to direct the transactions appropriately. I therefore added the code at lines 53 to 60 to handle this. This moved the rest of the code down so the last two lines of the above should now read:
" Un-comment out lines 140 & 141
Comment out lines 142 & 143"
I think you will find that this works perfectly adequately - although Philip's method is more elegant.
I agree with Philip that it would be better to pick this up automatically but in my defence the default is SSL as this is how it should be configured. What is anyone doing passing customer name and address details insecurely over the internet! I don't make any apologies for making it difficult for someone to do this insecurely.
In any case I have limited time to support this module as it is.
'SSL' is not superfluous as this sets the path to the secure server which may not be the same as the path to the non secure server. The path to the secure server is set in the configure.php file. For some (those with their own security certificate) the two paths will be:
http://www.myserver.com
https://www.myserver.com
but for those using a shared security certificate the paths may well be:
http://www.myserver.com
https://secure.sharedserver.com/www.myserver.com
Just replacing 'http' with 'https' will not work.
- The Missing $zenId
It's not missing - I deliberately removed it. The session ID is passed to WorldPay as cartId - see lines 124 and 135. WorldPay pass this back along with callback URL. When the $zenId was included in the callback URL it got included twice. Now that is superfluous!
- Blank Obsolete Files
Now I never thought of that. Good idea - but what about those who are installing the module for the first time? They will end up with a lot of empty files on their server for no reason. I'll give it some thought before the next release.
LASTLY
Basically the module works out of the box if the installation instructions are followed. Don't muck about with the callback URL or try to set anything different from
"https://<wpdisplay item="MC_callback">" or
"http://<wpdisplay item="MC_callback">" if you must (but remember to make the code changes as per the installation instructions).
Implement the security features and welcome your customers to your store.
The most common problem people have is callback failure. My opinion is that this is invariably caused by the host server configuration. Ask your host if they maintain sessions. If they say 'No' or don't know - move to a host that does know and says 'Yes'. I have allowed several people with callback problems to test their sites on my server. In every case the module worked first time.
I hope I have covered everything and that this helps clarify things.
Thanks to all for your comments - especially for pointing out the error to the MD5 code. Obviously there is a need for the module out there or this thread would not be quite so long. It's nice to think that I might have been able to contibute in my own small and flawed way.
Regards to all,
Alan
workingIT.co.uk
working IT for business