Jump to content

HSBC CPI Payment Module V0.2 - New Translations include Spanish & French!


Recommended Posts

This module was developed by Alpha Media & donated by Akzidenz – http://www.nineteeneightythree.com

Finally after fixing many bugs with this before releasing to the public
HSBC V0.1 is now complete & available to download FREE!

This is the payment solution for HSBC customers only!
you do have to have an account with them to use this service :gulp:

Quick & easy setup instructions

1) unzip & upload to your modules directory
2) install this payment module through Prestashop Back Office
3) insert your Client ID & Hash Key which you would of received in your welcome letter then save your settings!

You will also find further instructions in hsbc.php explaining the parameters.

Enjoy ;-)

Server Requirements
The Order Hash Key must be generated to use this module.
& other several days battling to resolve this issue there are now 2 intergration options

1) The Order Hash is created using PHP functions
mhash and mcrypt must be installed on your server! Recommended Option ;-)

2) If you have not got both mhash and mcrypt you have to install libcccpitools.so & the testhash.e provided by HSBC libcccpitools.so has to be put in /usr/lib on the server which requires you to have root access - More hassle than it worth :lol:

You will also find the CPI integration guide attached below which explains how to setup option 2
but I have to say it is not worth the paper it is written on :lol:

But it does however show you all the fields passed through to HSBC & if you want to take this module further post your changes on this topic & I will include with a future version.

Just a quick note as always for all these payment solutions: :-)
in test mode for any payment module’s you can use the following details
credit card number: 4111111111111111
security number: 123

any expiry date in the future!

Thanks to junnecito for providing these translations ;-)
NOW AVAILABLE HSB CPI v0.2 -Translations for this version now in Spanish & French!

IF ANY ONE FEELS THEY WHICH TO CONTRIBUTE WITH THEIR OWN TRANSLATIONS FOR ANY OF MY MODULES PLEASE FEEL FREE TO POST YOUR LANGUAGE FILES HERE! THIS WAY I CAN THEN INCLUDE THESE CHANGES IN FUTURE RELEASES!

CPI Specification.zip

HSBC_CPI_v0.2.zip

Share this post


Link to post
Share on other sites

Hello,

i install this modul but is not working?

Error:
Fatal error: Call to undefined function mhash() in /var/www/web1396/html/modules/hsbc/orderHash.php on line 190

Share this post


Link to post
Share on other sites

As stated above you are required to have mhash and mcrypt installed on your server
drop the attached phpinfo.php file somewhere on your server go to this page & check if both of the required functions are installed if not install these first on your server, if you don't own your server get your host to do this ;-)

For some reason i am not able to upload this file

here's how to create this.
Drop this into a new file phpinfo.php
<?php phpinfo() ?>

Share this post


Link to post
Share on other sites

Very good.

I use online payment with Cyberplus paiement ( Banque populaire ).
Cyberplus use Atos origin.

Do you think you have the possibility for make a module for this payment company ?

thanks

Share this post


Link to post
Share on other sites

IF ANY ONE FEELS THEY WHICH TO CONTRIBUTE WITH THEIR OWN TRANSLATIONS FOR ANY OF MY MODULES PLEASE FEEL FREE TO POST YOUR LANGUAGE FILES HERE! THIS WAY I CAN THEN INCLUDE THESE CHANGES IN FUTURE RELEASES!

Maybe the dev team can help setup this for multi lanuage support
I can see paypal uses the below not quite sure how that would work with this module

Maybe someone from the dev team can answer this :-P

