Saturday, July 11, 2009

php realex payment gateway code

$timestamp = strftime("%Y%m%d%H%M%S");
$topay = '5';
$merchantid = "mytalentplace";//here grant crow`s realex merchent id should come
$secret = "wXcHmZ9yec";


$orderid= $timestamp.'-'.$_SESSION['ord_id'];





$amount =$_POST['amt']*100;

if($_REQUEST['currency']=="doller"){

$curr= "USD";

} elseif($_REQUEST['currency']=="euro"){

$curr= "EUR";

}else {

$curr= "GBP";

}

$tmp = "$timestamp.$merchantid.$orderid.$amount.$curr";
//$tmp = "$timestamp.$merchantid.$orderid";

$md5hash = sha1($tmp);

$tmp = "$md5hash.$secret";

$md5hash = sha1($tmp);

$up="UPDATE `mtp_user_payment` SET order_id='".$lid."' where user_payment_id='".$lid."'";
mysql_query($up);
?>



for live
for test

No comments:

Post a Comment