zory 2 hete
szülő
commit
34ff0cb450
1 módosított fájl, 15 hozzáadás és 52 törlés
  1. 15 52
      app/controller/mini/Notify.php

+ 15 - 52
app/controller/mini/Notify.php

@@ -14,16 +14,16 @@ class Notify extends Base
 {
 
     /**
-     * 撤销核销通知
+     * 核销工具解决方案-spi
      * @param Request $request
      * @return Response
      */
-    #[Route(path: "cancel",methods: "post")]
-    public function getCancel(Request $request): Response
+    #[Route(path: "mini",methods: "post")]
+    public function getSpiData(Request $request): Response
     {
         try {
             $param = $request->post();
-            echo getDateFull()."==撤销核销通知==\n";
+            echo getDateFull()."=={$param['type']}==\n";
             print_r($param);
             return json([
                 "err_no"    => 0,
@@ -36,16 +36,23 @@ class Notify extends Base
 
 
     /**
-     * 券核销通知
+     * 核销工具解决方案-扩展点-spi
      * @param Request $request
      * @return Response
      */
-    #[Route(path: "verify",methods: "post")]
-    public function getVerify(Request $request): Response
+    #[Route(path: "expand",methods: "post")]
+    public function getExpandData(Request $request): Response
     {
         try {
             $param = $request->post();
-            echo getDateFull()."==券核销通知==\n";
+            switch ($param['type'])
+            {
+                case "pre_create_order": // 预下单回调
+                    break;
+                case "pre_create_refund": // 退款审核回调
+                    break;
+            }
+            echo getDateFull()."=={$param['type']}==\n";
             print_r($param);
             return json([
                 "err_no"    => 0,
@@ -55,48 +62,4 @@ class Notify extends Base
             return error($throwable->getMessage());
         }
     }
-
-
-    /**
-     * 交易系统支付结果通知
-     * @param Request $request
-     * @return Response
-     */
-    #[Route(path: "pay",methods: "post")]
-    public function getPay(Request $request): Response
-    {
-        try {
-            $param = $request->post();
-            echo getDateFull()."==交易系统支付结果通知==\n";
-            print_r($param);
-            return json([
-                "err_no"    => 0,
-                "err_tips"  => "success"
-            ]);
-        } catch (\Throwable $throwable) {
-            return error($throwable->getMessage());
-        }
-    }
-
-    /**
-     * 交易系统退款通知
-     * @param Request $request
-     * @return Response
-     */
-    #[Route(path: "refund",methods: "post")]
-    public function getRefund(Request $request): Response
-    {
-        try {
-            $param = $request->post();
-            echo getDateFull()."==交易系统退款通知==\n";
-            print_r($param);
-            return json([
-                "err_no"    => 0,
-                "err_tips"  => "success"
-            ]);
-        } catch (\Throwable $throwable) {
-            return error($throwable->getMessage());
-        }
-    }
-
 }