public function getL($key)
   {
       $translations = array(



Each lanuage seems to use a different key!
$_MODULE['<{blocklink}default>blocklink_81e0d51d4ceeff8b79a6cf93eca06db1'] =

not quite sure where this is generated from :question:

Share this post


Link to post
Share on other sites

Hi Alpha:
I'm not client of HSBC, as I wrote before I'm in Madrid, but I will try to help with the translation.
My questionis, not been a client can I install the module in my presta to do the translation :question: I don't need any key for the translation.
:roll:
Thanks

Share this post


Link to post
Share on other sites

I am not sure what the key is about until the dev team explain this to me
having recently started to get into development of these modules I would liek to take my own skill further with the lanuage support :gulp:

If you can upload es.php that would be great!
I will try to get this to work with this module, however there will need to be a few changes within hsbc.php
if you have managed to do these changes please send them in this topic ;-)

Yes you can install without being a client but then the HSBC gateway page will not display!

Share this post


Link to post
Share on other sites

First thing first for those of you who have gone straight to page 2 of this topic!
PLEASE DOWNLOAD THE HSBC CPI MODULE V0.2 IN MY VERY FIRST POST HERE! - http://www.prestashop.com/forums/viewthread/3469/

On another note - junnecito I still have not recieved your spanish translation post :question:
is there a problem attaching this, all you need to do is zip this up first, also did you receive my PM with my email address :question:

Share this post


Link to post
Share on other sites

Received.
I feel stupid now as I can see the translations are automatically created through the admin, this is even simpler than i thought it was going to be :lol:

Maybe you can offer Spanish translation for my other module please :cheese:
http://www.prestashop.com/forums/viewthread/3268/

To answer your email question, HSBC this is a worldwide bank so should work for anyone who banks with HSBC worldwide!
all you have to do is change the following variables which can be found here - http://www.logisticsworld.com/currency.asp - example ( Spain 724 / France 250 )

$PurchaseCurrency = "826";
$BillingCountry = "826";
$ShippingCountry = "826";

Share this post


Link to post
Share on other sites

Hi

Firstly, thanks for the great module and everyones hard work!

I don't currently bank with HSBC although its something I'm looking into and have a few questions about this module that hopefully someone can answer.

Apart from a business bank account with HSBC, what else do I need to use this module? Do I need a Merchant Account with them?
Am I right in thinking this module processes Credit Cards? If so, does anyone know what rate HSBC charge to do this? (% and fee per transaction?)
Would this module allow me to process Credit Cards on my website, without the customer leaving the site? If so, I assume you would need an SSL certificate to do this.


Thanks,

Ben

Share this post


Link to post
Share on other sites

Hello thank you for your kind comments :)
here a few links that may assist you
http://www.hsbc.co.uk/1/2/business/cards-payments/secure-epayments/which-solution
http://www.hsbc.co.uk/1/2/business/cards-payments/secure-epayments/faqs#q4

there are a few different solutions available from HSBC
you do have to have a merchant account to use their service.
This module has been created using the CPI method where the cart details are passed through & processed through a secure SSL post ie. secure server. the card details are then collected through HSBC & then you are returned to your shop where the order is then complete.

I had previously looked into the API solution but have has several issues & feel the CPI solution was in fact a better method of integration with Prestashop

Share this post


Link to post
Share on other sites

Hi,

First, thank you for this contribution. It's a very good work!

I want to test this module in "Test Mode". Is it possible? What is the Client ID and Hash KEy for test?

Thank you.

Share this post


Link to post
Share on other sites

Hi

No problem! Your work is definitely appreciated :)

At the moment I think I would prefer an API solution, hence the reason why I was interested in the Protx module. As I say, I think I'll stick with PayPal until I manage to get a Merchant Account and the Protx module (or similar) is up and running.

I'll take a look at those links now, though.

Thanks again!

Share this post


Link to post
Share on other sites

If you really prefer the API
I may be able to look into this again in a few weeks although there is an awful lot more work involved

Franz if you are just testing this module you will not be able to reach the HSBC payment screen
you can however un-comment line 187 hsbc.php just use any value within the admin for testing

you should then see the order hash generated.
if you want go into further testings replace all the input types in payment_execution.tpl

ie.

<input type="hidden" name="CpiReturnUrl" value="{$CpiReturnUrl}" />



replace with

<input type="text" name="CpiReturnUrl" value="{$CpiReturnUrl}" />



you will then be able to view all the parameter's before the post processes through HSBC
hope that helps let me know if you run into any further problems ;-)

Share this post


Link to post
Share on other sites

Thanks, depending on the comments in this thread im sure you'll be able to tell if there's sufficient demand for it, or not.


I'm still really interested to hear from anyone who has an account with HSBC to hear what kind of rate they are offering you. Is it better or worse than PayPal/Protx?

Share this post


Link to post
Share on other sites

HI,
I'm just about to implement this HSBC integration for my client, but I'm a bit confused as to what I have to set up in terms of SSL certificates/webspace and what needs installing where for it to function correctly. Can you outline the other steps (outside of installing the module), assuming I'm a complete idiot?
Thanks,

Share this post


Link to post
Share on other sites

All you need is hosting with SSL Certificate / 128 bit
1st question who do you currently host with :question:

There are two options for integration of this module

1) This module requires you to have "mhash" and "mcrypt" must be installed on your server! Recommended Option
2) If you have not got both mhash and mcrypt you have to install libcccpitools.so & the testhash.e provided by HSBC libcccpitools.so has to be put in /usr/lib on the server which requires you to have root access – More hassle than it worth

