Heim  >  Fragen und Antworten  >  Hauptteil

WeChat Call-to-Pay ist ungültig

Array

(

    [errcode] => 40002

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

)

<br. />

<b>Hinweis< ;/b>:  Undefinierter Index: openid in <b>D:phpStudyWWW paymentBase.php</b> online <b>64</b><br />

<br />

<b>Schwerwiegender Fehler</b>:  Aufruf der undefinierten Methode weixinpay::postXml() in < ;b>D:phpStudyWWW paymentBase.php</b> online <b>95</b><br />

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

这是怎么什么错了  

四个猪蹄四个猪蹄2284 Tage vor1422

Antworte allen(4)Ich werde antworten

  • 一叶雨尘

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

    openid有问题

    Antwort
    0
  • 一叶雨尘

    请求参数错了?可以看下官方的报错文档么

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

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

    后台就是这样写的

    Antwort
    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
  • StornierenAntwort