Latest News: (loading..)
Sign in to follow this  
Followers 0
freerangemum

HSBC secure-epayment module

1,158 posts in this topic

Hi Neil

 

Thank you for the response - have done that and now get:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/gwlad/public_html/includes/functions/general.php:1266) in /home/gwlad/public_html/includes/functions/general.php on line 1174

 

on the top of my homepage.

 

??? - Any thoughts - This is way beyond a man of my limited capabilities.

 

Regards

 

Greg

Share this post


Link to post
Share on other sites

The testhash.e is supplied on the HSBC CD-ROM you get when you open a secure e-payments account. It's located in the linux folder.

 

Regards

 

Neil Westlake

DJBox.co.uk

Share this post


Link to post
Share on other sites

In case this can help anyone else - after six months of working fine our HSBC integration stopped working. This was the old code which worked, then stopped working:

 

//Generation of the order_id
? ? ?srand ((float) microtime() * 10000000);
? ? ?$r1 = rand(100,999);
? ? ?$t1 = date("yz-his");

? ? ?$ordernum = $t1.$r1;
? ? ?if (!empty($_POST['OrderId'])) $ordernum=$_POST['OrderId'];

 

We changed it to this, and it works again:

 

//Generation of the order_id
? ? ?srand ((float) microtime() * 10000000);
? ? ?$r1 = rand(100,999);
? ? ?$t1 = date("yz-his");

? ? ?$sequence = "Your Company Name Here order $t1";
? ? ?$ordernum = $t1;
? ? ?if (!empty($_POST['OrderId'])) $ordernum=$_POST['OrderId'];

 

The last line is probably superfluous now, but we've left it in anyway.

 

A few tips:

 

For support from HSBC don't phone their normal support line number, phone the ICG Dept on 0845-6022880 (9-5 Mon-Fri only). This is for existing customers only.

 

They will be able to pull up the error logs and tell you why the transaction is being rejected at their end. Worked for us. Thanks to Neil also for checking the checkout code.

 

Vger

Edited by Vger

Share this post


Link to post
Share on other sites
The testhash.e is supplied on the HSBC CD-ROM you get when you open a secure e-payments account. It's located in the linux folder.

 

Regards

 

Neil Westlake

DJBox.co.uk

:o

wow instant replies thanx frndz..........

i will surely get back if there aer problems and also let me know ,cant u integrate hsbc without the oscommerce thing..suppose i am using some other website and i want to integrate HSBC payment there,then?

Share this post


Link to post
Share on other sites
:o

wow instant replies thanx frndz..........

i will surely get back if there aer problems and also let me know ,cant u integrate hsbc without the oscommerce thing..suppose i am using some other website and i want to integrate HSBC payment  there,then?

 

 

Now i am able to go to HSBC site, but i am getting Result code: 4, which is "The processor did not return a response."

 

I have done

$str is

