2014-06-19 100 views
0

我在微信沙箱環境中提交我的URL和令牌後彈出「配置失敗」。任何人都可以建議調試或找到解決方案嗎?以下是詳細信息:WeChat SandBox API配置失敗

  • 運行Heroku服務器並使用heroku生成的URL。
  • 推送了文檔中的示例代碼here
  • 按照YouTube教程,複製了代碼並嘗試了這一點。
<?php 

$data[] = 'Test123'; 
$data[] = $_GET['timestamp']; 
$data[] = $_GET['nonce']; 

asort($data); 

$strData = ''; 
$d = ''; 
$authString = ''; 
foreach($data as $d){ 
$authString .= $d; 
} 


//verify the signture 
if(sha1($authString) == $_GET[signature]){ 
//check if the echostr 
    if(!empty($_GET['echostr'])){ 
    echo $_GET['echostr']; 
    die(); 
}else{ 
//logic goes here 
     $return = '<xml> 
       <ToUserName><![CDATA['.$toUser.']]></ToUserName> 
       <FromUserName><![CDATA['.$fromUser.']]></FromUserName> 
       <CreateTime>'.time().'</CreateTime> 
       <MsgType><![CDATA[text]]></MsgType> 
       <Content><![CDATA['.$text.']]></Content> 
       <FuncFlag>0</FuncFlag> 
       </xml>'; 
       echo $return; 
    } 
}else{ 
    die('You are not supposed to be here'); 
} 


?> 
  • 檢查日誌,發現其工作正常,但沒有顯示出活動時,我提交的URL和令牌上微信的沙箱。
  • 已嘗試使用URL的不同變體,從使用根URL到使用php文件完成,例如xxxx/responder.php
  • 已提交的令牌與代碼中使用的令牌相匹配。
  • 將原始php上傳到服務器,用文檔代碼或youtube代碼劫持了heroku php hello world app

代碼本身直接來自微信公衆號或Youtube視頻。請讓我知道我是否可以提供任何其他信息。

任何意見,提示或提示將非常感激。

+0

我也嘗試使用託管帳戶。 URL http://smartaverage.com/wechat/first/first_app.php沒有成功。同樣,在查看應用服務器的原始訪問日誌時,在URL和TOKEN提交之後,它們不會顯示來自微信服務器的任何請求的記錄,也不會包含任何四個預期的GET參數 – user3757887

回答

0

請檢查。 International的沙箱環境已被打破。這應該現在解決。請再次測試