If your not familiar with PHP or apache then PM your FTP details & I will check if your host meets these requirements ;-)

Share this post


Link to post
Share on other sites

Hosting is with VidaHost (.co.uk), and they've confirmed that their secure space with SSL certificate does have mhash and mcrypt installed, but what I don't get is how the secure webspace is connected to a) the HSBC payment gateway, and B) the webspace where PrestaShop is installed, since PS is installed at http://www.mydomain.com/shop, and the secure space set up will be at https://secure.mydomain.com ...

Share this post


Link to post
Share on other sites
You would need the secure space for your domain
ie. https://www.mydomain.com/shop

If this is a seperate domain uselly you will bump into problems along the way
HSBC requires a secure SSL post to past through the encripted data string generated by the order hash

Hope that helps ;-)

OK - I'll get the SSL installed on www, rather than a separate subdomain, if that's going to cause less problems.

The one thing I don't quite understand is what needs to be installed/FTP'd in that webspace, once the certificate is installed?

Thanks

Share this post


Link to post
Share on other sites

SSL established a secure connection over your Web Space & domain no further FTP will be required.
this is not another web space so everything should be straight forward :)

If you run in to problems I am always here to offer support ;-)

Share this post


Link to post
Share on other sites

When I made the translation for your module, I ask you if this module works with Spanish banks :exclaim: do you remember :question:
I need (the Spanish community needs) a credit card solution :-) but not body makes an effort to do some.
I dont know if will be possible for you to help us with that.
Thanks Adam. ;-)

Share this post


Link to post
Share on other sites
OK - I'll get the SSL installed on www, rather than a separate subdomain, if that's going to cause less problems.

Turns out I was too late in requesting the change, so the SSL certificate has already been installed at https://secure.mydomain.com - what potential problems am I likely to run into? Is there a way around it?

Thanks,

Share this post


Link to post
Share on other sites
Where there a will there's is a way
Give me a shout when your ready to test
Send me FTP & Backoffice details & I will see if i can assist ;-)


Thanks for the offer, but HSBC managed to reject my client's application for a merchant account due to low turnover, which they knew about in the first place when they sold it to them! We're going via Google/PayPal and 2co now.

Thanks anyway - I'm sure it won't be the last question I thow out there!

Share this post


Link to post
Share on other sites

Hey Adam,

It seems that the module is not really handling the POST reply from HSBC? (Whether the transaction was successful or not etc.)
as specified in the PDF from HSBC...?

Would this be a problem to integrate into the module as my client is not satisfied with the 'Paid thru HSBC' in the order history.

Thanks!
kenny.

Share this post


Link to post
Share on other sites

I can't see a problem this end :roll:

/*
* Retrieve error codes from hsbc.
* 
*/

$CpiResultsCode=$_POST['CpiResultsCode'];
   if ($CpiResultsCode=='0') {
       'The transaction was approved.';
   }
   switch($CpiResultsCode)
   {
       case 1: $CpiResultsCode="The user cancelled the transaction."; break;
       case 2: $CpiResultsCode="The processor declined the transaction for an unknown reason."; break;
       case 3: $CpiResultsCode="The transaction was declined because of a problem with the card.
For example, an invalid card number or expiration date was specified."; break;
       case 4: $CpiResultsCode="The processor did not return a response."; break;
       case 5: $CpiResultsCode="The amount specified in the transaction was either too high or too low for the processor."; break;
       case 6: $CpiResultsCode="The specified currency is not supported by either the processor or the card."; break;
       case 7: $CpiResultsCode="The order is invalid because the order ID is a duplicate."; break;
       case 8: $CpiResultsCode="The transaction was rejected by FraudShield."; break;
       case 9: $CpiResultsCode="The transaction was placed in Review state by FraudShield"; break;
       case 10: $CpiResultsCode="The transaction failed because of invalid input data"; break;
       case 11: $CpiResultsCode="The transaction failed because the CPI was configured incorrectly."; break;
       case 12: $CpiResultsCode="The transaction failed because the Storefront was configured incorrectly"; break;
       case 13: $CpiResultsCode="The connection timed out."; break;
       case 14: $CpiResultsCode="The transaction failed because the cardholder’s browser refused a cookie."; break;
       case 15: $CpiResultsCode="The customer’s browser does not support 128-bit encryption."; break;
       case 16: $CpiResultsCode="The CPI cannot communicate with the Payment Engine."; break; 
   }

