search

Home  >  Q&A  >  body text

WeChat call to pay is invalid

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 />

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

这是怎么什么错了  

四个猪蹄四个猪蹄2411 days ago1511

reply all(4)I'll reply

  • 一叶雨尘

    一叶雨尘2018-06-25 15:10:45

    There is a problem with openid

    reply
    0
  • 一叶雨尘

    Are the request parameters wrong? Can you take a look at the official error reporting document?

    一叶雨尘 · 2018-07-11 10:16:29
  • 四个猪蹄

    四个猪蹄2018-06-22 16:42:33

    This is how it is written in the background

    reply
    0
  • 四个猪蹄

    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']; }

    四个猪蹄 · 2018-06-22 16:43:33
  • Cancelreply