Forum Moderators: coopster
testhash.e HASHKEY "Monkey"
Into the command line. However, I've just spent 20 minutes chasing a bug (yes - we just got our Hash Key - huzzah!)... I had entered a '0' instead of a 'O'. Note that, in the letter they send with the HashKey - if the 0 has no dot in the middle, it's a capital 'o'. If it has a dot in the middle, it's numeric. Something to check...
Did you Telnet in or SSH to your domain and run the TestHash.e file from the command line?
Im using Putty and SSH'd in. I went to the directory the TestHash file was in and typed the command you entered in above. It then said TestHash.e command not found.
Something im doing wrong?!
Luigi
I have been reading through these posts many times now, but I still cannot find a solution to the simple Order Hash generation problem.
Could someone be so kind to post the complete code to generate the Order Hash. Would you also please tell me where to put the libraries, either .e or .so?
We have a Linux Fedora 2 server, with Apache. Have copied (for now) the TestHash.e into the main www directory and ccLib.so into /lib. But if we execute the following code, nothing happens.
A complete example would be really appreciated.
Kind regards, Cristiano
$args = ('
"GBP" "1092082969" "https://www.mysite.com/confirm_process.php" "https://www. mysite.com/resultpost.cgi" "12345670000GBP" "Online purchase from mysite.com" "7150" "826" "Auth" "User00000001" "T" "1b300dad0c100197b109058627d47251"
');
$path='/var/www/html';
$cmd= $path.'/TestHash.e '.$args;
$ret=exec($cmd);
$ret=split(':',$ret);
Returns the hash
$hash=trim($ret[1]);
echo $hash;
1./ Have you installed 'libCcCpiTools.so' into your '/lib' directory?
2./ After you have uploaded the file, you will need to 'chmod' it to make it executable. Just run 'chmod ug+x TestHash.e' from SSH when you're in the directory containing the file.
3./ You may have to access the command using './TestHash.e' instead of just 'TestHash.e'. You should then be able to run './TestHash.e HASHKEY "Monkey"' and it should produce a (useless) orderHash. (Obviously, putting your actual hashKey instead of HASHKEY).
.
Cristiano
I would suggest trying to get it to run as above before trying to integrate it with PHP. I would advise logging into your server with SSH, and getting it to run OK on the command line.
The .so file is the library, and should be installed into your lib directory (as you have done). The .e file is just the executable - so that can be anywhere you like - but you will need it somewhere 'handy' so you can call it from your scripts. '/var/www/bin' or anywhere will do.
Also - I think there is a problem with how you are sending the parameters to the file in your code. I don't see your hashKey being sent to the program...
$hashKey = "32DigitHashKey";
$cmd = "/var/www/bin/TestHash.e $hashKey $args";
.
The PHP Module...
...Seems to work fine! I've only compiled it on a windows machine at the moment though, and will try to compile it for Linux remotely on my production server so that you guys can use it. Naturally, full source will be supplied (and you would be advised to compile it for yourself)
thanks for the detailed reply :-) We are getting somewhere. I have done as you described, but if I run ./TestHash.e I now get this error message:
./TestHash.e: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory
Now, what is this library. The other one (/lib/libCcCpiTools.so) is correctly installed and chmoded to ug+x
Any clue?
Thanks Cristiano
Fedora still uses 'rpm' and 'up2date' I presume? If so, then you might want to try running;
up2date compat-libstdc++
ldconfig
Be warned though - if your system still needs the standard C++ libraries installing, there could be a lot of packages that need installing as dependencies - so the process might take a while. It might also take up a lot of disk space (is it your server? / is your space limited?). Of course, it might not, but I have a feeling it will install a bunch of gcc/g++ stuff too.
After installing these libs, TestHash.e should be happy!
As for my own php_hsbccpi module - it's not compiling quite right under linux at the moment, so I'll have to have a play when I'm not at work. Still, hopefully soon!