commit | author | age
|
3e083b
|
1 |
<?php |
B |
2 |
|
|
3 |
/** |
|
4 |
* 支付响应页面 |
|
5 |
*/ |
|
6 |
|
|
7 |
define('IN_ECS', true); |
|
8 |
|
|
9 |
require(dirname(__FILE__) . '/includes/init.php'); |
|
10 |
require(ROOT_PATH . 'includes/lib_payment.php'); |
|
11 |
require(ROOT_PATH . 'includes/lib_order.php'); |
|
12 |
/* 支付方式代码 */ |
|
13 |
$pay_code="wxnative"; |
|
14 |
$_GET["code"]="wxnative"; |
|
15 |
|
|
16 |
|
|
17 |
function logResultx($word = '',$var=array()) { |
|
18 |
$output = $word . print_r($var, true); |
|
19 |
$fp = fopen(ROOT_PATH . "/data/log/wxnative.txt", "a"); |
|
20 |
flock($fp, LOCK_EX); |
|
21 |
fwrite($fp, "执行日期:" . strftime("%Y%m%d%H%M%S", time()) . "\n" . $output . "\n"); |
|
22 |
flock($fp, LOCK_UN); |
|
23 |
fclose($fp); |
|
24 |
} |
|
25 |
|
|
26 |
logResultx("resposdwx:",$_GET); |
|
27 |
|
|
28 |
/* 判断是否启用 */ |
|
29 |
$sql = "SELECT COUNT(*) FROM " . $ecs->table('payment') . " WHERE pay_code = '$pay_code' AND enabled = 1"; |
|
30 |
if ($db->getOne($sql) == 0) |
|
31 |
{ |
|
32 |
$msg = $_LANG['pay_disabled']; |
|
33 |
} |
|
34 |
else |
|
35 |
{ |
|
36 |
$plugin_file = 'includes/modules/payment/' . $pay_code . '.php'; |
|
37 |
|
|
38 |
/* 检查插件文件是否存在,如果存在则验证支付是否成功,否则则返回失败信息 */ |
|
39 |
if (file_exists($plugin_file)) |
|
40 |
{ |
|
41 |
/* 根据支付方式代码创建支付类的对象并调用其响应操作方法 */ |
|
42 |
include_once($plugin_file); |
|
43 |
|
|
44 |
$payment = new $pay_code(); |
|
45 |
$msg = (@$payment->respond()) ? $_LANG['pay_success'] : $_LANG['pay_fail']; |
|
46 |
} |
|
47 |
else |
|
48 |
{ |
|
49 |
$msg = $_LANG['pay_not_exist']; |
|
50 |
} |
|
51 |
|
|
52 |
} |
|
53 |
|
|
54 |
assign_template(); |
|
55 |
$position = assign_ur_here(); |
|
56 |
$smarty->assign('page_title', $position['title']); // 页面标题 |
|
57 |
$smarty->assign('ur_here', $position['ur_here']); // 当前位置 |
|
58 |
$smarty->assign('page_title', $position['title']); // 页面标题 |
|
59 |
$smarty->assign('ur_here', $position['ur_here']); // 当前位置 |
|
60 |
$smarty->assign('helps', get_shop_help()); // 网店帮助 |
|
61 |
|
|
62 |
$smarty->assign('message', $msg); |
|
63 |
$smarty->assign('shop_url', $ecs->url()); |
|
64 |
|
|
65 |
$smarty->display('respond.dwt'); |
|
66 |
|
|
67 |
?> |