wesmiler 4 лет назад
Родитель
Сommit
f6fdbec2a7
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      app/Http/Controllers/Api/v1/NotifyController.php

+ 5 - 5
app/Http/Controllers/Api/v1/NotifyController.php

@@ -7,8 +7,7 @@ use App\Services\GongdengOrderService;
 use App\Services\NotifyService;
 use App\Services\RedisService;
 use App\Services\WechatService;
-use Psr\Http\Message\MessageInterface;
-use Psr\Http\Message\ResponseInterface;
+use Illuminate\Http\Request;
 
 /**
  * 回调控制器
@@ -27,12 +26,11 @@ class NotifyController extends BaseController
      * @since 2020/11/11
      * NotifyController constructor.
      */
-    public function __construct(ResponseInterface $response)
+    public function __construct()
     {
         parent::__construct();
 
         $this->service = new GongdengOrderService();
-        $this->response = $response;
     }
 
     /**
@@ -46,8 +44,10 @@ class NotifyController extends BaseController
        /* $sign = 'JnLbXF3HLEeAVuyVoyedezPV8+mRZ93+rmlbHOIm1I0+YKboBTUmVNwlV9KKOVPXPBQENxjHqT6fR5Qx326uVZryb\/JM+lTdvl3j+XVD0F5NJWZKGu7Zykf69yYMY3wbe1++em\/iiouZLg8\/5KRp7nvNMLL383gemOMRbsYN3+dZ++62qrmVZxo00fHlK+AjxXmV38KRCLtfLWfIsUXw9Zi8hXqHbf+s\/pBthV+Ouasw0Eit4f4E3aDjp4baFD70s\/RsbcqTn8UqxCurRNgm7kCtLphzStPnEUC1dfvIWZQIuJ+BaAqstj9y7RW5CdF7aZPqhXnPETvB8ZynSTYl3Q==';
         $timestamp = '1626663968';
         $nonce = 'yWa6xnLUDyqfVYhjTnWcafDuNzgoXMNa';*/
-        $body = NotifyService::getBody($this->response);
+        //$body = NotifyService::getBody($this->response);
+        $body = file_get_contents('php://input');
         $signStr = "{$timestamp}\n{$nonce}\n{$body}\n";
+        var_dump($signStr);
         $id = isset($postData['id'])? '_'.$postData['id'] : '';
         RedisService::set('caches:payments:'.$scene.':result'.$id.'_'.date('YmdHis'), ['result'=> $postData,'sign'=> $sign,'date'=> date('Y-m-d H:i:s')], 7200);
         $postData = isset($postData['resource'])? $postData['resource'] : [];