Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HSBC secure-epayment module


Guest

Recommended Posts

Andrew,

 

The Invalid Data Error is normal while HSBC still have you in test mode.

 

The order not updating in the back-end is caused by a problem in checkout_process.php, this is fairly difficult to debug.

 

 

Neil Westlake

Edited by wheeloftime
Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

Thanks seemed to work in test mode first time, then I get the error message below when I click the last continue on HSBC that should return to my site

 

Fatal error: Call to undefined function: generatehash() in /home/mydomain/public_html/hsbc.php on line 61

 

any ideas anyone?

 

each failed return has logged the order on my site admin

Edited by Vendy
Link to comment
Share on other sites

You have the wrong Return URL - read the install instructions again.

 

Vger

 

Hi

 

no return URL in the install I have?

 

HSBC CPI Secure ePayment Card Processing Module 1.1a (w/ GNU license file) downhom 25 Nov 2005

 

 

HSBC CPI Secure ePayment Card Processing Module

 

Prerequisites:

 

Ensure PHP has the mhash, mcrypt modules. A simple way to do this is to create a file named test.php including only this line:

 

<?php print phpinfo(); ?>

 

Then access the page by going to http://www.yoursite.com/test.php. Look for a sections with the names mcrypt and mhash. If they don't exist, contact your ISP and request they install the mhash and/or mcrypt module in PHP.

 

If your ISP refuses, find an ISP that will either install the modules or already have the modules installed.

 

 

Installation:

 

- Copy the files in the catalog directory to your the catalog directory of your Os Commerce store.

 

- Open the includes/applications_top.php

 

- Find the following line near the top of the file:

 

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

 

- Add the following below

 

// Capture the session from the hsbc post

if ( isset($HTTP_POST_VARS['OrderId']) ) {

list($hsbc_session, $null) = split('-', $HTTP_POST_VARS['OrderId']);

$HTTP_POST_VARS['osCsid'] = $hsbc_session;

}

 

 

- You should now see "HSBC CPI gateway" in the Payment Modules section of your stores admin.

 

 

Tips:

 

- If the HSBC payment module works in test mode but gives the "The transaction failed because of invalid input data" error in Production mode, contact HSBC and have them put your HSBC account in Production mode.

 

- You merchant id is the number that begins with UK and ends with GBP. If you get this wrong, you'll get an error message.

 

- Test mode requires real credit card numbers and they also do fraud checking. For a card to process successfully, I had to use a card on a UK bank and a customer's address for the UK. After several successful tests, I started getting fraud checking errors. Changing to another UK card on a UK account solved the problem. So if you get fraud checking errors in test mode, change to another card number.

 

 

Funding for this improvement provided by 110bitsolutions and written by Duane Hinkley of Down Home Consulting, DownHomeConsulting.com.

 

 

 

$Id$

Edited by Vendy
Link to comment
Share on other sites

I have never used that version, so don't know if it works or not. In the version I use, which I know works, there is an hsbc_return.php file, and this is the address the site returns to for processing before being passed on to the checkout_process.php page and from there to checkout_success.php

 

Vger

Link to comment
Share on other sites

Hope you can help with my HSBC problem.

=================================

 

I can purchase a product and pay via HSBC, it returns to the shop, empties cart and says success! Yippee!

Email's are sent successfully, automatically to customer/shop. - Grrreat!

 

