是那里出错了吗?连个提示都没有
function postOrder($orderXml){
$url="https://api.mch.weixin.qq.com/pay/unifiedorder";
$second=60;
$ch = curl_init();
$curlVersion = curl_version();
$ua = "WXPaySDK/3.0.9(".PHP_OS.") PHP/".PHP_VERSION." CURL/".$curlVersion['version']." ".MCHID;
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,1);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);
curl_setopt($ch,CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $orderXml);
$result=curl_exec($ch);
curl_close($ch);
libxml_disable_entity_loader(true);
//先把xml转换为simplexml对象,再把simplexml对象转换成 json,再将 json 转换成数组。
$value_array = json_decode(json_encode(simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
$return_xml = $value_array['prepay_id'];
$this->paramters['prepay_id']=$return_xml;
return $return_xml;
}
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_2&index=3参照文档仔细核对参数。应该是参数有问题。