HSBC CPI Card Payment Module
Posted by admin | Filed under Free Prestashop Modules, Prestashop
This was developed originally for a client. The original brief was to update the existing module (provided by a member on the PrestaShop forum) to work in version 1.1 of PrestaShop and tie up any loose ends, but ended up being a complete re-write almost entirely from scratch (some of the third-party code in the original was re-used).
There are instructions included in the configuration screen that should cover the main questions regarding usage. The orderHash.php code (obtained from a third party) requires that both the mhash and mcrypt modules are installed on your server; you can verify that these have been installed by using the phpinfo() php function call in a test script. If you’re unsure then you should ask your hosting company to assist you. You will also have to have an adequate SSL certificate for your server (for the return pages). From the HSBC documentation:
The CPI currently supports secure POSTs via SSL3.0 and TLS1.0 technologies (SSL2.0 is not supported).
Only a limited set of cipher suites are enabled for the two security protocols, these are outlined below:
TLS1.0
- RC4 encryption with a 128-bit key and an MD5 MAC
- TLS_RSA_WITH_RC4_128_MD5
- FIPS 140-1 compliant triple DES encryption and a SHA-1 MAC
- TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
- Triple DES encryption with a 168-bit key and a SHA-1 MAC
- TLS_RSA_WITH_3DES_EDE_CBC_SHA
SSL3.0
- RC4 encryption with a 128-bit key and an MD5 MAC
- SSL_RSA_WITH_RC4_128_MD5
- FIPS 140-1 compliant triple DES encryption and a SHA-1 MAC
- SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
- Triple DES encryption with a 168-bit key and a SHA-1 MAC
- SSL_RSA_WITH_3DES_EDE_CBC_SHA
The module only supports the single currency for which your id and hash have been issued. It may be that a future version will allow support for multiple currencies (and by implication multiple user ids and hash keys).
ADDITION (19 May 2009) There have been a lot of questions regrading the error codes, so here’s a handy table!
| Code | Description |
|---|---|
| 0 | The transaction was approved. |
| 1 | The user cancelled the transaction. |
| 2 | The processor declined the transaction for an unknown reason. |
| 3 | The transaction was declined because of a problem with the card. For example, an invalid card number or expiration date was specified. |
| 4 | The processor did not return a response. |
| 5 | The amount specified in the transaction was either too high or too low for the processor. |
| 6 | The specified currency is not supported by either the processor or the card. |
| 7 | The order is invalid because the order ID is a duplicate. |
| 8 | The transaction was rejected by FraudShield. |
| 9 | The transaction was placed in Review state by FraudShield (see note 1 below). |
| 10 | The transaction failed because of invalid input data. |
| 11 | The transaction failed because the CPI was configured incorrectly. |
| 12 | The transaction failed because the Storefront was configured incorrectly. |
| 13 | The connection timed out. |
| 14 | The transaction failed because the cardholder’s browser refused a cookie. |
| 15 | The customer’s browser does not support 128-bit encryption. |
| 16 | The CPI cannot communicate with the Payment Engine. |
Version 1.2 (Initial Release January 2009) : HSBC CPI Payment Module v1.2
You may also like:
- BETA Version 2 Paypal Module for PrestaShop We’re pleased to release BETA 1 of our modified version...
- eCartService Paypal Changes rolled into PrestaShop 1.1 Release We’re pleased to announce that the initial changes we proposed...
- Improving PayPal Support in PrestaShop When I first came across PrestaShop I was utterly astonished...
- Paypal WPP (Example) – PayPal Direct API Development Release I’ve been asked several times about this, so...
- Moving Boxes Home Featured jQuery module I thought it was about time for yet more free...
Tags: module, payment, Prestashop
21 Responses to “HSBC CPI Card Payment Module”
-
i am getting the same error but tried replacing that line of code and nothing happened. get the same error. line 170 in my file though! any suggestions?
-
ok my error code 10 is fixed. i changed the code you suggested which didnt work but i found that the info sent through has a max of 54 charcters so make sure your shop name isnt too long.
-
only problem is on the return from hsbc i get error code 8. im in test mode but does anyone know what this means?
-
does anyone know what error 3 means?
-
Hi Admin
I have checked the compressed file on your website and codes.php does exist.
Anyway I still think it works, my employers are taking a long time to okay the switch to prestashop, but on my trials it goes straight to HSBC payment website with the correct amount to be paid.
It is just the above text indicating errors appears in the back office.
Still if it works it works right?
(I think I have used this module before without the errors appearing, so more than likely it is an issue with something on my server).
-
Bonjour, est ce que le module fonctionne pour hsbc en grande bretagne ?
Hello, is this module run with hsb uk ? (sorry for my bad english
)Merci, thanks.
-
Hi,
Is it possible to use this module with any payment gateway with some changes? I need a module that will work with ccavenue. I see in hsbc.php I need to change all the hsbc information with the one provided to me by ccavenue. I also need to change the error codes, processing url etc. Can anyone think of anything I might have missed out?
Thanks very much for a great module.






















admin, I’ve done exactly what you wrote $TimeStamp = time()*1000; relpaced to $TimeStamp = time()*000; and now I’m getting error code #004. do you have any idea what might be the problem?
thanks a lot