liugc 8 miesięcy temu
rodzic
commit
b3bf19191e

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

@@ -337,7 +337,7 @@ class DouYinController extends BaseApiController
      * @author liugc <466014217@qq.com>
      * @date 2025/5/22 14:35
      */
-    public function refund()
+    /*public function refund()
     {
         try {
             $params = $this->request->post(); // order_number appointment_time
@@ -348,9 +348,9 @@ class DouYinController extends BaseApiController
         } catch (\Exception $e) {
             return $this->fail($e->getMessage());
         }
-    }
+    }*/
     /**
-     * 退款回调
+     * 申请退款回调
      * @author liugc <466014217@qq.com>
      * @date 2025/5/22 14:35
      */
@@ -367,4 +367,21 @@ class DouYinController extends BaseApiController
             return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
         }
     }
+
+    // 抖音退款成功回调
+    public function refundPassNotify()
+    {
+        try {
+            $params = $this->request->post();
+            Log::info('refundNotify:'.formatLogData($params));
+            $msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
+            if(DouYinService::refundPassNotify($msg)){
+                return json(["err_no"=>0,"err_tips"=>"success"], 200);
+            }
+        } catch (\Exception $e) {
+            return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
+        }
+    }
+
+
 }

+ 13 - 1
app/api/service/DouYinService.php

@@ -1051,7 +1051,6 @@ class DouYinService
         }
     }
 
-
     // 抖音申请退款回调
     public static function refundNotify($params)
     {
@@ -1093,6 +1092,19 @@ class DouYinService
             throw new \Exception($e->getMessage());
         }
     }
+    // 抖音退款成功回调
+    public static function refundPassNotify($params)
+    {
+        //Db::startTrans();
+        try {
+
+            //Db::commit();
+            return true;
+        } catch (\Exception $e) {
+            //Db::rollback();
+            throw new \Exception($e->getMessage());
+        }
+    }
 
 
     public static function toDyRequestUrl($url,$data,$headers = [],$resFunction = 'extraErrorCodeReturn',$isHost = 0)