-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcharge.php
More file actions
69 lines (58 loc) · 1.8 KB
/
mcharge.php
File metadata and controls
69 lines (58 loc) · 1.8 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* 付费后上报已付费的订单号及终端信息
*
*/
require_once 'public/public.php';
require_once 'public/check.php';
require_once 'lib/WriteLog.lib.php';
if(checkVersion($_GET)){
$bRet = checkTKT($_POST);
if(!$bRet){
echo get_rsp_result(false, 'check token fail');
exit();
}
}
try{
$strExorder = isset($_GET['exorder'])?$_GET['exorder']:''; //订单号
if(empty($strExorder)){
echo get_rsp_result(false, 'exorder is empty');
exit;
}
$isScore = (int)(isset($_GET['isscore'])?$_GET['isscore']:0);
require_once 'tasks/Exorder/ExorderRecordDb.class.php';
$erDb = new ExorderRecordDb();
$bResult = $erDb->updateMobileExorder($strExorder, $isScore);
if(!$bResult){
Log::write('mcharge updateMobileExorder() failed', 'log');
echo get_rsp_result(false, 'save mobile charge failed');
exit();
}
echo get_rsp_result(true);
require_once 'tasks/Records/RecordTask.class.php';
$rt = new RecordTask();
$nCoolType = 0;
$isScore = 0;
$nProtocolCode = (int)(isset($_GET['protocolCode'])?$_GET['protocolCode']:0);
if(isset($_GET['type']))
{
$nCoolType = $_GET['type'];
}else{
$exorder = $erDb->getExorderById($strExorder);
if(!$exorder){
Log::write('mcharge getExorderById() failed', 'log');
exit(get_rsp_result(false, 'get exorder failed'));
}
$nCoolType = (int)(isset($exorder['cooltype'])?$exorder['cooltype']:0);
}
$strCyid = isset($_GET['cyid'])?$_GET['cyid']:'';
if (!empty($strCyid)){
$strId = isset($_GET['id'])?$_GET['id']:'';
$strCpid = isset($_GET['cpid'])?$_GET['cpid']:'';
$erDb->saveChargeRecord($strExorder, $strCyid, $nCoolType, $strId, $strCpid);
}
$rt->updateOrder($nCoolType, $strExorder, $isScore);
}catch(Exception $e){
Log::write('mcharge exception', 'log');
echo get_rsp_result(false, 'mcharge exception');
}