Forum Moderators: coopster

Message Too Old, No Replies

HSBC CPI Integration

HSBC payment with php problems

         

Babble_Nico

9:54 am on Jul 24, 2007 (gmt 0)

10+ Year Member



I need to use HSBC to process payments for one of my client. I have followed the hsbc instructions, spent hours on the phone with their support and read a previous thread on this forum regarding this matter.

I manage to generate a OrderHash with command line and with php scripting but with the same arguments, they don't match and when I send to HSBC I get an error 10.

Please help

Habtom

10:34 am on Jul 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your question might be dealt with at this thread HSBC CPI integration with PHP [webmasterworld.com]

Babble_Nico

10:39 am on Jul 24, 2007 (gmt 0)

10+ Year Member



Thanks Habtom for your prompt reply. The forum I was referring to is the one you mention but I couldn't find my answer in there.

Habtom

10:51 am on Jul 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't had real life experience with HSBC CPIs, so that was as far as I can go.

... and btw welcome to webmasterworld.

twist_chris

1:38 am on Jul 26, 2007 (gmt 0)

10+ Year Member



Maybe you should look for a new job ;)

You have to remove the encoding characters in your URL path: $CpiReturnUrl and $CpiDirectResultUrl

sarnia

7:53 am on Jul 27, 2007 (gmt 0)

10+ Year Member



Hi Babble_Nico,

I know exactly what you mean about the HSBC support centre GSC based in Kolkata, been there and have the T-shirt to prove it. They are as much use as tits on a bull. <rant over>.

Things to check that I discovered may be causing your problems.

1/ Make sure that both $CpiReturnUrl and $CpiDirectResultUrl are [....]

2/ If you have an old hash key where the zeros have not got slashes through you may be assuming these are letter O's.

3/ When in test mode do not pass a value greater than £0.99 (to be transmitted as pence 0099).

4/ Counrty code must be 3 digit i.e Albania 8 needs to read 008.

5/ The time stamp for HSBC has to be 13 digits in length. I use the following to achieve this:
$TimeStamp = time().'000';

6/ Here is he code that I use to generate the Hash Key:

$teststr = '"'.$CpiDirectResultUrl.'" "'.$CpiReturnUrl.'" "'.$MerchantData.'" "'.$Mode.'" "'.$OrderDesc.'" "'.$OrderId.'" "'.$PurchaseAmount.'" "'.$PurchaseCurrency.'" "'.$StorefrontId.'" "'.$TimeStamp.'" "'.$TransactionType.'" "'.$UserId.'" "'.$BillingAddress1.'" "'.$BillingAddress2.'" "'.$BillingCity.'" "'.$BillingCountry.'" "'.$BillingCounty.'" "'.$BillingFirstName.'" "'.$BillingLastName.'" "'.$BillingPostal.'" "'.$ShopperEmail.'" "'.$ShippingAddress1.'" "'.$ShippingAddress2.'" "'.$ShippingCity.'" "'.$ShippingCountry.'" "'.$ShippingCounty.'" "'.$ShippingFirstName.'" "'.$ShippingLastName.'" "'.$ShippingPostal.'"';
$path = "path to TestHash.e";
$cmd = "$path/TestHash.e $hashKey $teststr";
$ret = exec($cmd);
$ret = split(':',$ret);
$generated_Hash = trim($ret[1]);

echo 'generated_Hash = '.$generated_Hash.'<br><br>';

If these doesn't solve your problems mail me your code and I'll check it for you.