if (!isset($_GET['code']))
{
//触发微信返回code码
$url = $jsApi->createOauthUrlForCode(WxPayConf_pub::JS_API_CALL_URL);
Header("Location: $url");
}else
{
//获取code码,以获取openid
$code = $_GET['code'];
$jsApi->setCode($code);
$openid = $jsApi->getOpenId();
}
$unifiedOrder->setParameter("openid","$openid");
刷新或者错误返回提示:
统一支付接口中,缺少必填参数
openid
!trade_type
为JSAPI
时,openid
为必填参数!
认证0级讲师