Problem is, the order is not showing in osc admin. :-(

But the order IS being stored in the db.

 

So as I undertand, it's merely a display problem.

 

 

Can you please guide me where I should be looking or help to solve this.

 

I can see the following via phpmyadmin, and then I am out of my depth...

-----------------------------------------------------

 

In table [orders] I can see that order_id is being populated fine.

 

If I pay using cheque, orders are displayed fine and i can see in the db

table [orders_products] the order_id is given a value that corresponds to the order.

 

But if I pay via HSBC and look at the db

table [orders_products] the order_id is only being given a value of zero, which is probably the default.

 

I can also see that the orders are being given correct status, ie: Pending. But there is no order to see via admin.

Q/ How many therapist's does it take to change a lightbulb?

A/ Two. But the lightbulb has to really 'want' to change.

Link to comment
Share on other sites

Hope you can help with my HSBC problem.

=================================

 

I can purchase a product and pay via HSBC, it returns to the shop, empties cart and says success! Yippee!

Email's are sent successfully, automatically to customer/shop. - Grrreat!

 

Problem is, the order is not showing in osc admin. :-(

But the order IS being stored in the db.

 

I can see the following via phpmyadmin, and then I am out of my depth...

-----------------------------------------------------

 

In table [orders] I can see that order_id is being populated fine.

 

this has been answered before but I can't remember the exact fix, I think it may be the order status, what codes do you have in the table orders_status?

 

are you using the download from Jose's website?

Link to comment
Share on other sites

this has been answered before but I can't remember the exact fix, I think it may be the order status, what codes do you have in the table orders_status?

 

are you using the download from Jose's website?

 

I just tested this, I put a non existent status number in an order using phpmyadmin and the order went from the admin/orders page.

Link to comment
Share on other sites

Hi Martin,

 

Here are two possible explanations a while back an error was found in /catalog/admin/orders.php file which was a 'status' problem here's the link to the fix:-

 

 

The second may be linked to the order number, if you are using a custom order number and have changed the data type for the order_id from an int(11) to varchar(64) for example, you have to change all occurences of (int)$order_id, (int)$Oid etc to $order_id, $oid etc in all files in the admin and catalog folders.

 

If not order can seem to disappear because the files in admin or catalog will be trying to display or find a whole number (int) for the order number when it was changed to varchar(64) letters and numbers in the example above.

 

Hope this is of help

 

Andy

Literally, Laterally Thinking! If you cannot get through it, go round it.

Link to comment
Share on other sites

Hi Martin,

 

Here are two possible explanations a while back an error was found in /catalog/admin/orders.php file which was a 'status' problem here's the link to the fix:-

The second may be linked to the order number, if you are using a custom order number and have changed the data type for the order_id from an int(11) to varchar(64) for example, you have to change all occurences of (int)$order_id, (int)$Oid etc to $order_id, $oid etc in all files in the admin and catalog folders.

 

If not order can seem to disappear because the files in admin or catalog will be trying to display or find a whole number (int) for the order number when it was changed to varchar(64) letters and numbers in the example above.

 

Hope this is of help

 

Andy

 

Thanks Andy, it was actually "thewrath1" that posted the original issue, I'm sure these will help him.

Link to comment
Share on other sites

Help please...

 

I am really stuck now..

 

Im getting this error:

 

/public_html/cgi-bin/TestHash.e: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

 

In my server log file

 

 

Im definitely not getting a hash key generated I have an order hash but not hash??

 

So when the script compares the two I get the inevitable error - hacking attempt!

 

. But I have installed the TestHash.e in cgi, sorted the permissions. Got my host to drop the .so file into usr/lib/. Ive emailed my host they say libstdc++ is installed

 

libstc++ is already installed on all our servers. Info as follows...

 

Installed Packages

Name : libstdc++

Arch : i386

Version: 3.4.4

Release: 2.fc3

Size : 774 k

Repo : installed

Summary: The GNU Standard C++ Library v3.

Description:

The libstdc++ package contains a snapshot of the GNU Standard C++ Library v3, an ongoing project to implement the ISO 14882 Standard C++ library.

 

Attempting to locate the binaries produced the following files:

 

/usr/lib/libstdc++.so.6

/usr/lib/libstdc++.so.6.0.3

/usr/lib/gcc/i386-redhat-linux/3.4.3/libstdc++.so

/usr/lib/gcc/i386-redhat-linux/3.4.3/libstdc++_nonshared.a

/usr/lib/gcc/i386-redhat-linux/3.4.3/libstdc++.a

/usr/lib/gcc/i386-redhat-linux/3.4.3/libstdc++_shared.so

 

Just getting the Hacking Attempt error!

 

Any ideas at all??

 

Thanks....

Link to comment
Share on other sites

Help please...

 

I am really stuck now..

 

Im getting this error:

 

/public_html/cgi-bin/TestHash.e: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

 

In my server log file

Im definitely not getting a hash key generated I have an order hash but not hash??

 

So when the script compares the two I get the inevitable error - hacking attempt!

 

. But I have installed the TestHash.e in cgi, sorted the permissions. Got my host to drop the .so file into usr/lib/. Ive emailed my host they say libstdc++ is installed

Just getting the Hacking Attempt error!

 

Any ideas at all??

 

Thanks....

 

If the libraries are there it's probably a problem with the LD_LIBRARY_PATH environment variable

 

See if the ISP will run it for you and give you the value for LD_LIBRARY_PATH

 

a guess but you could also try changing

 

putenv("LD_LIBRARY_PATH=$path");

 

to

 

putenv("LD_LIBRARY_PATH=$path:$LD_LIBRARY_PATH");

 

But I'd see if you can get them to run/debug for you as a 1st choice.

Link to comment
Share on other sites

I seem to recall I had a similar problem and it is covered in the post below hope this helps.

 

 

<snip>

 

 

 

After a nights sleep it became clearer ...

 

Running TestHash from the command line (./TestHash.e) told me that it could not find the library file it needed (libstdc++-libc6.2-2.so.3) to cut a long story short the server had a slightly different version of this library file (libstdc++-libc6.1-2.so.3) so I originaly set up a symlink for the 6.2-2 file to use the 6.1-2 version.

For some reason this symlink no longer existed .. so a quick

 

ln -s libstdc++-libc6.1-2.so.3 libstdc++-libc6.2-2.so.3

 

and hey presto all is well in planet HSBC once again.

 

<snip>

 

It looks like you might have to link to 6.0.3 and hope this works ok.

 

Paul.

Link to comment
Share on other sites

I seem to recall I had a similar problem and it is covered in the post below hope this helps.

<snip>

After a nights sleep it became clearer ...

 

Running TestHash from the command line (./TestHash.e) told me that it could not find the library file it needed (libstdc++-libc6.2-2.so.3) to cut a long story short the server had a slightly different version of this library file (libstdc++-libc6.1-2.so.3) so I originaly set up a symlink for the 6.2-2 file to use the 6.1-2 version.

For some reason this symlink no longer existed .. so a quick

 

ln -s libstdc++-libc6.1-2.so.3 libstdc++-libc6.2-2.so.3

 

and hey presto all is well in planet HSBC once again.

 

<snip>

 

It looks like you might have to link to 6.0.3 and hope this works ok.

 

Paul.

 

Nice one Paul, this was the error, I got my hosting co. to symlink the libs now this part works a treat. Just need to sort the order no appearing in the database which is the next problem in the installation Ive read about, Only 1 weeks work this. - Did you cure the order id issue?

 

Much appreciated Paul,

 

thanks Eric!

Link to comment
Share on other sites

My store has been running fine for months on end but this month, we discovered the

The transaction failed because of invalid input data.
error message when customers try to confirm an order (ie, the stage at which my site should take them to HSBC).

 

So I rang HSBC, and they viewed their logs and decided that the problem lay in the TimeStamp format. The guy reckoned that the TimeStamp was being formatted as a decimal number instead of a 13 digit integer. They said I needed to contact my web host and ask them to check the TimeStamp format. I did this, but the reply I got from them was:

The format of a timestamp sent by your shopping cart is determined solely by the shopping cart software and its respective payment module's configuration. If your HSBC module is generating timestamps in the incorrect format I would suggest contacting the module's developers, as they should be able to correct this so that it generates relevant timestamps in the format required.

As we had processed orders with no problems before Christmas, closed for 10 days, re-opened in January and then discovered our customers can't confirm their orders, I suspect the problem arose on Jan 1st and is indeed something to do with me server provider. But I might be wrong (I'm clutching at straws here!)

 

After two days of searching the forums, I finally found this post and the one before it (#96 & 97). Sadly, the fix didn't work for me.

Dan,

 

I'd say the offending line is:

 

"<input type="hidden" name="TimeStamp" value="1.081464565E+12">"

 

Neil Westlake posted the following fix:

 

In hsbc.php, Replace:

 

$time=($time+(0*3600));

$time=$time*1000;

 

with:

 

$time = $time."000";

 

Then you should be fine. :)

 

 

So, can anyone explain to me in layman's terms what I need to do to format the timestamp? Or do you think it may actually be my hosting company who need to check the TimeStamp format? I didn't set the site up and I pick up what I can about PHP and MySQL as I go along. Sorry if someone has already posted a fix, but I just can't find it.

 

Thanks,

Liz

Link to comment
Share on other sites

Hi,

 

Has anyone had any customers reporting problems making payments?

 

I've had a couple of people this week that have been unable to click through, when I try it everything seems ok?

 

Mostly seems to be a pob clicking confirm order and then either nothing happens or they come straight back. Has anyone seen this behavior?

 

Regards,

 

 

Martin

Link to comment
Share on other sites

Hi All,

 

Strange things started happening, store and HSBC module running great for last 2 months, but yesterday something happened that was totally out of the blue.

 

We had 2 clients create account and place items in their carts but they were unable to goto HSBC to input their card details.

 

The only difference was they were from the USA so as you would expect the country iso codes changed to 840 as well as their states and postcodes.

 

So I tried my test account put the same items as one client in my basket went to checkout (I had changed the hidden fields to input fields so i could see what was being generated.

 

No problems at all, :) so I thought lets change the address details left every thing alone except for country and state, which is switched to USA and Arkansas and confirmed order and lo promptly dumped back to site with 'error invalid input data' :angry:.

 

YET all was idetical except for country of origin. 840 not 826 and Arkansas not east yorkshire. :huh:

 

Any ideas on this problem anyone?

 

TIA

Andy

Literally, Laterally Thinking! If you cannot get through it, go round it.

Link to comment
Share on other sites

Hi,

 

Has anyone had any customers reporting problems making payments?

 

I've had a couple of people this week that have been unable to click through, when I try it everything seems ok?

 

Mostly seems to be a pob clicking confirm order and then either nothing happens or they come straight back. Has anyone seen this behavior?

 

Regards,

Martin

 

Some customers will have problems because internet explorer has issues man! If the user has some how messed up the cookies setting or the security settings in IE they may not be able to click to your your secure pages. On my site I have a note on the confirmation page for internet explorer and AOL users to call if they have any problems clicking through. If they do call, I go through the checkout process with them to find out where they fall down. I normally recommend firefox as a browser upgrade.

 

As always try placing orders on your site using as many different browsers as possible. AOL can be problematic as can IE. SPECIAL characters in the address are also rejected by HSBC, I had a customer rejected because they had & or # in their address.

 

Also make sure your site generates sequential order numbers. Any jumps in the sequence will generally indicate that a user has had problems getting through to HSBC. If you notice an unexplained jump then you can call HSBC support and they can usually tell you why the user was rejected.

 

I hope this helps.

 

Regards

Sean

 

 

 

 

Hope this helps.

Link to comment
Share on other sites

AOL users always have problems - because they can't keep the session trail. AOL caches not just each page, but each element of a page individually, and on different servers. I saw this happening with a Stats package which I once used. The page would get cached on one server, every element on different servers, and every image on still different servers. One page could equal 20-30 items all cached in different places. There's nothing you can do about this - except advise cusomers to use a decent service provider.

 

Vger

Link to comment
Share on other sites

Hi,

 

Has anyone had any customers reporting problems making payments?

 

I've had a couple of people this week that have been unable to click through, when I try it everything seems ok?

 

Mostly seems to be a pob clicking confirm order and then either nothing happens or they come straight back. Has anyone seen this behavior?

 

Regards,

Martin

 

 

Just had another thought and this is very important!

 

If your page contains any calls to Javascript in external files and your customer tries to log in to your secure area they will get a message from IE that the page contains scure and non-secure items. This is another great microsoft pain in the rear. Most users will not bother to read more info about the message instead they will feel unsure about your security and probably not make a purchase.

 

so make sure you enclose any references to external javascripts like this:

 

 

<?php

if ($request_type != 'SSL') {

 

echo '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "xxxxxxxxxxx";urchinTracker();</script>';

 

}

?>

 

i basically says if the page being displayed is not https: then include my code.

 

When a users goes to your secure area the java script is not loaded and thus the secure/non-secure messages do not get displayed.

 

I do all my work in Firefox and often make the mistake of assuming that it will be alright in IE.

 

Hope this helps.

 

Regards

Sean

Link to comment
Share on other sites

My store has been running fine for months on end but this month, we discovered the error message "The transaction failed due to invalid data input" when customers try to confirm an order (ie, the stage at which my site should take them to HSBC).....

 

Turns out Neil's fix did work in the end. Don't know why it didn't originally, but it does now. Such is life!

 

I am also wondering if anyone has found a fix for when Fraudshield kicks in and the customer's order is lost?

From around post #132 of this thread, people seem to be suggesting a contrib but I can't find anything in the contributions section of oscommerce. Am I looking in the wrong place?

 

Cheers,

 

Liz

Link to comment
Share on other sites

I've got this contribution working on my site and it works well. Initially installed and setup by Neil Westlake.

 

However, I've got a big problem because I've got multiple languages and the HSBC payment page is only in English.

 

I therefore need the API (Application Payment Interface) instead of the CPI that we are currently using now.

 

Has anyone done any work on this or have a module that they would care to release before I go out and pay Neil to custom write me one? Or anyone interested in an API version that would like to contribute?

 

Regards

VinceG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...