[url=https://www.secure.check.com/checkout.phphttp://www.mycollages.com/hsbc_result.phpTest]https://www.secure.check.com/checkout.phpht..._result.phpTest[/url] 101950826UK34312691GBP1110442954000AuthTAbsolute

 

$cmd="$path/TestHash.e HASHKEY $str"; // $str contains all hidden variables

 

$ret=exec($cmd);

$ret=split(':',$ret);

$hash=trim($ret[1]);

 

Is my $str correct,plz suggest

 

But i am not getting any value now on $hash. Anyone know how to to execute TestHash.e and get value for $hash?

Edited by phpwonderkid

Share this post


Link to post
Share on other sites

Spend endless hours, reading this thread..

I have HSBC installed and working.

 

The only problem is after the customer pays, they get returned to an empty cart and not a success page, so customers email me to check if the order goes through, because the summary page is not displayed.

No chex works a treat so it much be something simple in this modules.

 

(The payment is taken OK)

Sean

Share this post


Link to post
Share on other sites

Check in includes/modules/payment/hsbc.php that this is set as your return url:

 

$post_1=array(

'CpiDirectResultUrl'=>tep_href_link('checkout_process.php', '', 'SSL', true),

 

Vger

Share this post


Link to post
Share on other sites
Check in includes/modules/payment/hsbc.php that this is set as your return url:

 

$post_1=array(

                              'CpiDirectResultUrl'=>tep_href_link('checkout_process.php', '', 'SSL', true),

 

Vger

 

That's in there, it does go to check_process.php, but skips the checkout_success.php for some reason.

In check_process.php there is

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

at the bottom, but it never gets there !!

 

Thanks

Sean

Share this post


Link to post
Share on other sites

Try installing a new (default) checkout_success.php file (unless you have amended it for any Contributions you've installed), in case there's a problem with it.

 

Vger

Share this post


Link to post
Share on other sites
Try installing a new (default) checkout_success.php file (unless you have amended it for any Contributions you've installed), in case there's a problem with it.

 

Vger

 

I have put a checkout_success.php with just one line of code <h1>Got Here</h1> and the usual HTML headers, but it never gets there, it must be something in the HSBC module that I havn't entered..... as Nochex go through the whole process OK(Payment->checkout_process.php->checkout_success.php)

 

Thanks

Sean.

Share this post


Link to post
Share on other sites

Did you replace the checkout_process.php file with a known good copy (default install version of osCommerce)? If there is a problem with that file then it won't go through to checkout_success.php.

 

It does not sound like a problem with HSBC. The order is being taken and the person is being returned to checkout_process.php - at which point in time the involvement of HSBC is finished.

 

If all else fails you can try changing this piece of code to checkout_success.php, as in:

 

$post_1=array(

'CpiDirectResultUrl'=>tep_href_link('checkout_success.php', '', 'SSL', true),

 

 

Vger

Edited by Vger

Share this post


Link to post
Share on other sites
Did you replace the checkout_process.php file with a known good copy (default install version of osCommerce)?  If there is a problem with that file then it won't go through to checkout_success.php.

 

It does not sound like a problem with HSBC.  The order is being taken and the person is being returned to checkout_process.php - at which point in time the involvement of HSBC is finished.

 

If all else fails you can try changing this piece of code to checkout_success.php, as in:

 

$post_1=array(

                              'CpiDirectResultUrl'=>tep_href_link('checkout_success.php', '', 'SSL', true),

Vger

Thanks for you help, it got me thinking and the 2nd line in that array was the same and not hsbc_return.php.

Changed it and it works.

 

Good result

Sean

Share this post


Link to post
Share on other sites

plz can anyone tell

TestHash.e --the path for this file to reside and wht if i dont have access to cgi-bin dir and lib dir

libCcCpiTools.so ---path for this file to reside in .

 

CcResults.e & CcOrderHash.e wht r these 2 files for and where should i put (i.e dir) these files

Share this post


Link to post
Share on other sites

If you don't have access to a cgi-bin one level below your website root files then create a folder called cgi-bin, and set the appropriate permissions and pathway for it. Then, put all of the four files into this cgi-bin.

 

The absolute path will depend upon your server setup. It could be something like /var/www/html/ for your web root and /var/www/cgi-bin/ for your cgi-bin, but whatever it is it will be shown in your osCommerce configure.php files.

 

The only reason I can think of that you may not have access to a cgi-bin would be if you use FrontPage extensions for your osCommerce website - which is a bad idea anyway (in my experience and opinion).

 

Hope this helps - Vger

Share this post


Link to post
Share on other sites

Has anyone come accross a problem with changing to new account details? Everything is working fine for our existing account, but we need to change to a new account with new hash & Client ID. All we get is 'hacking attempt'.

 

Already tried requesting a new hash, but that didn't work. Any ideas anyone?

Share this post


Link to post
Share on other sites

Hi. First of all ...thank you for getting the module written in the first place! Actually, HSBC should be thanking you even more!

 

One thing I would check is that HSBC has actually changed things over at their end (provided this is on the same website). I know that when we went from Test to Production mode that it took HSBC 24 hrs to make the change. If you have a new Hash code and Client ID then they need to have made the changes their end or else you will get the 'Hacking attempt!' message.

 

Also, please make sure that the Client ID or Alias set in your osCommerce payment module is the full number (beginning with UK and ending with GBP). We used the short number to begin with and only got it to work when we input the full number.

 

Hope this helps - Vger

Share this post


Link to post
Share on other sites

I meant what I said in my earlier post - thanks to you getting the module written for osCommerce HSBC has received a lot of extra business at a time when they were trying to get people to buy into their new system. If you don't find them too helpful then it might be worth drawing that to their attention. A little blackmail/arm twisting never harmed anyone :D

 

Vger

Share this post


Link to post
Share on other sites

Hi All

 

I have just had the pleasure of installing the hsbc module for a customer on one of our servers.

I have read ALL the posts in this thread and have played about for a few hours and I have come across something which could explain why some people can not get this to work.

 

I run a small hosting business and as such I am in a better possition than most as I own the servers!!

 

After installing and configuring the various bits and pieces in this module as all the suggestions in this thread, I was still having problems and could not get past the 'Hacking Attempt' error.

 

When I looked in the error log (/var/log/httpd/error) I found the following message.

 

/home/sites/site13/hsbc/TestHash.e: error in loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

 

OK so it could not find the shared library file.

 

When I looked using locate I got the following

 

[root .defined]# locate libstdc++-

/usr/doc/libstdc++-devel-2.95.3

/usr/doc/libstdc++-devel-2.95.3/ChangeLog.libio

/usr/doc/libstdc++-devel-2.95.3/ChangeLog.libstdc++

/usr/lib/libstdc++-3-libc6.1-2-2.10.0.so

/usr/lib/libstdc++-libc6.1-1.so.2

/usr/lib/libstdc++-libc6.1-2.so.3

/usr/lib/libstdc++-2-libc6.1-1-2.9.0.so

/usr/lib/libstdc++-3-libc6.1-2-2.10.0.a

/usr/lib/libstdc++-libc6.1-2.a.3

 

So the closest version was

/usr/lib/libstdc++-libc6.1-2.so.3

 

The quick and dirty method to cure this was to use a symlink so

 

[root .defined]# ln -s /usr/lib/libstdc++-libc6.1-2.so.3 /usr/lib/libstdc++-libc6.2-2.so.3

 

and hey presto up pops the HSBC payment page

 

NOW

 

This requires the ability to tail the httpd error logs and root access to create the symlink to the older version of libstdc. I am lucky enough to have this available to me, most 'ordinary' users would not have this available to them.

 

This server (out of interest) is a Cobalt RAQ4r, there are thousands of them out there still in use by hosting companies. Depending on the custom software they have on, they may well not have the 6.2-2.so3 version of libstdc.

 

SO if you are having trouble getting past the 'Hacking Attempt' error message.. it might not be your fault!! just ask your host if they have the above module installed and if not then ask them to symlink to the closest older version they have on (a 30 second job), this might just do the trick.

 

Now I just need to sort out why the order is not coming back to OSC properly, but first some sleep!!

 

Hope this might help stop somebody going slowly mad.

 

Paul.

Share this post


Link to post
Share on other sites

Hi Paul, Appreciate your workaround to your problem. However as HSBC looks for the Lib file that comes as part of the package of files on the HSBC CD-ROM Integration Guide all that is needed is to drop that file into the cgi-bin along with the other files.

 

If you are still having problems with the order not coming back properly and you are using checkout_process.php as your return address you may want to try checkout_success.php instead.

 

Vger

Share this post


Link to post
Share on other sites
Hi Paul,  Appreciate your workaround to your problem.  However as HSBC looks for the Lib file that comes as part of the package of files on the HSBC CD-ROM Integration Guide all that is needed is to drop that file into the cgi-bin along with the other files.

 

If you are still having problems with the order not coming back properly and you are using checkout_process.php as your return address you may want to try checkout_success.php instead.

 

Vger

 

Hi Vger

 

I had already dropped them into a folder (outside the web directory) and pointed the hsbc.php to the location. I assume the .so file that hsbc uses has a dependency on this other file, I could be wrong however, it was 1 am this morning!! The only other posiblility is that the /usr/lib location is hard coded into the .so from hsbc, so it will only work if the library file resides in /usr/lib, however other people have reported it works with the files anywhere. So either the required files are present in /usr/lib on that system or it is a dependency of the supplied library file ... I will do a little testing and see if I can find an answer (probably at 1 am again!!).

 

I will take a look at the other problem later on, i think it already uses the checkout_success page.

 

Paul.

Share this post


Link to post
Share on other sites

After finally getting my UK Merchant ID sorted out, i knew there was a contribution for the HSBC E-Payment serviceas id seen in before.. So i downloaded it, couldnt work it out, came to the forums and found this thread.

 

Now that i've read all 19 pages of this support thread, i was forced to give up on the idea of the E-Payments service because of all the problems and look else where.. >_<

 

I came across a company called Protx (http://www.protx.com/) and they make use of the HSBC merchant ID which you get.. the only thing i had to do was ring up HSBC and tell them i wanted them to realese my ID so i could use it with Protx. Now 14 days later i have my Protx form working perfectly through my shop and the contribution was very painless to setup.

 

I'm only posting this here incase anybody else is thinking the same as me, I just hope this helps someone out! :thumbsup:

 

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0