get_one("select * from tb_recharge_pay where ORDERSEQ='{$ordid}'"); if(!$row) { $db->get_one("insert into tb_recharge_pay set ORDERSEQ='{$ordid}', ORDERREQTRANSEQ='{$orderreqtranseq}', AMOUNT='{$amount}',url='{$url}', addtime=now()"); $row = $db->get_one("select * from tb_recharge_pay where ORDERSEQ='{$ordid}'"); } else { $r_amount = $row['AMOUNT']; $addtime = $row['addtime']; $retncode = $row['RETNCODE']; if($retncode == '0000') { return "has success"; } if(time() - strtotime($addtime) > 300) { return "overtime"; } if($amount != $r_amount) { return "amount error"; } } $attachamount = "0.00"; // Payment Version $productamount = $amount; $orderamount =$attachamount+$productamount; // Amount $orderamount = number_format($orderamount, 2, '.', ''); $orderdate=date('YmdHis'); if($ispc) { $macmd5="MERCHANTID={$merid}&ORDERSEQ={$ordid}&ORDERDATE={$orderdate}&ORDERAMOUNT=".intval($orderamount*100)."&CLIENTIP=".$_SERVER['REMOTE_ADDR']."&KEY=".$paykey; } else { $macmd5="MERCHANTID=$merid&ORDERSEQ=$ordid&ORDERDATE=$orderdate&ORDERAMOUNT=$orderamount&KEY=$paykey"; } $mac=md5($macmd5); $curtype='RMB'; $encodetype = "1"; // Currency Type, Use CNY $transdate = date('Ymd'); // Order Date $busicode = "0001"; // Transaction type, Consume //$nowhost = @file_get_contents("/home/www/nowhost"); if(is_file("/home/www/nowhost")) $nowhost = @file_get_contents("/home/www/nowhost"); else $nowhost = @file_get_contents("d:/web/nowhost"); if(!$nowhost) $nowhost = $_SERVER['HTTP_HOST']; $pagereturl = "http://".$nowhost."/show/pay_recv.php"; # Feedback Url $bgreturl = "http://".$nowhost."/show/pay_recv.php"; $productdesc='饭卡充值'; $productid='99'; $tmnum=''; $customerid=''; ?>
.do" method="post"> "/>
300) { echo "err1"; exit; } $sign2 = md5(substr(sha1($oid."_".$amount."_".$time), 4, 20)); if($sign != $sign2) { echo "err2"; exit; } echo pay($oid, $amount, $url, $ispc); } //$oid = "423787248954"; //$amount = "0.01"; //$url = "http://www.baidu.com";