I have just finished implementing this module on a w2k3 server, a few pointers that might save someone a few hours of head bashing:
-I had TS access to the box which is owned by my friend. If you are on a controlled host you might (i.e. will) struggle to get this running, consider giving up now depending what rights or how willing your hosting co is to help.
-copy the 2 .dll files (ccpitools.dll, cccpicom.dll) to \system32 directory and register both with regsvr32
-copy the executables (testhash.exe, CcOrderHash.exe) to a new directory cgi-bin off the root of your shop dir.
-Modify the $cmd in hsbc.php. I found I could not launch testhash.exe directly from PHP, instead I had to use CMD to call the testhash.exe:
Code:
$path = "cmd /c \"\"d:\\domains\your-domain.whatever\wwwroot\shop\cgi-bin";
putenv("LD_LIBRARY_PATH=$path");
//Executes the TestHash to get the hash
$cmd="$path\TestHash.exe\" \"".MODULE_PAYMENT_HSBC_HASH."\" $cmd\"";
You need to change the access rights on \system32\cmd.exe, add the user account that your website is running as under IIS. (You see why some hosts will get twitchy.)
-I also found the timestamp was returning in scientific notation, I got round this by using a slightly different time routine in php:
Code:
// POST time
//$time = time();
// Change the 0 if your server is located at a different GMT time
//$time = ( $time + ( 0 * 3600) );
//$time = $time * 1000;
$timenew= mktime ();
$time = $timenew . '000';
-I also had to hard code the currency. For some reason it was returning a US currency code, I'm not sure where it was picking this up from, but for me as a quick hack I just hard coded it as we are not going to be taking foreign currencies in the near future:
Code:
$currency_code = 826;
It took a bit of troubleshooting to get this far, if you have problems it is worth enabling some kind of troubleshooting - I wrote the $cmd to a file so I could see exactly what data was being used to create the hash.
I've now just got to get live mode enabled on Monday and we should be ready to go, at long last!