html52.com
我爱小程序-开发者交流社区

微信公众号,服务器配置,token一直验证失败,怎么办?

appid:wx78808602da8913f8

url:https://api.muaaa.cn/apii/acswechat/opindex

public function opindexAction(){
        header("Content-type: text/html; charset=utf-8");
        //valid signature , option
        if ($this->checkSignature()) {
            echo $_GET["echostr"];
            exit;
        }
    }
    
    //验证所有者使用
    private function checkSignature(){
        header("Content-type: text/html; charset=utf-8");
        $signature = $_GET["signature"];
        $timestamp = $_GET["timestamp"];
        $nonce = $_GET["nonce"];

        $token = 'muaaawechattoken';
        $tmpArr = [$token, $timestamp, $nonce];
        sort($tmpArr);
        $tmpStr = implode('',$tmpArr);
        $tmpStr = sha1( $tmpStr );

        if( $tmpStr == $signature ){
            return true;
        }else{
            return false;
        }
    }

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付