Exemplo n.º 1
0
    $tk = json_decode($res);
    if ($tk->access_token != "") {
        $accesstoken = $tk->access_token;
    } else {
        echo "get access token empty";
        exit(0);
    }
} else {
    echo "get access token error";
    exit(0);
}
//调起地址控件签名
$timestamp = time();
$noncestr = $jsApi->createNoncestr();
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$jsApi->setParameter("appid", Wxconfig::APPID);
$jsApi->setParameter("url", $url);
$jsApi->setParameter("noncestr", $noncestr);
$jsApi->setParameter("timestamp", $timestamp);
$jsApi->setParameter("accesstoken", $accesstoken);
$addrsign = $jsApi->genSha1Sign();
$jsapiParams = $jsApi->getAllParameters();
?>


<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta id="viewport" name="viewport"
	content="width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=no;" />
<title>微信支付</title>