/
toalipay.php
67 lines (53 loc) · 1.82 KB
/
toalipay.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
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
<?php
define('IN_HHS', true);
define('HHS_ADMIN', true);
if(strpos($_SERVER['HTTP_USER_AGENT'],"MicroMessenger")!==false){
$ua=1;
}else{
$ua=2;
}
if($ua==1){
require(dirname(__FILE__) . '/includes/init.php');
}else{
require(dirname(__FILE__) . '/includes/init2.php');
}
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($agent, 'iphone') || strpos($agent, 'ipad')){
$phone_type = 2;
}
elseif(strpos($agent, 'android')){
$phone_type = 1;
}
$smarty->assign('phone_type', $phone_type );
/* 载入语言文件 */
require_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/user.php');
include_once(ROOT_PATH . 'includes/lib_clips.php');
include_once(ROOT_PATH . 'includes/lib_transaction.php');
include_once(ROOT_PATH . 'includes/lib_payment.php');
include_once(ROOT_PATH . 'includes/lib_order.php');
$act = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'default';
$order_id = isset($_REQUEST['order_id']) ? trim($_REQUEST['order_id']) : 0;
$smarty->assign('order_id', $order_id );
/*
$smarty->assign('appid', $appid);
$timestamp=time();
$smarty->assign('timestamp', $timestamp );
$class_weixin=new class_weixin($appid,$appsecret);
$signature=$class_weixin->getSignature($timestamp);
$smarty->assign('signature', $signature);
*/
$order_info=order_info($order_id);
$smarty->assign('order_info', $order_info );
if($ua==1){//微信上打开
//将openid记录下
$smarty->assign('xaphp_sopenid', $_SESSION['xaphp_sopenid'] );
$smarty->display("toalipay.dwt");
}else{//其他浏览器上打开
include_once('includes/modules/payment/alipay.php');
$pay_obj = new alipay();
$payment = payment_info($order_info['pay_id']);
$pay_online = $pay_obj->get_code($order_info, unserialize_config($payment['pay_config']));
//$order['pay_desc'] = $payment['pay_desc'];
echo $pay_online;
}
?>