This year has been a real eye opener for the development team at Webanet. We had never worked with HSBC’s ePayments system before due to hearsay regarding bad experiences from other developers and users of the systems. But having had the opportunity to integrate both the ePayments CPI and ePayments API into new websites this year, we now see the HSBC ePayments systems are rather good, at least once integrated and running.
HSBC ePayments CPI PHP Integration
As luck would have it, our first ecommerce website was to integrate with the ePayments CPI (Cardholder Payment Interface) which sounded the easier of the two to get up and running. HSBC provided a plethora of PDF documents including an ePayments integration guide and reference document. However this was the area where I had heard bad things, that HSBC documentation was not not going to win any awards for attention to detail for exampl. While I can agree that the documents may seem quite woolly to the uninitiated developer, I did feel it gave us enough information to understand the system and find our way around quite quickly.
I was wrong in my expectations that the CPI would be easier to integrate than the ePPayments API however, since the CPI required the installation of an HSBC specific library file, in my case a “LibCcCpiTools.so” which did require the installation and update of certain required Linux libraries to get working. While this was pretty straightforward to do, it was not something I expected to have to do with the CPI version. The documentation provided me with all I needed to verify that the library was working and then began planning a HSBC ePayments PHP class to make life easier when integrating with the website front end.
During tests, there are a few things that can catch you out, especially related to the setting of the mandatory variables for currency types and the like, and also with the test mode since that does rely on certain order characteristics to be met for it to successfully go through as a test payment, none of which is documented very well. For the test orders, you can user a set of test credit card details which can simulate a real transaction and allow to you follow the progress of a real order through the system.
Overall, the integration was not as easy as some other payment systems we have used, but it was nowhere near as difficult as I had expected from my preliminary research. The library files that need to be installed could pose a problem for websites hosted on a shared hosting system since some providers do not like to install non-standard libraries. At Webanet, we are gradually rolling out the C version of the a LibCcCpiTools.so library to all of our shared servers to alleviate some of the initial installation burden for our customers. The library is also available in Java and COM versions but we stuck with the C library due to our in-house C expertise. As far as integration with PHP goes, this part was a breeze! We quickly created a HSBC ePayments PHP class to work with the C Library to authenticate, and added all the little bits and dabs to ensure the content we send to HSBC was in the correct formats. Within no time we had send our first test payment through the ePayments CPI system and all was well in the world.
While the ePayments CPI works, and works well, I really don’t like the fact that you cannot configure how the payment gateway looks. With Worldpay for example, you get to configure the payment gateway so that it looks more like your own website which ensures order continuity and flow. So I was eager to see what the ePayments API brings to the table, if it was to work like the CPI but give me full control of how things look, I’d be a happy man.
HSBC ePayments API PHP Integration
The HSBC ePayments API solution is fully integrated into your website, which means your customers will never feel as if they have left your website. They enter all of their details, including their credit card details into your website, and this is sent to HSBC via XML and your language of choice. So it’s a far more professional experience for your customers, which can only be a good thing overall.
The HSBC ePayments API documentation was pretty much as I was expecting it to be. A few more documents including an XML reference, and this time the absence of a library to install. So I already felt the API was going to be a little easier to initially work with. The first task is to understand the flow of how payments are taken from your website, are sent to HSBC, and returned back. Quite a lot of data is passed around via XML but once you understand the flow and the data, it’s time to get down to the coding. Again, for this website we used PHP to do the real leg work of managing the data sent and responses received.
Quite a lot of time is taken with form validation of credit cards information and with the handling all of the error codes that HSBC can send you back. This is probably my only criticism, the error code meaning is never really that obvious from the documentation explanations and this can be a little frustrating.
Once the website was fully setup, the order process is very good, very fast, and works really well. A test mode makes life a little easier during the testing phase and gives that all importance confidence that all is working as it should be.
HSBC ePayments CPI or ePayments API?
Both systems work and work really well once setup. But I cannot really get over the fact that you cannot configure the HSBC CPI gateway page to look more like your website. For me, the breaking of order continuity with the ePayments CPI makes the ePayments API the clear winner. Also, the extra step of installing the HSBC library could mean the CPI is not a viable option for websites on shared hosting due to providers not wanting to install the library. The integration time is a little more lengthy for the API but the final result really does make it time well spent.
Integrate HSBC ePayments with PHP
If you would like to know more about how Webanet can help you integrate with the HSBC ePayment systems or have any other questions, please contact us. We can also provide web hosting solutions that include the HSBC CPI libraries too which does alleviate some of the burden of installation.