Exemple #1
0
function PayApiShopPay($ddid, $money, $paybz, $orderid, $userid, $username, $ecms_paytype)
{
    global $empire, $dbtbpre;
    $ddid = (int) $ddid;
    $userid = (int) $userid;
    $username = RepPostVar($username);
    $ecms_paytype = RepPostVar($ecms_paytype);
    //验证是否重复提交
    $orderid = RepPostVar($orderid);
    $num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewspayrecord where orderid='{$orderid}' limit 1");
    if ($num) {
        printerror('您已成功购买此订单', '../../ShopSys/buycar/', 1, 0, 1);
    }
    $ddr = PayApiShopDdMoney($ddid);
    if ($money == $ddr['tmoney']) {
        include '../../ShopSys/class/ShopSysFun.php';
        $money = (double) $money;
        $sql = $empire->query("update {$dbtbpre}enewsshopdd set haveprice=1 where ddid='{$ddid}'");
        //减少库存
        $shoppr = ShopSys_ReturnSet();
        if ($shoppr['cutnumtype'] == 1) {
            $buycarr = $empire->fetch1("select buycar from {$dbtbpre}enewsshopdd_add where ddid='{$ddid}'");
            Shopsys_CutMaxnum($ddid, $buycarr['buycar'], $ddr['havecutnum'], $shoppr, 0);
        }
        $posttime = date("Y-m-d H:i:s");
        $payip = egetip();
        $userid = (int) $ddr[userid];
        $username = $ddr[username] ? $ddr[username] : $ddr[truename];
        $username = RepPostStr($username);
        $paybz = str_replace('[!--ddno--]', $ddr[ddno], $paybz);
        $paybz = RepPostStr($paybz);
        $empire->query("insert into {$dbtbpre}enewspayrecord(id,userid,username,orderid,money,posttime,paybz,type,payip) values(NULL,'{$userid}','{$username}','{$orderid}','{$money}','{$posttime}','{$paybz}','{$ecms_paytype}','{$payip}');");
    }
    printerror('您已成功购买此订单', '../../ShopSys/buycar/', 1, 0, 1);
}
function PayApiShopPay($ddid, $money, $paybz, $orderid, $userid, $username, $ecms_paytype)
{
    global $empire, $dbtbpre;
    //验证是否重复提交
    $orderid = RepPostVar($orderid);
    $num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewspayrecord where orderid='{$orderid}' limit 1");
    if ($num) {
        printerror('您已成功购买此订单', '../../ShopSys/buycar/', 1, 0, 1);
    }
    $ddr = PayApiShopDdMoney($ddid);
    if ($money == $ddr['tmoney']) {
        $money = (double) $money;
        $sql = $empire->query("update {$dbtbpre}enewsshopdd set haveprice=1 where ddid='{$ddid}'");
        $posttime = date("Y-m-d H:i:s");
        $payip = egetip();
        $userid = (int) $ddr[userid];
        $username = $ddr[username] ? $ddr[username] : $ddr[truename];
        $username = RepPostStr($username);
        $paybz = str_replace('[!--ddno--]', $ddr[ddno], $paybz);
        $empire->query("insert into {$dbtbpre}enewspayrecord(id,userid,username,orderid,money,posttime,paybz,type,payip) values(NULL,'{$userid}','{$username}','{$orderid}','{$money}','{$posttime}','{$paybz}','{$ecms_paytype}','{$payip}');");
    }
    printerror('您已成功购买此订单', '../../ShopSys/buycar/', 1, 0, 1);
}
Exemple #3
0
} elseif ($phome == 'ShopPay') {
    $productname = '商城支付';
} else {
    printerror('您来自的链接不存在', '', 1, 0, 1);
}
include 'payfun.php';
if ($phome == 'PayToFen' || $phome == 'PayToMoney') {
    $user = islogin();
    //是否登陆
    $pr = $empire->fetch1("select paymoneytofen,payminmoney from {$dbtbpre}enewspublic limit 1");
    if ($money < $pr['payminmoney']) {
        printerror('金额不能小于 ' . $pr['payminmoney'] . ' 元', '', 1, 0, 1);
    }
} elseif ($phome == 'ShopPay') {
    $ddid = (int) getcvar('paymoneyddid');
    $ddr = PayApiShopDdMoney($ddid);
    if ($money != $ddr['tmoney']) {
        printerror('订单金额有误', '', 1, 0, 1);
    }
    $ddno = $ddr[ddno];
    $productname = "支付订单:" . $ddno;
}
esetcookie("payphome", $phome, 0);
//返回地址前缀
$PayReturnUrlQz = $public_r['newsurl'];
if (!stristr($public_r['newsurl'], '://')) {
    $PayReturnUrlQz = eReturnDomain() . $public_r['newsurl'];
}
//编码
if ($phome_ecms_charver != 'gb2312') {
    @(include_once "../class/doiconv.php");