forked from rakirizu/QuanAuth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payresult.php
37 lines (33 loc) · 1002 Bytes
/
payresult.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* Created by PhpStorm.
* User: 80071
* Date: 2018/2/6
* Time: 18:12
*/
include "function/function_core.php";
error_reporting(E_ALL);
if (empty($_GET['tradeno'])) {
tips('订单号为空!', 'index.php');
}
$tradeno = $_GET['tradeno'];
if (!$tradeinfo = $db->select_first_row('sq_trade', '*', array('tradeno' => $tradeno), 'AND')) {
tips('无法拉取订单信息!', 'index.php');
}
if ($tradeinfo['status'] == '3') {
tips('该订单已处理成功,无需再次处理!', 'index.php');
}
if ($tradeinfo['status'] != '2') {
tips('订单状态不正常,无法继续操作!', 'index.php');
}
if (!$db->update('sq_trade', array('tradeno' => $tradeno,'status'=>'2'), 'AND', array('status' => 3))) {
tips('订单更新失败', 'index.php');
}
include 'function/trade.inc.php';
$back = trade_do($tradeinfo);
$back = json_decode($back,true);
if ($back['code'] == 2){
die('已成功生成卡密:'.$back['kami']);
}else{
tips($back['msg'],'index.php');
}