Forum Moderators: coopster
I had gone through the topic about hsbc integration, and i tried out everything, but i am not getting the payment integration working. I have a form like this
<form name="checkout_confirmation" action="https://www.cpi.hsbc.com/servlet" method="post">
<input type="hidden" name="CpiDirectResultUrl" value="https://www.secure.check.com/checkout.php">
<input type="hidden" name="CpiReturnUrl" value="https://www.secure.check.com/checkout.php">
<input type="hidden" name="OrderDesc" value="Test 101">
<input type="hidden" name="PurchaseAmount" value="950">
<input type="hidden" name="PurchaseCurrency" value="826">
<input type="hidden" name="StorefrontId" value="<?=$storeid;?>">
<input type="hidden" name="TimeStamp" value="1110442974000">
<input type="hidden" name="TransactionType" value="Auth">
<input type="hidden" name="MerchantData" value="<?=$test;?>">
<input type="hidden" name="BillingAddress1" value="address1">
<input type="hidden" name="BillingCity" value="city">
<input type="hidden" name="BillingCountry" value="352">
<input type="hidden" name="BillingCounty" value="">
<input type="hidden" name="BillingFirstName" value="firstname">
<input type="hidden" name="BillingLastName" value="lastname">
<input type="hidden" name="BillingPostal" value="00000">
<input type="hidden" name="ShopperEmail" value="test@test.com">
<input type="hidden" name="ShippingAddress1" value="shipaddr1">
<input type="hidden" name="ShippingCity" value="shipcity">
<input type="hidden" name="ShippingCountry" value="352">
<input type="hidden" name="ShippingCounty" value="">
<input type="hidden" name="ShippingFirstName" value="shipfirst">
<input type="hidden" name="ShippingLastName" value="shiplast">
<input type="hidden" name="ShippingPostal" value="00000">
<input type="hidden" name="Mode" value="T">
<input type="hidden" name="OrderHash" value="<?=$hashvalue;?>">
<input type="submit" value="Pay now(working)"></form>
The orderhash and the storefrontid are the values got from hsbc. But i get result from hsbc page as Communication Failure. The CpiDirectResultUrl and CpiReturnUrl are test pages. I have seen hsbc modules for oscommerce, but this is not a shopping cart, i only want to integrate HSBC
But i get result from hsbc page as Communication Failure.
This appears to be an indication that it does not recognise any of the variables you are passing to it and, sure enough, if you go directly to [cpi.hsbc.com...] in your browser you get the same error.
I suspect you need to change method="get" in your <form> tag.
HTH,
BAD
I have done
$cmd="$path/TestHash.e HASHKEY $str"; // $str contains all hidden variables
$ret=exec($cmd);
$ret=split(':',$ret);
$hash=trim($ret[1]);
But i am not getting any value now on $hash. Anyone know how to to execute TestHash.e and get value for $hash?
Cheers,
hughie
function generate_hash()
{
$c_files_path="/home/mysitefiles/hsbcbits/";
$merchantData=$_SESSION[sessionid];
$themode='T';
$GLOBALS[orderdesc]='blah';
$GLOBALS[ordertotal]=($this->ordertotal)*100;
$orderid=$this->orderid;
$ordercurrency=826;
$storeid='UK300000000GBP';
$timestamp=time()*1000;
$transaction_type='Auth';
$userid='userid';
$cmd=$c_files_path.'TestHash.e MYHASHKEYjkshdjkasdb "https://secure.site.com/order_result.php" "https://secure.site.com/order_complete.php" "'.$_SESSION[sessionid].'" "T" "'.$GLOBALS[orderdesc].'" "'.$orderid.'" "'.$GLOBALS[ordertotal].'" "826" "UK00101000GBP" "'.$timestamp.'" "Auth" "userid" ';
$ret=exec($cmd);
$ret=split(':',$ret);
//Returns the hash
$hash=trim($ret[1]);
return $hash;
}
<form name="cpiForm" method="POST" action="https://www.cpi.hsbc.com/servlet">
<INPUT type="hidden" size="80" name="CpiDirectResultUrl" value="https://secure.mysite.com/order_result.php">
<INPUT type="hidden" size="80" name="CpiReturnUrl" value="https://secure.mysite.com/order_complete.php">
<INPUT type="hidden" size="80" name="MerchantData" value="'.$_SESSION[sessionid].'">
<INPUT type="hidden" size="80" name="Mode" value="T">
<INPUT type="hidden" size="80" name="OrderDesc" value="'.$GLOBALS[orderdesc].'">
<input type="hidden" name="OrderHash" value="'.$GLOBALS[orderhash].'">
<input type="hidden" name="OrderId" value="'.$GLOBALS[orderid].'">
<INPUT type="hidden" size="80" name="PurchaseAmount" value="'.$GLOBALS[ordertotal].'">
<INPUT type="hidden" size="80" name="PurchaseCurrency" value="826">
<INPUT type="hidden" size="80" name="StorefrontId" value="UK0000000GBP">
<INPUT type="hidden" size="80" name="TimeStamp" value="'.$GLOBALS[timestamp_new].'">
<INPUT type="hidden" size="80" name="TransactionType" value="Auth">
<INPUT type="hidden" name="UserId" value="userid">
<input type="submit" value="PROCEED TO HSBC" class="submit">
</form>
i'm not unix guru so i just stuck it there and it seemed to work ;-)
I don't have access to lib directory, is it necessary to put in that directory itself?
plz chk _SERVER["PATH"] in phpinfo, is /usr/lib one of the path in that
when i used phpinfo(), the directory usr/bin was showing in _SERVER["PATH"]. Was it the same for you?
I tried the hash generation in my local systems which is running in windows. I put the .dll file in the paths in _SERVER["PATH"] (not in lib dir) and it worked and tht is the reason why i asked to check the server path