Work and HSBC Payment Processor
Thu, 29 March, 2007 – 8:06 pm
I've been a bit quiet this week mainly because it's possibly turning out to be one of the busiest weeks of the year for me. I currently have 5 sites underway for work. Luckily they are all similar and can run off the same template files for both style as well as PHP, however it's still fun and games trying to get everything working, especially as I'm still waiting on content and photos and these were meant to be live by the weekend! However on the up side I've had 3 calls today alone from my boss pretty much saying how thankful he is of what I've done. Sometimes it's good to hear that from someone so high up.
In between working on these sites I've also been tackling the HSBC Payment Processor for secure ePayments. A client of mine has a site which was coded a couple of years back by some PHP developers that didn't understand efficiency let alone security! So I've been trying to learn the logic of their shopping cart plus learn how to get the HSBC CPI working - a feat in itself. The PDF supplied by HSBC was of pretty much no help whatsoever. In the end I downloaded the HSBC Payment module for osCommerce, installed this on a test site I have running for testing contributions, and got it working via osCommerce first. Then using the excellent write up on how the module works, I stripped the code down to run standalone. 6 hours of then trying to get that to work, and discovering, thanks to Khalid, that the hash key I'd been supplied had two letters in the incorrect case. The version I'd used on osCommerce had the hash key correct (client's fault for supplying a wrong key). After tearing my hair out all Tuesday, I've now finally gotten all of the code working, so I'm just tying up the final bit which updates the order details.
I feel I've accomplished a fair bit this week!


4 Responses to “Work and HSBC Payment Processor”
I also had major issues with the HSBC system so i wrote this integration guide:
http://www.leadingedgewebsites.....linux.html
By Chris on Apr 2, 2007
Hey Chris, thanks for your link. Wasn't the way I ended up doing it but hopefully it'll help out someone else
By Sarah on Apr 2, 2007
What's so particularly bad about HSBC payment processing? I recently fired a client who was with HSBC. We didn't get far enough into the project for me to find out what the interface was like.
By Will on Apr 3, 2007
Well. The instructions that you get simply give you 3 executable files and a sample html file, plus a dll library which you host has to install if it's not already on your server.
The instructions get you to edit the sample.html file and simply upload it, upload the executables, put your hash key in a text file and then run the sample file, which is a form that you submit. In theory the form is then meant to execute one of the files, generate a hash key and send you off to HSBC. Well when that first and only offering didn't work for me I then had to turn to the web to find the answer.
I've worked with several payment processors and have always had good, well written information on how to get them working. Protx supplies files for most popular scripts, WorldPay uses posts to and from the web site, PayPal again, simply forms and then posts to the server. Even Nochex supplied a link through to the cURL script you need to use. But HSBC? Nothing, nada. I'm impressed with the person who wrote the osCommerce HSBC module as he clearly researched it all in great detail. I couldn't find any other information on their site (although I did discovered a cheaper business account which I switched to!).
It probably wouldn't have been so bad for me had my client not supplied two hash keys, the first I used in my osCommerce test installation and worked, the second I used for my standalone attempt and didn't work. I then assumed it was my attempt to hack the osc module and not the fact that the hash key was simply incorrect.
Getting about 6 lines of code working to generate a hash key to in theory send to HSBC, took longer than the rest of the work!
By Sarah on Apr 4, 2007