Commit 366c49b1 by 冷斌

fix bug

parent 6b5d0298
<?php
<?php
ini_set('date.timezone','Asia/Shanghai');
//error_reporting(E_ERROR);
require_once "../lib/WxPay.Api.php";
......@@ -40,6 +40,8 @@ $input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag($uid);
$input->SetNotify_url('http://'.$_SERVER['HTTP_HOST'].'/wxpay/pay/notify_jsapi.php');
echo 'http://'.$_SERVER['HTTP_HOST'].'/wxpay/pay/notify_jsapi.php';
die;
$input->SetTrade_type("JSAPI");
$input->SetOpenid($openId);
$order = WxPayApi::unifiedOrder($input);
......@@ -61,7 +63,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>微信支付</title>
<script type="text/javascript">
//调用微信JS api 支付
......@@ -84,7 +86,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
window.history.go(-1);
},2000);
}
}
);
}
......@@ -95,7 +97,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
}else{
......@@ -112,9 +114,9 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
<div style="color: #000;text-align: center;font-weight: bold;line-height:50px;font-size:40px;">
<?php echo $money;?>
</div>
<div align="center">
<button style="width:210px; height:50px; border-radius: 5px;background-color:#1aad19; border:0px #179e16 solid; cursor: pointer; color:white; font-size:16px;" type="button" onclick="callpay()" >立即支付</button>
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment