Browse Source

add bridge

stanley-king 4 years ago
parent
commit
9fe6568608
1 changed files with 4 additions and 0 deletions
  1. 4 0
      helper/rbridge/wsd/Bridge.php

+ 4 - 0
helper/rbridge/wsd/Bridge.php

@@ -92,6 +92,8 @@ class Bridge implements IBridge
 
     public function notify($params)
     {
+        Log::record(__FUNCTION__,Log::DEBUG);
+
         $proxy = new refill_proxy(config::MCH_KEY);
         [$verify, $data] = $proxy->notify($params);
         $mchid = config::MCHID;
@@ -99,11 +101,13 @@ class Bridge implements IBridge
         if ($verify) {
             $body = $this->notify_body($data);
             if ($body === false) {
+                Log::record("body error",Log::DEBUG);
                 return true;
             }
 
             $header = ['Content-Type: application/json'];
             $body = json_encode($body,JSON_UNESCAPED_UNICODE);
+            Log::record("notify body = {$body}",Log::DEBUG);
             $body = mb_convert_encoding($body,'GBK','UTF-8');
             $resp = http_post_data(config::BridgeNotifyURL, $body, $header);