1 Star 0 Fork 4

Mongo/project_5586013

forked from Dany/mz_yzf 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
pay_return.php 2.40 KB
Copy Edit Raw Blame History
Dany authored 2018-08-05 19:58 . Ver_2.0.2
<?php
/**
* 拇指付API支付接口
* www.muzhifu.cc
* 返回地址文件
*/
require_once("./includes/common.php");
require_once("./includes/muzhifu/muzhifu_config.php");
require_once("./includes/muzhifu/lib/muzhifu_submit.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>拇指付API支付接口</title>
</head>
<body>
<?php
$sign = Muzhifu::sign($_GET, $muzhifu_config['key']);
if ($sign == $_GET['sign']) {
if ($muzhifu_config['partner'] == $_GET['pid']) {
$out_trade_no = $_GET['out_trade_no'];
$trade_no = $_GET['trade_no'];
$trade_status = $_GET['trade_status'];
$srow = $DB->query("SELECT * FROM pay_order WHERE trade_no='{$out_trade_no}' limit 1")->fetch();
if($srow['status'] == '1'){ exit('success');}
if ($_GET['trade_status'] == 'TRADE_SUCCESS') {
$DB->query("update `pay_order` set `status` ='1',`endtime` ='$date',`buyer` ='$buyer_email' where `trade_no`='$out_trade_no'");
$addmoney = round($srow['money'] * $conf['money_rate'] / 100, 2);
$DB->query("update mzf_merchant set money=money+{$addmoney} where id='{$srow['pid']}'");
$url = creat_callback($srow);
curl_get($url['notify']);
//proxy_get($url['notify']);
}
echo 'success';
}
$out_trade_no = $_GET['out_trade_no'];
$trade_no = $_GET['trade_no'];
$trade_status = $_GET['trade_status'];
if ($_GET['trade_status'] == 'TRADE_SUCCESS') {
$srow = $DB->query("SELECT * FROM pay_order WHERE trade_no='{$out_trade_no}' limit 1")->fetch();
$url = creat_callback($srow);
if ($srow['status'] == 0) {
$DB->query("update `pay_order` set `status` ='1',`endtime` ='$date' where `trade_no`='$out_trade_no'");
$addmoney = round($srow['money'] * $conf['money_rate'] / 100, 2);
$DB->query("update mzf_merchant set money=money+{$addmoney} where id='{$srow['pid']}'");
echo '<script>window.location.href="' . $url['return'] . '";</script>';
} else {
echo '<script>window.location.href="' . $url['return'] . '";</script>';
}
} else {
sysmsg('未成功支付!' . "out_trade_no=" . $out_trade_no);
}
} else {
sysmsg('验证失败' . "out_trade_no=" . $out_trade_no);
}
?>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/Mongo/mz_yzf.git
git@gitee.com:Mongo/mz_yzf.git
Mongo
mz_yzf
project_5586013
master

Search