liugc 9 месяцев назад
Родитель
Сommit
2f0bc22831
1 измененных файлов с 11 добавлено и 3 удалено
  1. 11 3
      app/api/controller/DouYinController.php

+ 11 - 3
app/api/controller/DouYinController.php

@@ -37,9 +37,17 @@ class DouYinController extends BaseApiController
     public array $notNeedLogin = ['testNotify','getClientToken','getOpenid','register','account','goodsNotify','getAllGoods','getGoodsDetail','submitOrderNotify','payNotify','payTailNotify'];
     public function testNotify()
     {
-        $params = $this->request->post();
-        Log::info('testNotify'.formatLogData($params));
-        return $this->success();
+        try {
+            $params = $this->request->post();
+            Log::info('testNotify'.formatLogData($params));
+            //"type": "pre_create_refund"
+            if($params['type'] == 'pre_create_refund'){
+                $this->refundNotify();
+            }
+            return json(["err_no"=>0,"err_tips"=>""], 200);
+        } catch (\Exception $e) {
+            return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
+        }
     }
     /**
      * 手机号注册