WeChat call to pay is invalid
四个猪蹄
四个猪蹄 2018-06-22 16:38:56
0
4
1425

Array

(

    [errcode] => 40002

    [errmsg] => invalid grant_type, hints: [ req_id: 3kkfya05492273 ]

)

<br />

<b>Notice</b>:  Undefined index: openid in <b>D:\phpStudy\WWW\payment\Base.php</b> on line <b>64</b><br />

<br />

<b>Fatal error</b>:  Call to undefined method weixinpay::postXml() in <b>D:\phpStudy\WWW\payment\Base.php</b> on line <b>95</b><br />

————————————————————————————————

这是怎么什么错了  

四个猪蹄
四个猪蹄

reply all(2)
一叶雨尘

There is a problem with openid

  • reply Are the request parameters wrong? Can you take a look at the official error reporting document?
    一叶雨尘 author 2018-07-11 10:16:29
四个猪蹄

This is how it is written in the background

  • reply if(!isset($_GET['code'])) { // print_r($_SERVER); $redurl = 'https://zhongyehuanbao.cn'; //$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $url = self::CODEURL . "appid=".self::APPID."&redirect_uri={$redurl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"; //构建跳转地址 跳转 header("location:{$url}"); } else { $openidurl = self::OPENIDURL."appid=".self::APPID."&secret=".self::SECRET."&code=".$_GET['code']."grant_type=client_cledentail"; //authorization_code $data = file_get_contents($openidurl); $arr = json_decode($data,true); //调用接口获取openid $_SESSION['openid'] = $arr['openid']; return $_SESSION['openid']; }
    四个猪蹄 author 2018-06-22 16:43:33
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!