/*
* Retrieve entered information from hsbc form post.
* 
*/
   $CpiResultsCode        = $_POST['CpiResultsCode'];
   $PurchaseDate         = $_POST['PurchaseDate'];
   $OrderHash             = $_POST['OrderHash'];
   $OrderId             = $_POST['OrderId'];
   $PurchaseAmount     = $_POST['PurchaseAmount'];
   $PurchaseCurrency     = $_POST['PurchaseCurrency'];
   $ShopperEmail         = $_POST['ShopperEmail'];
   $StorefrontId         = $_POST['StorefrontId'];    

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 4 weeks later...

Hi

Sorry about the basic nature of my question but i am new to open source.

Is this module being used by any online shops at the moment, or is it still too much in development to be used "in anger".

Thanks
%-P

Share this post


Link to post
Share on other sites
  • 1 month later...

Hello,

I have just installed this module but am having the same problem as akzidenz, it doesn't seem to handle the response correctly. If I go through to the hsbc website, then click cancel it still appears as 'Paid through HSBC' in the admin.

Forgive me if i'm missing something, but it seems to call validateOrder() with a status of 'paid through hsbc' ('PS_hsbc' config value), regardless of the actual payment status. Other modules, such as paypal, submit different status codes (or don't call validateOrder at all) depending on the success of the payment process.

It also does not appear to validate the return orderhash, making it possible to fake a sucessful payment.

I'm not a prestashop expert so it may be something wrong my end, but I just want to confirm that it is handling the hsbc response correctly. I don't want to have to check every order manually before processing them.

Share this post


Link to post
Share on other sites

Yes hostingspace, I now realize this too - when I click Cancel when I get to the HSBC payment page it redirects back to my shop but sets the payment as successful. Adam is there a way we can we resolve this please?
Thanks!

Share this post


Link to post
Share on other sites
  • 4 weeks later...
  • 2 weeks later...

We currently have Paul C working of various development aspects on our sites, one aspect was we needed HSBC secure ePayments to work on our site.

After many hours and alot of hard work he has enabled us to have a HSBC module fully functional on our sites.

Anybody needing HSBC is to work on their site, we can highly recommend Paul C to help you with all your development needs

:-)

Share this post


Link to post
Share on other sites

I've posted my version under HSBC CPI Payment Module on my site if you guys want to try it out and see if it fixes any issues you're having.

One of the problems with the HSBC service is that you need a different ID (and associated hash key) for every currency you want to accept. In this version of the module I've used the currency restrictions functionality to allow you to match payments to a single currency you have available via the HSBC service. Regardless of the store currency settings the module will only take payment in the HSBC currency for which it's been set up. The currency restriction is detailed on the payment page for the customer. I may look at extending the module to support multiple currencies if there's a reasonable amount of demand for it.

As with all modules with a callback, you need to ensure that the remote server has the ability to call the validation.php script in the module directory - in a similar way to the PayPal module.

If any of the folks who previously provided translations wish to update them I'll happily include them in the distribution.

Enjoy,

Paul

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 7 months later...

Hello,
Just installed this module, I have mhash and mcrypt enabled in PHP5, but have this:

Warning: include(orderHash.php) [function.include]: failed to open stream: No such file or directory in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 2

Warning: include() [function.include]: Failed opening 'orderHash.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 2

Warning: include(codes.php) [function.include]: failed to open stream: No such file or directory in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 3

Warning: include() [function.include]: Failed opening 'codes.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 3

Please advise

Share this post


Link to post
Share on other sites
  • 2 months later...
  • 2 months later...
  • 2 months later...

I also have this problem. Can anyone help me out?
Cheers
screenshot attached


I have installed the mod, and entered client id and hash key. Then if i go through checkout process and get to the part where i click "i confirm my order" it does try and take me to the https://www.cpi.hsbc.com/servlet but then takes me instantly to "Your order on is complete." page on my website.

BUT, the order goes through, and appears in the back office. :S


Hello,
Just installed this module, I have mhash and mcrypt enabled in PHP5, but have this:

Warning: include(orderHash.php) [function.include]: failed to open stream: No such file or directory in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 2

Warning: include() [function.include]: Failed opening 'orderHash.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 2

Warning: include(codes.php) [function.include]: failed to open stream: No such file or directory in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 3

Warning: include() [function.include]: Failed opening 'codes.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /var/www/shop/htdocs/1.2.3/classes/Module.php(325) : eval()'d code on line 3

Please advise

22221_1WndW37Xofw9ydxxO9MG_t

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More